From 727222f64e447dbb7163f32f3a7c86316856824d Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 6 Feb 2026 16:23:16 +0000 Subject: [PATCH 1/2] feat: A new field `revisions` is added to message `.google.cloud.documentai.v1beta3.Evaluation` feat: A new field `document_type` is added to message `.google.cloud.documentai.v1beta3.ImportDocumentsRequest` feat: A new field `document_prompt` is added to message `.google.cloud.documentai.v1beta3.DocumentSchema` feat: A new field `enable_table_split` is added to message `.google.cloud.documentai.v1beta3.OcrConfig.LayoutParsingParams` feat: Added new messages `Documents` and `RawDocuments` for inline document input feat: The method `ReviewDocument` in `.google.cloud.documentai.v1beta3.DocumentProcessorService` is deprecated feat: The field `skip_human_review` in messages `.google.cloud.documentai.v1beta3.ProcessRequest` and `.google.cloud.documentai.v1beta3.BatchProcessRequest` is deprecated fix!: Removed the `SpannerIndexingConfig` message and the `spanner_indexing_config` field from `.google.cloud.documentai.v1beta3.Dataset` BREAKING CHANGE: The `SpannerIndexingConfig` message and the `spanner_indexing_config` field within the `Dataset` message have been removed. Client code referencing these will need to stop referencing these in case of an error docs: Updated comments for various fields and messages PiperOrigin-RevId: 866382481 Source-Link: https://github.com/googleapis/googleapis/commit/39bd091b055e331a4917143355ab7afa83b7130c Source-Link: https://github.com/googleapis/googleapis-gen/commit/7f268c8b88b3e5e5f4376bbae3e78fdf2953cac5 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6IjdmMjY4YzhiODhiM2U1ZTVmNDM3NmJiYWUzZTc4ZmRmMjk1M2NhYzUifQ== --- .../google-cloud-documentai/.OwlBot.yaml | 19 + .../google-cloud-documentai/.eslintignore | 7 + .../google-cloud-documentai/.eslintrc.json | 3 + .../google-cloud-documentai/.gitattributes | 4 + .../google-cloud-documentai/.gitignore | 14 + .../google-cloud-documentai/.jsdoc.js | 55 + .../google-cloud-documentai/.mocharc.js | 33 + .../google-cloud-documentai/.nycrc | 24 + .../google-cloud-documentai/.prettierignore | 6 + .../google-cloud-documentai/.prettierrc.js | 22 + .../CODE_OF_CONDUCT.md | 94 + .../google-cloud-documentai/CONTRIBUTING.md | 76 + .../google-cloud-documentai/LICENSE | 202 + .../google-cloud-documentai/README.md | 167 + .../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 | 1261 + .../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 + .../cloud/documentai/v1beta3/barcode.proto | 69 + .../cloud/documentai/v1beta3/dataset.proto | 193 + .../cloud/documentai/v1beta3/document.proto | 1363 + .../documentai/v1beta3/document_io.proto | 188 + .../v1beta3/document_processor_service.proto | 1472 + .../documentai/v1beta3/document_schema.proto | 246 + .../documentai/v1beta3/document_service.proto | 456 + .../cloud/documentai/v1beta3/evaluation.proto | 202 + .../cloud/documentai/v1beta3/geometry.proto | 55 + .../v1beta3/operation_metadata.proto | 66 + .../cloud/documentai/v1beta3/processor.proto | 297 + .../documentai/v1beta3/processor_type.proto | 67 + .../protos/protos.d.ts | 49693 ++++++ .../google-cloud-documentai/protos/protos.js | 124847 +++++++++++++++ .../protos/protos.json | 11380 ++ ...ocessor_service.batch_process_documents.js | 96 + ...ment_processor_service.create_processor.js | 72 + ...ment_processor_service.delete_processor.js | 62 + ...cessor_service.delete_processor_version.js | 62 + ...cessor_service.deploy_processor_version.js | 62 + ...ent_processor_service.disable_processor.js | 62 + ...ment_processor_service.enable_processor.js | 62 + ...ssor_service.evaluate_processor_version.js | 70 + ...processor_service.fetch_processor_types.js | 62 + ...cument_processor_service.get_evaluation.js | 63 + ...ocument_processor_service.get_processor.js | 61 + ...nt_processor_service.get_processor_type.js | 61 + ...processor_service.get_processor_version.js | 61 + ...ment_processor_service.list_evaluations.js | 77 + ..._processor_service.list_processor_types.js | 74 + ...ocessor_service.list_processor_versions.js | 76 + ...ument_processor_service.list_processors.js | 75 + ...ment_processor_service.process_document.js | 110 + ...ument_processor_service.review_document.js | 80 + ...r_service.set_default_processor_version.js | 72 + ...ocessor_service.train_processor_version.js | 92 + ...ssor_service.undeploy_processor_version.js | 62 + ...t_metadata_google.cloud.documentai.v1.json | 1031 + ...ocessor_service.batch_process_documents.js | 104 + ...ment_processor_service.create_processor.js | 72 + ...ment_processor_service.delete_processor.js | 62 + ...cessor_service.delete_processor_version.js | 62 + ...cessor_service.deploy_processor_version.js | 62 + ...ent_processor_service.disable_processor.js | 62 + ...ment_processor_service.enable_processor.js | 62 + ...ssor_service.evaluate_processor_version.js | 70 + ...processor_service.fetch_processor_types.js | 62 + ...cument_processor_service.get_evaluation.js | 63 + ...ocument_processor_service.get_processor.js | 61 + ...nt_processor_service.get_processor_type.js | 61 + ...processor_service.get_processor_version.js | 61 + ...cessor_service.import_processor_version.js | 74 + ...ment_processor_service.list_evaluations.js | 77 + ..._processor_service.list_processor_types.js | 74 + ...ocessor_service.list_processor_versions.js | 76 + ...ument_processor_service.list_processors.js | 75 + ...ment_processor_service.process_document.js | 117 + ...ument_processor_service.review_document.js | 84 + ...r_service.set_default_processor_version.js | 72 + ...ocessor_service.train_processor_version.js | 92 + ...ssor_service.undeploy_processor_version.js | 62 + ...document_service.batch_delete_documents.js | 72 + .../document_service.get_dataset_schema.js | 67 + .../v1beta3/document_service.get_document.js | 78 + .../document_service.import_documents.js | 70 + .../document_service.list_documents.js | 117 + .../document_service.update_dataset.js | 67 + .../document_service.update_dataset_schema.js | 66 + ...adata_google.cloud.documentai.v1beta3.json | 1427 + .../google-cloud-documentai/src/index.ts | 28 + .../v1/document_processor_service_client.ts | 3934 + ...ument_processor_service_client_config.json | 140 + ...document_processor_service_proto_list.json | 12 + .../src/v1/gapic_metadata.json | 259 + .../google-cloud-documentai/src/v1/index.ts | 19 + .../document_processor_service_client.ts | 4176 + ...ument_processor_service_client_config.json | 144 + ...document_processor_service_proto_list.json | 14 + .../src/v1beta3/document_service_client.ts | 2032 + .../document_service_client_config.json | 54 + .../v1beta3/document_service_proto_list.json | 14 + .../src/v1beta3/gapic_metadata.json | 357 + .../src/v1beta3/index.ts | 20 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../system-test/install.ts | 49 + .../gapic_document_processor_service_v1.ts | 4453 + ...apic_document_processor_service_v1beta3.ts | 4711 + .../test/gapic_document_service_v1beta3.ts | 2040 + .../google-cloud-documentai/tsconfig.json | 22 + .../google-cloud-documentai/webpack.config.js | 64 + 115 files changed, 223701 insertions(+) create mode 100644 owl-bot-staging/google-cloud-documentai/.OwlBot.yaml create mode 100644 owl-bot-staging/google-cloud-documentai/.eslintignore create mode 100644 owl-bot-staging/google-cloud-documentai/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-documentai/.gitattributes create mode 100644 owl-bot-staging/google-cloud-documentai/.gitignore create mode 100644 owl-bot-staging/google-cloud-documentai/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-documentai/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-documentai/.nycrc create mode 100644 owl-bot-staging/google-cloud-documentai/.prettierignore create mode 100644 owl-bot-staging/google-cloud-documentai/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-documentai/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/google-cloud-documentai/CONTRIBUTING.md create mode 100644 owl-bot-staging/google-cloud-documentai/LICENSE create mode 100644 owl-bot-staging/google-cloud-documentai/README.md create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_io.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_schema.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/evaluation.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/geometry.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/operation_metadata.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/processor.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/processor_type.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/barcode.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/evaluation.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/operation_metadata.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto create mode 100644 owl-bot-staging/google-cloud-documentai/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-documentai/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-documentai/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.deploy_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.disable_processor.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.enable_processor.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.evaluate_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_evaluation.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_type.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.undeploy_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_type.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.batch_delete_documents.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.get_document.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.import_documents.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.list_documents.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js create mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata_google.cloud.documentai.v1beta3.json create mode 100644 owl-bot-staging/google-cloud-documentai/src/index.ts create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client.ts create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client.ts create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/index.ts create mode 100644 owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-documentai/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1beta3.ts create mode 100644 owl-bot-staging/google-cloud-documentai/test/gapic_document_service_v1beta3.ts create mode 100644 owl-bot-staging/google-cloud-documentai/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-documentai/webpack.config.js diff --git a/owl-bot-staging/google-cloud-documentai/.OwlBot.yaml b/owl-bot-staging/google-cloud-documentai/.OwlBot.yaml new file mode 100644 index 00000000000..091a0c24539 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/.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/documentai/google-cloud-documentai-nodejs + dest: /owl-bot-staging/google-cloud-documentai + +api-name: documentai \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-documentai/.eslintignore b/owl-bot-staging/google-cloud-documentai/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-documentai/.eslintrc.json b/owl-bot-staging/google-cloud-documentai/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-documentai/.gitattributes b/owl-bot-staging/google-cloud-documentai/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/.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-documentai/.gitignore b/owl-bot-staging/google-cloud-documentai/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/.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-documentai/.jsdoc.js b/owl-bot-staging/google-cloud-documentai/.jsdoc.js new file mode 100644 index 00000000000..314180e1555 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/.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/documentai', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-documentai/.mocharc.js b/owl-bot-staging/google-cloud-documentai/.mocharc.js new file mode 100644 index 00000000000..5eb34e86c87 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/.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-documentai/.nycrc b/owl-bot-staging/google-cloud-documentai/.nycrc new file mode 100644 index 00000000000..81a95fc94b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/.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-documentai/.prettierignore b/owl-bot-staging/google-cloud-documentai/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/google-cloud-documentai/.prettierrc.js b/owl-bot-staging/google-cloud-documentai/.prettierrc.js new file mode 100644 index 00000000000..7649ee3c254 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/.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-documentai/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-documentai/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/CONTRIBUTING.md b/owl-bot-staging/google-cloud-documentai/CONTRIBUTING.md new file mode 100644 index 00000000000..87aed259257 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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 Documentai 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=documentai.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-documentai/LICENSE b/owl-bot-staging/google-cloud-documentai/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/README.md b/owl-bot-staging/google-cloud-documentai/README.md new file mode 100644 index 00000000000..aee7ef49588 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/README.md @@ -0,0 +1,167 @@ +[//]: # "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 + +# [Cloud Document AI 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/documentai.svg)](https://www.npmjs.org/package/@google-cloud/documentai) + +Cloud Document AI API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Cloud Document AI API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/documentai/latest) +* [Cloud Document AI API Documentation](https://cloud.google.com/document-ai/docs) + +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 Cloud Document AI 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/documentai +``` + +[//]: # "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 | +| --------------------------- | --------------------------------- | +| batch process documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js) | +| create processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js) | +| delete processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor.js) | +| delete processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor_version.js) | +| deploy processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.deploy_processor_version.js) | +| disable processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.disable_processor.js) | +| enable processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.enable_processor.js) | +| evaluate processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.evaluate_processor_version.js) | +| fetch processor types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js) | +| get evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_evaluation.js) | +| get processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor.js) | +| get processor type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_type.js) | +| get processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_version.js) | +| list evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js) | +| list processor types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js) | +| list processor versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js) | +| list processors | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js) | +| process document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js) | +| review document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js) | +| set default processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js) | +| train processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js) | +| undeploy processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.undeploy_processor_version.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json) | +| batch process documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js) | +| create processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js) | +| delete processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor.js) | +| delete processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor_version.js) | +| deploy processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js) | +| disable processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js) | +| enable processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js) | +| evaluate processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js) | +| fetch processor types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js) | +| get evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js) | +| get processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor.js) | +| get processor type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_type.js) | +| get processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.js) | +| import processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js) | +| list evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js) | +| list processor types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js) | +| list processor versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js) | +| list processors | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js) | +| process document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js) | +| review document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js) | +| set default processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js) | +| train processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js) | +| undeploy processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js) | +| batch delete documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.batch_delete_documents.js) | +| get dataset schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js) | +| get document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.get_document.js) | +| import documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.import_documents.js) | +| list documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.list_documents.js) | +| update dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js) | +| update dataset schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata_google.cloud.documentai.v1beta3.json) | + + +## 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/documentai@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-documentai/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-documentai/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=documentai.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-documentai/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto new file mode 100644 index 00000000000..ba6672a0873 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/document.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document.proto new file mode 100644 index 00000000000..1eaad2a3c54 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/document_io.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_io.proto new file mode 100644 index 00000000000..65e7ed447d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto new file mode 100644 index 00000000000..b8a1a76e649 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto @@ -0,0 +1,1261 @@ +// 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/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]; + } + + // 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-documentai/protos/google/cloud/documentai/v1/document_schema.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_schema.proto new file mode 100644 index 00000000000..ad721141a6d --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/evaluation.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/evaluation.proto new file mode 100644 index 00000000000..3ffc570703a --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/geometry.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/geometry.proto new file mode 100644 index 00000000000..b6715431b18 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/operation_metadata.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/operation_metadata.proto new file mode 100644 index 00000000000..0853e38ea8c --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/processor.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/processor.proto new file mode 100644 index 00000000000..2306252d163 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/processor_type.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/processor_type.proto new file mode 100644 index 00000000000..19ae44ee1f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1beta3/barcode.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/barcode.proto new file mode 100644 index 00000000000..02a4cd4bfac --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/barcode.proto @@ -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 +// +// 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.v1beta3; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; +option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "BarcodeProto"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// 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-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto new file mode 100644 index 00000000000..08321edd64c --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto @@ -0,0 +1,193 @@ +// 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.v1beta3; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/documentai/v1beta3/document.proto"; +import "google/cloud/documentai/v1beta3/document_io.proto"; +import "google/cloud/documentai/v1beta3/document_schema.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; +option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DatasetProto"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; +option (google.api.resource_definition) = { + type: "contentwarehouse.googleapis.com/Schema" + pattern: "projects/{project}/locations/{location}/schemas/{schema}" +}; + +// A singleton resource under a +// [Processor][google.cloud.documentai.v1beta3.Processor] which configures a +// collection of documents. +message Dataset { + option (google.api.resource) = { + type: "documentai.googleapis.com/Dataset" + pattern: "projects/{project}/locations/{location}/processors/{processor}/dataset" + }; + + // Configuration specific to the Cloud Storage-based implementation. + message GCSManagedConfig { + // Required. The Cloud Storage URI (a directory) where the documents + // belonging to the dataset must be stored. + GcsPrefix gcs_prefix = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Configuration specific to the Document AI Warehouse-based implementation. + message DocumentWarehouseConfig { + // Output only. The collection in Document AI Warehouse associated with the + // dataset. + string collection = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The schema in Document AI Warehouse associated with the + // dataset. + string schema = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "contentwarehouse.googleapis.com/Schema" + } + ]; + } + + // Configuration specific to an unmanaged dataset. + message UnmanagedDatasetConfig {} + + // Different states of a dataset. + enum State { + // Default unspecified enum, should not be used. + STATE_UNSPECIFIED = 0; + + // Dataset has not been initialized. + UNINITIALIZED = 1; + + // Dataset is being initialized. + INITIALIZING = 2; + + // Dataset has been initialized. + INITIALIZED = 3; + } + + oneof storage_source { + // Optional. User-managed Cloud Storage dataset configuration. Use this + // configuration if the dataset documents are stored under a user-managed + // Cloud Storage location. + GCSManagedConfig gcs_managed_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Deprecated. Warehouse-based dataset configuration is not + // supported. + DocumentWarehouseConfig document_warehouse_config = 5 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. Unmanaged dataset configuration. Use this configuration if the + // dataset documents are managed by the document service internally (not + // user-managed). + UnmanagedDatasetConfig unmanaged_dataset_config = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Dataset resource name. + // Format: + // `projects/{project}/locations/{location}/processors/{processor}/dataset` + string name = 1; + + // Required. State of the dataset. Ignored when updating dataset. + State state = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Document Identifier. +message DocumentId { + // Identifies a document uniquely within the scope of a dataset in the + // user-managed Cloud Storage option. + message GCSManagedDocumentId { + // Required. The Cloud Storage URI where the actual document is stored. + string gcs_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Id of the document (indexed) managed by Content Warehouse. + string cw_doc_id = 2 [deprecated = true]; + } + + // Identifies a document uniquely within the scope of a dataset in unmanaged + // option. + message UnmanagedDocumentId { + // Required. The id of the document. + string doc_id = 1 [(google.api.field_behavior) = REQUIRED]; + } + + oneof type { + // A document id within user-managed Cloud Storage. + GCSManagedDocumentId gcs_managed_doc_id = 1; + + // A document id within unmanaged dataset. + UnmanagedDocumentId unmanaged_doc_id = 4; + } + + // Points to a specific revision of the document if set. + RevisionRef revision_ref = 3; +} + +// Dataset Schema. +message DatasetSchema { + option (google.api.resource) = { + type: "documentai.googleapis.com/DatasetSchema" + pattern: "projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema" + }; + + // Dataset schema resource name. + // Format: + // `projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema` + string name = 1; + + // Optional. Schema of the dataset. + DocumentSchema document_schema = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Reserved for future use. + bool satisfies_pzs = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Dataset documents that the batch operation will be applied to. +message BatchDatasetDocuments { + // List of individual DocumentIds. + message IndividualDocumentIds { + // Required. List of Document IDs indicating where the actual documents are + // stored. + repeated DocumentId document_ids = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + oneof criteria { + // Document identifiers. + IndividualDocumentIds individual_document_ids = 1; + + // A filter matching the documents. + // Follows the same format and restriction as + // [google.cloud.documentai.master.ListDocumentsRequest.filter]. + string filter = 2; + } +} diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto new file mode 100644 index 00000000000..c803d16bbbd --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto @@ -0,0 +1,1363 @@ +// 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.v1beta3; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/documentai/v1beta3/barcode.proto"; +import "google/cloud/documentai/v1beta3/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.V1Beta3"; +option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentProto"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// 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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.text]. + TextAnchor text_anchor = 1; + + // Confidence of the current + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within + // context of the object this layout is for. For example, 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.v1beta3.Document.Page.Layout]. + BoundingPoly bounding_poly = 3; + + // Detected orientation for the + // [Layout][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for + // [Block][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for + // [Paragraph][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for + // [Line][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout] for + // [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. + Layout layout = 1; + + // Detected break at the end of a + // [Token][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for + // [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol]. + Layout layout = 1; + + // A list of detected languages together with confidence. + repeated DetectedLanguage detected_languages = 2; + } + + // Detected non-text visual elements, for example, checkbox, signature etc. + // on the page. + message VisualElement { + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for + // [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement]. + Layout layout = 1; + + // Type of the + // [VisualElement][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for + // [TableCell][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for + // [Table][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for the + // [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] + // name. For example, `Address`, `Email`, `Grand total`, `Phone number`, + // etc. + Layout field_name = 1; + + // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the + // [FormField][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for + // [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode]. + Layout layout = 1; + + // Detailed barcode information of the + // [DetectedBarcode][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page] in a parent + // [Document][google.cloud.documentai.v1beta3.Document]. Useful when a page + // is taken out of a [Document][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.image]. + repeated Matrix transforms = 14; + + // Physical dimension of the page. + Dimension dimension = 2; + + // [Layout][google.cloud.documentai.v1beta3.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, for example, 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; + + // A signature - a graphical representation of a person's name, + // often used to sign a document. + 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.v1beta3.Document.text]. + TextAnchor text_anchor = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Entity type from a schema, for example, `Address`. + string type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Text value of the entity, for example, `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 (for example, 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.v1beta3.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.v1beta3.Document.text]. + message TextAnchor { + // A text segment in the + // [Document.text][google.cloud.documentai.v1beta3.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.v1beta3.Document.ShardInfo.text_offset] + message TextSegment { + // [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] + // start UTF-8 char index in the + // [Document.text][google.cloud.documentai.v1beta3.Document.text]. + int64 start_index = 1; + + // [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] + // half open end UTF-8 char index in the + // [Document.text][google.cloud.documentai.v1beta3.Document.text]. + int64 end_index = 2; + } + + // The text segments from the + // [Document.text][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.blocks] + // element. + BLOCK = 1; + + // References a + // [Page.paragraphs][google.cloud.documentai.v1beta3.Document.Page.paragraphs] + // element. + PARAGRAPH = 2; + + // References a + // [Page.lines][google.cloud.documentai.v1beta3.Document.Page.lines] + // element. + LINE = 3; + + // References a + // [Page.tokens][google.cloud.documentai.v1beta3.Document.Page.tokens] + // element. + TOKEN = 4; + + // References a + // [Page.visual_elements][google.cloud.documentai.v1beta3.Document.Page.visual_elements] + // element. + VISUAL_ELEMENT = 5; + + // Refrrences a + // [Page.tables][google.cloud.documentai.v1beta3.Document.Page.tables] + // element. + TABLE = 6; + + // References a + // [Page.form_fields][google.cloud.documentai.v1beta3.Document.Page.form_fields] + // element. + FORM_FIELD = 7; + } + + // Required. Index into the + // [Document.pages][google.cloud.documentai.v1beta3.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.v1beta3.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. For example, `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.v1beta3.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 annotation of a block or a chunk. + message Annotations { + // The description of the content with this annotation. + string description = 1; + } + + // 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; + + // Annotation of the text block. + Annotations annotations = 4; + } + + // 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; + + // Annotation of the table block. + Annotations annotations = 4; + } + + // 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; + } + + // Represents an image type block. + message LayoutImageBlock { + // Source of the image. + oneof image_source { + // Optional. Asset id of the inline image. If set, find the image + // content in the blob_assets field. + string blob_asset_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Google Cloud Storage uri of the image. + string gcs_uri = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Data uri of the image. + // It is composed of four parts: a prefix (data:), a MIME type + // indicating the type of data, an optional base64 token if + // non-textual, and the data itself: + // data:[][;base64], + string data_uri = 6 [(google.api.field_behavior) = OPTIONAL]; + } + + // Mime type of the image. An IANA published [media type (MIME type)] + // (https://www.iana.org/assignments/media-types/media-types.xhtml). + string mime_type = 1; + + // Text extracted from the image using OCR or alt text describing the + // image. + string image_text = 2; + + // Annotation of the image block. + Annotations annotations = 3; + } + + 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; + + // Block consisting of image content. + LayoutImageBlock image_block = 7; + } + + // 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; + } + + // The image chunk field in the chunk. + message ImageChunkField { + // Source of the image. + oneof image_source { + // Optional. Asset id of the inline image. If set, find the image + // content in the blob_assets field. + string blob_asset_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Google Cloud Storage uri of the image. + string gcs_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Data uri of the image. + // It is composed of four parts: a prefix (data:), a MIME type + // indicating the type of data, an optional base64 token if + // non-textual, and the data itself: + // data:[][;base64], + string data_uri = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Annotation of the image chunk field. + Annotations annotations = 4; + } + + // The table chunk field in the chunk. + message TableChunkField { + // Annotation of the table chunk field. + Annotations annotations = 1; + } + + // The chunk field in the chunk. A chunk field could be one of the various + // types (for example, image, table) supported. + message ChunkField { + // The type of the chunk field. + oneof field_type { + // The image chunk field in the chunk. + ImageChunkField image_chunk_field = 1; + + // The table chunk field in the chunk. + TableChunkField table_chunk_field = 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; + + // Chunk fields inside this chunk. + repeated ChunkField chunk_fields = 7; + } + + // List of chunks. + repeated Chunk chunks = 1; + } + + // Represents a blob asset. It's used to store the content of the inline blob + // in this document, for example, image bytes, such that it can be referenced + // by other fields in the document via asset ID. + message BlobAsset { + // Optional. The id of the blob asset. + string asset_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The content of the blob asset, for example, image bytes. + bytes content = 2 [(google.api.field_behavior) = OPTIONAL]; + + // The mime type of the blob asset. + // An IANA published [media type (MIME + // type)](https://www.iana.org/assignments/media-types/media-types.xhtml). + string mime_type = 3; + } + + // 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 display 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; + + // Optional. The history of this revision. + Provenance provenance = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // 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.v1beta3.Document.text]. + repeated Style text_styles = 5 [deprecated = true]; + + // Visual page layout for the + // [Document][google.cloud.documentai.v1beta3.Document]. + repeated Page pages = 6; + + // A list of entities detected on + // [Document.text][google.cloud.documentai.v1beta3.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.v1beta3.Document.entities]. + repeated EntityRelation entity_relations = 8; + + // Placeholder. A list of text corrections made to + // [Document.text][google.cloud.documentai.v1beta3.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; + + // Optional. The blob assets in this document. This is used to store the + // content of the inline blobs in this document, for example, image bytes, + // such that it can be referenced by other fields in the document via asset + // id. + repeated BlobAsset blob_assets = 19 [(google.api.field_behavior) = OPTIONAL]; + + // 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; +} + +// The revision reference specifies which revision on the document to read. +message RevisionRef { + // Some predefined revision cases. + enum RevisionCase { + // Unspecified case, fall back to read the `LATEST_HUMAN_REVIEW`. + REVISION_CASE_UNSPECIFIED = 0; + + // The latest revision made by a human. + LATEST_HUMAN_REVIEW = 1; + + // The latest revision based on timestamp. + LATEST_TIMESTAMP = 2; + + // The first (OCR) revision. + BASE_OCR_REVISION = 3; + } + + // Specifies which revision to read. + oneof source { + // Reads the revision by the predefined case. + RevisionCase revision_case = 1; + + // Reads the revision given by the id. + string revision_id = 2; + + // Reads the revision generated by the processor version. + // The format takes the full resource name of processor version. + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + string latest_processor_version = 3; + } +} diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto new file mode 100644 index 00000000000..a80f1a95be5 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto @@ -0,0 +1,188 @@ +// 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.v1beta3; + +import "google/cloud/documentai/v1beta3/document.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; +option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentIoProto"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// A set of inline documents. +message Documents { + // The list of documents. + repeated Document documents = 1; +} + +// 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.v1beta3.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; +} + +// Specifies a set of raw documents. +message RawDocuments { + // Specifies raw document content and mime type. + repeated RawDocument documents = 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.v1beta3.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-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto new file mode 100644 index 00000000000..c3e4c98e4c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto @@ -0,0 +1,1472 @@ +// 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.v1beta3; + +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/v1beta3/document.proto"; +import "google/cloud/documentai/v1beta3/document_io.proto"; +import "google/cloud/documentai/v1beta3/document_schema.proto"; +import "google/cloud/documentai/v1beta3/evaluation.proto"; +import "google/cloud/documentai/v1beta3/operation_metadata.proto"; +import "google/cloud/documentai/v1beta3/processor.proto"; +import "google/cloud/documentai/v1beta3/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.V1Beta3"; +option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiProcessorService"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; +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: "/v1beta3/{name=projects/*/locations/*/processors/*}:process" + body: "*" + additional_bindings { + post: "/v1beta3/{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: "/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess" + body: "*" + additional_bindings { + post: "/v1beta3/{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.v1beta3.DocumentProcessorService.ListProcessorTypes] + // here, because it isn't paginated. + rpc FetchProcessorTypes(FetchProcessorTypesRequest) + returns (FetchProcessorTypesResponse) { + option (google.api.http) = { + get: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{parent=projects/*/locations/*}/processors" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a processor detail. + rpc GetProcessor(GetProcessorRequest) returns (Processor) { + option (google.api.http) = { + get: "/v1beta3/{name=projects/*/locations/*/processors/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Trains a new processor version. + // Operation metadata is returned as + // [TrainProcessorVersionMetadata][google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata]. + rpc TrainProcessorVersion(TrainProcessorVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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.v1beta3.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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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.v1beta3.Processor] that will be used in + // [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] + // and + // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. + rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta3/{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 deprecated = true; + option (google.api.http) = { + post: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations" + }; + option (google.api.method_signature) = "parent"; + } + + // Imports a processor version from source processor version. + rpc ImportProcessorVersion(ImportProcessorVersionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:importProcessorVersion" + body: "*" + }; + option (google.api.method_signature) = "parent"; + option (google.longrunning.operation_info) = { + response_type: "ImportProcessorVersionResponse" + metadata_type: "ImportProcessorVersionMetadata" + }; + } +} + +// 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. The number of tokens to group together when evaluating + // semantic similarity. + // **Note:** This field is not yet used. + bool semantic_chunking_group_size = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The percentile of cosine dissimilarity that must be exceeded + // between a group of tokens and the next. The smaller this number is, the + // more chunks will be generated. + // **Note:** This field is not yet used. + int32 breakpoint_percentile_threshold = 4 + [(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 extract images in layout parser response. + bool enable_image_extraction = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to refine PDF layout using LLM. + bool enable_llm_layout_parsing = 5 [(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]; + + // Optional. Whether to split table. + bool enable_table_split = 8 [(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.v1beta3.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.v1beta3.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.v1beta3.ProcessorVersion]. Will + // return an Invalid Argument error if this field is set when the underlying + // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] + // doesn't support schema override. + DocumentSchema schema_override = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for the +// [ProcessDocument][google.cloud.documentai.v1beta3.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.v1beta3.Processor] or + // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] + // to use for processing. If a + // [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the + // server will use its [default + // version][google.cloud.documentai.v1beta3.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: "*" } + ]; + + // The document payload, the + // [content][google.cloud.documentai.v1beta3.Document.content] and + // [mime_type][google.cloud.documentai.v1beta3.Document.mime_type] fields must + // be set. + Document document = 2 [deprecated = true]; + + // Whether human review should be skipped for this request. Default to + // `false`. + bool skip_human_review = 3 [deprecated = true]; + + // Specifies which fields to include in the + // [ProcessResponse.document][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService.ReviewDocument]. + string human_review_operation = 3; +} + +// Response message for the +// [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] +// method. +message ProcessResponse { + // The document payload, will populate fields based on the processor's + // behavior. + Document document = 1; + + // The name of the operation triggered by the processed document. If the human + // review process isn't triggered, this field is empty. It has the same + // response type and metadata as the long-running operation returned by + // [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument]. + string human_review_operation = 2 [deprecated = true]; + + // The status of human review on the processed document. + HumanReviewStatus human_review_status = 3; +} + +// Request message for +// [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. +message BatchProcessRequest { + // The message for input config in batch process. + message BatchInputConfig { + option deprecated = true; + + // The Cloud Storage location as the source of the document. + string gcs_source = 1; + + // An IANA published [media type (MIME + // type)](https://www.iana.org/assignments/media-types/media-types.xhtml) of + // the input. If the input is a raw document, refer to [supported file + // types](https://cloud.google.com/document-ai/docs/file-types) for the list + // of media types. If the input is a + // [Document][google.cloud.documentai.v1beta3.Document], the type should be + // `application/json`. + string mime_type = 2; + } + + // The output configuration in the + // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments] + // method. + message BatchOutputConfig { + option deprecated = true; + + // The output Cloud Storage directory to put the processed documents. + string gcs_destination = 1; + } + + // Required. The resource name of + // [Processor][google.cloud.documentai.v1beta3.Processor] or + // [ProcessorVersion][google.cloud.documentai.v1beta3.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 config for each single document in the batch process. + repeated BatchInputConfig input_configs = 2 [deprecated = true]; + + // The overall output config for batch process. + BatchOutputConfig output_config = 3 [deprecated = true]; + + // The input documents for the + // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments] + // method. + BatchDocumentsInputConfig input_documents = 5; + + // The output configuration for the + // [BatchProcessDocuments][google.cloud.documentai.v1beta3.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 [deprecated = true]; + + // 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.v1beta3.DocumentProcessorService.BatchProcessDocuments]. +message BatchProcessResponse {} + +// The long-running operation metadata for +// [BatchProcessDocuments][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) + // of the processed document if it was successful, otherwise empty. + string output_gcs_destination = 3; + + // The name of the operation triggered by the processed document. If the + // human review process isn't triggered, this field will be empty. It has + // the same response type and metadata as the long-running operation + // returned by the + // [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument] + // method. + string human_review_operation = 4 [deprecated = true]; + + // 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.v1beta3.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.v1beta3.DocumentProcessorService.FetchProcessorTypes] +// method. +message FetchProcessorTypesResponse { + // The list of processor types. + repeated ProcessorType processor_types = 1; +} + +// Request message for the +// [ListProcessorTypes][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService.DeployProcessorVersion] +// method. +message DeployProcessorVersionResponse {} + +// The long-running operation metadata for the +// [DeployProcessorVersion][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService.UndeployProcessorVersion] +// method. +message UndeployProcessorVersionResponse {} + +// The long-running operation metadata for the +// [UndeployProcessorVersion][google.cloud.documentai.v1beta3.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.v1beta3.DocumentProcessorService.CreateProcessor] +// method. Notice this request is sent to a regionalized backend service. If the +// [ProcessorType][google.cloud.documentai.v1beta3.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.v1beta3.Processor.type] and + // [Processor.display_name][google.cloud.documentai.v1beta3.Processor.display_name] + // to be set. Also, the + // [Processor.kms_key_name][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService.EnableProcessor] +// method. Intentionally empty proto for adding fields in future. +message EnableProcessorResponse {} + +// The long-running operation metadata for the +// [EnableProcessor][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService.DisableProcessor] +// method. Intentionally empty proto for adding fields in future. +message DisableProcessorResponse {} + +// The long-running operation metadata for the +// [DisableProcessor][google.cloud.documentai.v1beta3.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.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion] +// method. +message SetDefaultProcessorVersionRequest { + // Required. The resource name of the + // [Processor][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion] +// method. +message SetDefaultProcessorVersionResponse {} + +// The long-running operation metadata for the +// [SetDefaultProcessorVersion][google.cloud.documentai.v1beta3.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.v1beta3.DocumentProcessorService.TrainProcessorVersion] +// method. +message TrainProcessorVersionRequest { + // The input data used to train a new + // [ProcessorVersion][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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" + } + ]; + + // The document that needs human review. + Document document = 2 [deprecated = true]; + + // 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.v1beta3.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.v1beta3.DocumentProcessorService.ReviewDocument] +// method. +message ReviewDocumentOperationMetadata { + // State of the long-running 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; + } + + // Used only when Operation.done is false. + 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 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.v1beta3.ProcessorVersion] against +// the supplied documents. +message EvaluateProcessorVersionRequest { + // Required. The resource name of the + // [ProcessorVersion][google.cloud.documentai.v1beta3.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.v1beta3.DocumentProcessorService.EvaluateProcessorVersion] +// method. +message EvaluateProcessorVersionMetadata { + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 1; +} + +// Response of the +// [EvaluateProcessorVersion][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.ProcessorVersion]. +message ListEvaluationsRequest { + // Required. The resource name of the + // [ProcessorVersion][google.cloud.documentai.v1beta3.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; +} + +// The request message for the +// [ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion] +// method. +// +// The Document AI [Service +// Agent](https://cloud.google.com/iam/docs/service-agents) of the destination +// project must have [Document AI Editor +// role](https://cloud.google.com/document-ai/docs/access-control/iam-roles) on +// the source project. +// +// The destination project is specified as part of the +// [parent][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.parent] +// field. The source project is specified as part of the +// [source][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.processor_version_source] +// or +// [external_processor_version_source][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.external_processor_version_source] +// field. +message ImportProcessorVersionRequest { + // The external source processor version. + message ExternalProcessorVersionSource { + // Required. The processor version name. Format: + // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + string processor_version = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The Document AI service endpoint. For example, + // 'https://us-documentai.googleapis.com' + string service_endpoint = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + oneof source { + // The source processor version to import from. The source processor version + // and destination processor need to be in the same environment and region. + string processor_version_source = 2 [(google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + }]; + + // The source processor version to import from. It can be from a different + // environment and region than the destination processor. + ExternalProcessorVersionSource external_processor_version_source = 3; + } + + // Required. The destination processor name to create the processor version + // in. 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 response message for the +// [ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion] +// method. +message ImportProcessorVersionResponse { + // The destination processor version name. + string processor_version = 1 [(google.api.resource_reference) = { + type: "documentai.googleapis.com/ProcessorVersion" + }]; +} + +// The long-running operation metadata for the +// [ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion] +// method. +message ImportProcessorVersionMetadata { + // The basic metadata for the long-running operation. + CommonOperationMetadata common_metadata = 1; +} + +// The long-running operation metadata for the +// [UpdateProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.UpdateProcessorVersion] +// method. +message UpdateProcessorVersionMetadata { + // The basic metadata for the long-running operation. + CommonOperationMetadata common_metadata = 1; +} diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto new file mode 100644 index 00000000000..8539769f467 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto @@ -0,0 +1,246 @@ +// 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.v1beta3; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; +option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiDocumentSchema"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// Metadata for document summarization. +message SummaryOptions { + // The Length enum. + enum Length { + // Default. + LENGTH_UNSPECIFIED = 0; + + // A brief summary of one or two sentences. + BRIEF = 1; + + // A paragraph-length summary. + MODERATE = 2; + + // The longest option available. + COMPREHENSIVE = 3; + } + + // The Format enum. + enum Format { + // Default. + FORMAT_UNSPECIFIED = 0; + + // Format the output in paragraphs. + PARAGRAPH = 1; + + // Format the output in bullets. + BULLETS = 2; + } + + // How long the summary should be. + Length length = 1; + + // The format the summary should be in. + Format format = 2; +} + +// Metadata for how this field value is extracted. +message FieldExtractionMetadata { + // Summary options config. + SummaryOptions summary_options = 2; +} + +// Metadata about a property. +message PropertyMetadata { + // Whether the property should be considered as "inactive". + bool inactive = 3; + + // Field extraction metadata on the property. + FieldExtractionMetadata field_extraction_metadata = 9; +} + +// Metadata about an entity type. +message EntityTypeMetadata { + // Whether the entity type should be considered inactive. + bool inactive = 5; +} + +// 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, it's + // expected that a bank statement contains 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; + + // The description of the property. Could be used to provide more + // information about the property for model calls. + string description = 7; + + // 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; + + // Any additional metadata about the property can be added here. + PropertyMetadata property_metadata = 5; + } + + 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 description of the entity type. Could be used to provide more + // information about the entity type for model calls. + string description = 15; + + // 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 the entity type. + EntityTypeMetadata entity_type_metadata = 11; + } + + // 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, this 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 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; + + // Optional. Document level prompt provided by the user. This custom text is + // injected into the AI model's prompt to provide extra, document-wide + // guidance for processing. + string document_prompt = 5 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto new file mode 100644 index 00000000000..91cc4f9c80c --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto @@ -0,0 +1,456 @@ +// 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.v1beta3; + +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/v1beta3/dataset.proto"; +import "google/cloud/documentai/v1beta3/document.proto"; +import "google/cloud/documentai/v1beta3/document_io.proto"; +import "google/cloud/documentai/v1beta3/operation_metadata.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; +option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiDocumentService"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// Service to call Cloud DocumentAI to manage document collection (dataset). +service DocumentService { + option (google.api.default_host) = "documentai.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Updates metadata associated with a dataset. + // Note that this method requires the + // `documentai.googleapis.com/datasets.update` 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 UpdateDataset(UpdateDatasetRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta3/{dataset.name=projects/*/locations/*/processors/*/dataset}" + body: "dataset" + }; + option (google.api.method_signature) = "dataset,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Dataset" + metadata_type: "UpdateDatasetOperationMetadata" + }; + } + + // Import documents into a dataset. + rpc ImportDocuments(ImportDocumentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:importDocuments" + body: "*" + }; + option (google.api.method_signature) = "dataset"; + option (google.longrunning.operation_info) = { + response_type: "ImportDocumentsResponse" + metadata_type: "ImportDocumentsMetadata" + }; + } + + // Returns relevant fields present in the requested document. + rpc GetDocument(GetDocumentRequest) returns (GetDocumentResponse) { + option (google.api.http) = { + get: "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:getDocument" + }; + option (google.api.method_signature) = "dataset"; + } + + // Returns a list of documents present in the dataset. + rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) { + option (google.api.http) = { + post: "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:listDocuments" + body: "*" + }; + option (google.api.method_signature) = "dataset"; + } + + // Deletes a set of documents. + rpc BatchDeleteDocuments(BatchDeleteDocumentsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:batchDeleteDocuments" + body: "*" + }; + option (google.api.method_signature) = "dataset"; + option (google.longrunning.operation_info) = { + response_type: "BatchDeleteDocumentsResponse" + metadata_type: "BatchDeleteDocumentsMetadata" + }; + } + + // Gets the `DatasetSchema` of a `Dataset`. + rpc GetDatasetSchema(GetDatasetSchemaRequest) returns (DatasetSchema) { + option (google.api.http) = { + get: "/v1beta3/{name=projects/*/locations/*/processors/*/dataset/datasetSchema}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a `DatasetSchema`. + rpc UpdateDatasetSchema(UpdateDatasetSchemaRequest) returns (DatasetSchema) { + option (google.api.http) = { + patch: "/v1beta3/{dataset_schema.name=projects/*/locations/*/processors/*/dataset/datasetSchema}" + body: "dataset_schema" + }; + option (google.api.method_signature) = "dataset_schema,update_mask"; + } +} + +// Documents belonging to a dataset will be split into different groups +// referred to as splits: train, test. +enum DatasetSplitType { + // Default value if the enum is not set. + DATASET_SPLIT_TYPE_UNSPECIFIED = 0; + + // Identifies the train documents. + DATASET_SPLIT_TRAIN = 1; + + // Identifies the test documents. + DATASET_SPLIT_TEST = 2; + + // Identifies the unassigned documents. + DATASET_SPLIT_UNASSIGNED = 3; +} + +// Describes the labeling status of a document. +enum DocumentLabelingState { + // Default value if the enum is not set. + DOCUMENT_LABELING_STATE_UNSPECIFIED = 0; + + // Document has been labeled. + DOCUMENT_LABELED = 1; + + // Document has not been labeled. + DOCUMENT_UNLABELED = 2; + + // Document has been auto-labeled. + DOCUMENT_AUTO_LABELED = 3; +} + +message UpdateDatasetRequest { + // Required. The `name` field of the `Dataset` is used to identify the + // resource to be updated. + Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2; +} + +message UpdateDatasetOperationMetadata { + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 1; +} + +message ImportDocumentsRequest { + // Config for importing documents. + // Each batch can have its own dataset split type. + message BatchDocumentsImportConfig { + // The config for auto-split. + message AutoSplitConfig { + // Ratio of training dataset split. + float training_split_ratio = 1; + } + + oneof split_type_config { + // Target dataset split where the documents must be stored. + DatasetSplitType dataset_split = 2; + + // If set, documents will be automatically split into training and test + // split category with the specified ratio. + AutoSplitConfig auto_split_config = 3; + } + + // The common config to specify a set of documents used as input. + BatchDocumentsInputConfig batch_input_config = 1; + + // Optional. If set, determines the type of the documents to be imported in + // this batch. It can be used to auto-label the documents with a single + // entity of the provided type. This field can only be used with a + // classifier or splitter processor. Providing this field is mutually + // exclusive with `entities` and `auto_labeling_config`. + string document_type = 6 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The dataset resource name. + // Format: + // projects/{project}/locations/{location}/processors/{processor}/dataset + string dataset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Dataset" + } + ]; + + // Required. The Cloud Storage uri containing raw documents that must be + // imported. + repeated BatchDocumentsImportConfig batch_documents_import_configs = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response of the import document operation. +message ImportDocumentsResponse {} + +// Metadata of the import document operation. +message ImportDocumentsMetadata { + // The status of each individual document in the import process. + message IndividualImportStatus { + // The source Cloud Storage URI of the document. + string input_gcs_source = 1; + + // The status of the importing of the document. + google.rpc.Status status = 2; + + // The document id of imported document if it was successful, otherwise + // empty. + DocumentId output_document_id = 4; + } + + // The validation status of each import config. Status is set to an error if + // there are no documents to import in the `import_config`, or `OK` if the + // operation will try to proceed with at least one document. + message ImportConfigValidationResult { + // The source Cloud Storage URI specified in the import config. + string input_gcs_source = 1; + + // The validation status of import config. + google.rpc.Status status = 2; + } + + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 1; + + // The list of response details of each document. + repeated IndividualImportStatus individual_import_statuses = 2; + + // Validation statuses of the batch documents import config. + repeated ImportConfigValidationResult import_config_validation_results = 4; + + // Total number of the documents that are qualified for importing. + int32 total_document_count = 3; +} + +message GetDocumentRequest { + // Required. The resource name of the dataset that the document belongs to . + // Format: + // projects/{project}/locations/{location}/processors/{processor}/dataset + string dataset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Dataset" + } + ]; + + // Required. Document identifier. + DocumentId document_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // If set, only fields listed here will be returned. Otherwise, all fields + // will be returned by default. + google.protobuf.FieldMask read_mask = 3; + + // List of pages for which the fields specified in the `read_mask` must + // be served. + DocumentPageRange page_range = 4; +} + +message GetDocumentResponse { + Document document = 1; +} + +message ListDocumentsRequest { + // Required. The resource name of the dataset to be listed. + // Format: + // projects/{project}/locations/{location}/processors/{processor}/dataset + string dataset = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/Dataset" + } + ]; + + // The maximum number of documents to return. The service may return + // fewer than this value. + // If unspecified, at most 20 documents will be returned. + // The maximum value is 100; values above 100 will be coerced to 100. + int32 page_size = 2; + + // A page token, received from a previous `ListDocuments` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListDocuments` + // must match the call that provided the page token. + string page_token = 3; + + // Optional. Query to filter the documents based on + // https://google.aip.dev/160. + // ## Currently support query strings are: + // + // `SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED` + // - `LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED` + // - `DisplayName=\"file_name.pdf\"` + // - `EntityType=abc/def` + // - `TagName=\"auto-labeling-running\"|\"sampled\"` + // + // Note: + // - Only `AND`, `=` and `!=` are supported. + // e.g. `DisplayName=file_name AND EntityType!=abc` IS supported. + // - Wildcard `*` is supported only in `DisplayName` filter + // - No duplicate filter keys are allowed, + // e.g. `EntityType=a AND EntityType=b` is NOT supported. + // - String match is case sensitive (for filter `DisplayName` & `EntityType`). + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls if the request requires a total size of matched + // documents. See + // [ListDocumentsResponse.total_size][google.cloud.documentai.v1beta3.ListDocumentsResponse.total_size]. + // + // Enabling this flag may adversely impact performance. + // + // Defaults to false. + bool return_total_size = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Number of results to skip beginning from the `page_token` if + // provided. https://google.aip.dev/158#skipping-results. It must be a + // non-negative integer. Negative values will be rejected. Note that this is + // not the number of pages to skip. If this value causes the cursor to move + // past the end of results, + // [ListDocumentsResponse.document_metadata][google.cloud.documentai.v1beta3.ListDocumentsResponse.document_metadata] + // and + // [ListDocumentsResponse.next_page_token][google.cloud.documentai.v1beta3.ListDocumentsResponse.next_page_token] + // will be empty. + int32 skip = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +message ListDocumentsResponse { + // Document metadata corresponding to the listed documents. + repeated DocumentMetadata document_metadata = 1; + + // A token, which can be sent as + // [ListDocumentsRequest.page_token][google.cloud.documentai.v1beta3.ListDocumentsRequest.page_token] + // to retrieve the next page. If this field is omitted, there are no + // subsequent pages. + string next_page_token = 2; + + // Total count of documents queried. + int32 total_size = 3; +} + +message BatchDeleteDocumentsRequest { + // Required. The dataset resource name. + // Format: + // projects/{project}/locations/{location}/processors/{processor}/dataset + string dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Dataset documents input. If given `filter`, all documents + // satisfying the filter will be deleted. If given documentIds, a maximum of + // 50 documents can be deleted in a batch. The request will be rejected if + // more than 50 document_ids are provided. + BatchDatasetDocuments dataset_documents = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response of the delete documents operation. +message BatchDeleteDocumentsResponse {} + +message BatchDeleteDocumentsMetadata { + // The status of each individual document in the batch delete process. + message IndividualBatchDeleteStatus { + // The document id of the document. + DocumentId document_id = 1; + + // The status of deleting the document in storage. + google.rpc.Status status = 2; + } + + // The basic metadata of the long-running operation. + CommonOperationMetadata common_metadata = 1; + + // The list of response details of each document. + repeated IndividualBatchDeleteStatus individual_batch_delete_statuses = 2; + + // Total number of documents deleting from dataset. + int32 total_document_count = 3; + + // Total number of documents that failed to be deleted in storage. + int32 error_document_count = 4; +} + +// Request for `GetDatasetSchema`. +message GetDatasetSchemaRequest { + // Required. The dataset schema resource name. + // Format: + // projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "documentai.googleapis.com/DatasetSchema" + } + ]; + + // If set, only returns the visible fields of the schema. + bool visible_fields_only = 2; +} + +// Request for `UpdateDatasetSchema`. +message UpdateDatasetSchemaRequest { + // Required. The name field of the `DatasetSchema` is used to identify the + // resource to be updated. + DatasetSchema dataset_schema = 1 [(google.api.field_behavior) = REQUIRED]; + + // The update mask applies to the resource. + google.protobuf.FieldMask update_mask = 2; +} + +// Range of pages present in a document. +message DocumentPageRange { + // First page number (one-based index) to be returned. + int32 start = 1; + + // Last page number (one-based index) to be returned. + int32 end = 2; +} + +// Metadata about a document. +message DocumentMetadata { + // Document identifier. + DocumentId document_id = 1; + + // Number of pages in the document. + int32 page_count = 2; + + // Type of the dataset split to which the document belongs. + DatasetSplitType dataset_type = 3; + + // Labeling state of the document. + DocumentLabelingState labeling_state = 5; + + // The display name of the document. + string display_name = 6; +} diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/evaluation.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/evaluation.proto new file mode 100644 index 00000000000..6f60de0536e --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/evaluation.proto @@ -0,0 +1,202 @@ +// 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.v1beta3; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; +option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiEvaluation"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// 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; + } + + // A revision of the evaluation. + message EvaluationRevision { + // Output only. The revision ID of the evaluation. + string revision_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Counters for the documents used in the evaluation. + Counters document_counters = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics for all the entities in aggregate. + MultiConfidenceMetrics all_entities_metrics = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics across confidence levels, for different entities. + map entity_metrics = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // 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; + + // Contains all revisions of the evaluation, excluding the latest one. + repeated EvaluationRevision revisions = 9; +} diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.proto new file mode 100644 index 00000000000..3febecc8f97 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.proto @@ -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 +// +// 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.v1beta3; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; +option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "GeometryProto"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// 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-documentai/protos/google/cloud/documentai/v1beta3/operation_metadata.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/operation_metadata.proto new file mode 100644 index 00000000000..1d6fa007ae1 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/operation_metadata.proto @@ -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 +// +// 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.v1beta3; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; +option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "OperationMetadataProto"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// 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-documentai/protos/google/cloud/documentai/v1beta3/processor.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto new file mode 100644 index 00000000000..36d95318cf3 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto @@ -0,0 +1,297 @@ +// 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.v1beta3; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/documentai/v1beta3/document_schema.proto"; +import "google/cloud/documentai/v1beta3/evaluation.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; +option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiProcessor"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// 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 fine tuning is allowed for this base processor version. + bool finetuning_allowed = 1; + + // The minimum number of labeled documents in the training dataset + // required for fine tuning. + 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.v1beta3.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-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto new file mode 100644 index 00000000000..5ca013e43e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto @@ -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 +// +// 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.v1beta3; + +import "google/api/launch_stage.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; +option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; +option java_multiple_files = true; +option java_outer_classname = "DocumentAiProcessorType"; +option java_package = "com.google.cloud.documentai.v1beta3"; +option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; +option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; + +// 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-documentai/protos/protos.d.ts b/owl-bot-staging/google-cloud-documentai/protos/protos.d.ts new file mode 100644 index 00000000000..9f1f13615f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/protos.d.ts @@ -0,0 +1,49693 @@ +// 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 documentai. */ + namespace documentai { + + /** Namespace v1. */ + namespace v1 { + + /** 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 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 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; + } + + /** Properties of a RawDocument. */ + interface IRawDocument { + + /** RawDocument content */ + content?: (Uint8Array|Buffer|string|null); + + /** RawDocument mimeType */ + mimeType?: (string|null); + + /** RawDocument displayName */ + displayName?: (string|null); + } + + /** Represents a RawDocument. */ + class RawDocument implements IRawDocument { + + /** + * Constructs a new RawDocument. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IRawDocument); + + /** RawDocument content. */ + public content: (Uint8Array|Buffer|string); + + /** RawDocument mimeType. */ + public mimeType: string; + + /** RawDocument displayName. */ + public displayName: string; + + /** + * Creates a new RawDocument instance using the specified properties. + * @param [properties] Properties to set + * @returns RawDocument instance + */ + public static create(properties?: google.cloud.documentai.v1.IRawDocument): google.cloud.documentai.v1.RawDocument; + + /** + * Encodes the specified RawDocument message. Does not implicitly {@link google.cloud.documentai.v1.RawDocument.verify|verify} messages. + * @param message RawDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IRawDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RawDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.RawDocument.verify|verify} messages. + * @param message RawDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IRawDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RawDocument message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RawDocument + * @throws {Error} If the payload is not a 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.RawDocument; + + /** + * Decodes a RawDocument message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RawDocument + * @throws {Error} If the payload is 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.RawDocument; + + /** + * Verifies a RawDocument message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RawDocument message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RawDocument + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.RawDocument; + + /** + * Creates a plain object from a RawDocument message. Also converts values to other types if specified. + * @param message RawDocument + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.RawDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RawDocument to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RawDocument + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDocument. */ + interface IGcsDocument { + + /** GcsDocument gcsUri */ + gcsUri?: (string|null); + + /** GcsDocument mimeType */ + mimeType?: (string|null); + } + + /** Represents a GcsDocument. */ + class GcsDocument implements IGcsDocument { + + /** + * Constructs a new GcsDocument. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IGcsDocument); + + /** GcsDocument gcsUri. */ + public gcsUri: string; + + /** GcsDocument mimeType. */ + public mimeType: string; + + /** + * Creates a new GcsDocument instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDocument instance + */ + public static create(properties?: google.cloud.documentai.v1.IGcsDocument): google.cloud.documentai.v1.GcsDocument; + + /** + * Encodes the specified GcsDocument message. Does not implicitly {@link google.cloud.documentai.v1.GcsDocument.verify|verify} messages. + * @param message GcsDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IGcsDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GcsDocument.verify|verify} messages. + * @param message GcsDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IGcsDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDocument message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDocument + * @throws {Error} If the payload is not a 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.GcsDocument; + + /** + * Decodes a GcsDocument message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDocument + * @throws {Error} If the payload is 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.GcsDocument; + + /** + * Verifies a GcsDocument message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDocument message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDocument + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GcsDocument; + + /** + * Creates a plain object from a GcsDocument message. Also converts values to other types if specified. + * @param message GcsDocument + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.GcsDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDocument to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDocument + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDocuments. */ + interface IGcsDocuments { + + /** GcsDocuments documents */ + documents?: (google.cloud.documentai.v1.IGcsDocument[]|null); + } + + /** Represents a GcsDocuments. */ + class GcsDocuments implements IGcsDocuments { + + /** + * Constructs a new GcsDocuments. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IGcsDocuments); + + /** GcsDocuments documents. */ + public documents: google.cloud.documentai.v1.IGcsDocument[]; + + /** + * Creates a new GcsDocuments instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDocuments instance + */ + public static create(properties?: google.cloud.documentai.v1.IGcsDocuments): google.cloud.documentai.v1.GcsDocuments; + + /** + * Encodes the specified GcsDocuments message. Does not implicitly {@link google.cloud.documentai.v1.GcsDocuments.verify|verify} messages. + * @param message GcsDocuments message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IGcsDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GcsDocuments.verify|verify} messages. + * @param message GcsDocuments message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IGcsDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDocuments message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDocuments + * @throws {Error} If the payload is not a 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.GcsDocuments; + + /** + * Decodes a GcsDocuments message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDocuments + * @throws {Error} If the payload is 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.GcsDocuments; + + /** + * Verifies a GcsDocuments message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDocuments message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDocuments + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GcsDocuments; + + /** + * Creates a plain object from a GcsDocuments message. Also converts values to other types if specified. + * @param message GcsDocuments + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.GcsDocuments, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDocuments to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDocuments + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsPrefix. */ + interface IGcsPrefix { + + /** GcsPrefix gcsUriPrefix */ + gcsUriPrefix?: (string|null); + } + + /** Represents a GcsPrefix. */ + class GcsPrefix implements IGcsPrefix { + + /** + * Constructs a new GcsPrefix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IGcsPrefix); + + /** GcsPrefix gcsUriPrefix. */ + public gcsUriPrefix: string; + + /** + * Creates a new GcsPrefix instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsPrefix instance + */ + public static create(properties?: google.cloud.documentai.v1.IGcsPrefix): google.cloud.documentai.v1.GcsPrefix; + + /** + * Encodes the specified GcsPrefix message. Does not implicitly {@link google.cloud.documentai.v1.GcsPrefix.verify|verify} messages. + * @param message GcsPrefix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IGcsPrefix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsPrefix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GcsPrefix.verify|verify} messages. + * @param message GcsPrefix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IGcsPrefix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsPrefix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsPrefix + * @throws {Error} If the payload is not a 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.GcsPrefix; + + /** + * Decodes a GcsPrefix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsPrefix + * @throws {Error} If the payload is 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.GcsPrefix; + + /** + * Verifies a GcsPrefix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsPrefix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsPrefix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GcsPrefix; + + /** + * Creates a plain object from a GcsPrefix message. Also converts values to other types if specified. + * @param message GcsPrefix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.GcsPrefix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsPrefix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsPrefix + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDocumentsInputConfig. */ + interface IBatchDocumentsInputConfig { + + /** BatchDocumentsInputConfig gcsPrefix */ + gcsPrefix?: (google.cloud.documentai.v1.IGcsPrefix|null); + + /** BatchDocumentsInputConfig gcsDocuments */ + gcsDocuments?: (google.cloud.documentai.v1.IGcsDocuments|null); + } + + /** Represents a BatchDocumentsInputConfig. */ + class BatchDocumentsInputConfig implements IBatchDocumentsInputConfig { + + /** + * Constructs a new BatchDocumentsInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IBatchDocumentsInputConfig); + + /** BatchDocumentsInputConfig gcsPrefix. */ + public gcsPrefix?: (google.cloud.documentai.v1.IGcsPrefix|null); + + /** BatchDocumentsInputConfig gcsDocuments. */ + public gcsDocuments?: (google.cloud.documentai.v1.IGcsDocuments|null); + + /** BatchDocumentsInputConfig source. */ + public source?: ("gcsPrefix"|"gcsDocuments"); + + /** + * Creates a new BatchDocumentsInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDocumentsInputConfig instance + */ + public static create(properties?: google.cloud.documentai.v1.IBatchDocumentsInputConfig): google.cloud.documentai.v1.BatchDocumentsInputConfig; + + /** + * Encodes the specified BatchDocumentsInputConfig message. Does not implicitly {@link google.cloud.documentai.v1.BatchDocumentsInputConfig.verify|verify} messages. + * @param message BatchDocumentsInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IBatchDocumentsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDocumentsInputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchDocumentsInputConfig.verify|verify} messages. + * @param message BatchDocumentsInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IBatchDocumentsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDocumentsInputConfig + * @throws {Error} If the payload is not a 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.BatchDocumentsInputConfig; + + /** + * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDocumentsInputConfig + * @throws {Error} If the payload is 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.BatchDocumentsInputConfig; + + /** + * Verifies a BatchDocumentsInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDocumentsInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDocumentsInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.BatchDocumentsInputConfig; + + /** + * Creates a plain object from a BatchDocumentsInputConfig message. Also converts values to other types if specified. + * @param message BatchDocumentsInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.BatchDocumentsInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDocumentsInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDocumentsInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentOutputConfig. */ + interface IDocumentOutputConfig { + + /** DocumentOutputConfig gcsOutputConfig */ + gcsOutputConfig?: (google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig|null); + } + + /** Represents a DocumentOutputConfig. */ + class DocumentOutputConfig implements IDocumentOutputConfig { + + /** + * Constructs a new DocumentOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDocumentOutputConfig); + + /** DocumentOutputConfig gcsOutputConfig. */ + public gcsOutputConfig?: (google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig|null); + + /** DocumentOutputConfig destination. */ + public destination?: "gcsOutputConfig"; + + /** + * Creates a new DocumentOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentOutputConfig instance + */ + public static create(properties?: google.cloud.documentai.v1.IDocumentOutputConfig): google.cloud.documentai.v1.DocumentOutputConfig; + + /** + * Encodes the specified DocumentOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.verify|verify} messages. + * @param message DocumentOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.verify|verify} messages. + * @param message DocumentOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentOutputConfig + * @throws {Error} If the payload is not a 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.DocumentOutputConfig; + + /** + * Decodes a DocumentOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentOutputConfig + * @throws {Error} If the payload is 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.DocumentOutputConfig; + + /** + * Verifies a DocumentOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DocumentOutputConfig; + + /** + * Creates a plain object from a DocumentOutputConfig message. Also converts values to other types if specified. + * @param message DocumentOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DocumentOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DocumentOutputConfig { + + /** Properties of a GcsOutputConfig. */ + interface IGcsOutputConfig { + + /** GcsOutputConfig gcsUri */ + gcsUri?: (string|null); + + /** GcsOutputConfig fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** GcsOutputConfig shardingConfig */ + shardingConfig?: (google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null); + } + + /** Represents a GcsOutputConfig. */ + class GcsOutputConfig implements IGcsOutputConfig { + + /** + * Constructs a new GcsOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig); + + /** GcsOutputConfig gcsUri. */ + public gcsUri: string; + + /** GcsOutputConfig fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** GcsOutputConfig shardingConfig. */ + public shardingConfig?: (google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null); + + /** + * Creates a new GcsOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsOutputConfig instance + */ + public static create(properties?: google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig): google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig; + + /** + * Encodes the specified GcsOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. + * @param message GcsOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. + * @param message GcsOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsOutputConfig + * @throws {Error} If the payload is not a 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.DocumentOutputConfig.GcsOutputConfig; + + /** + * Decodes a GcsOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsOutputConfig + * @throws {Error} If the payload is 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.DocumentOutputConfig.GcsOutputConfig; + + /** + * Verifies a GcsOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig; + + /** + * Creates a plain object from a GcsOutputConfig message. Also converts values to other types if specified. + * @param message GcsOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GcsOutputConfig { + + /** Properties of a ShardingConfig. */ + interface IShardingConfig { + + /** ShardingConfig pagesPerShard */ + pagesPerShard?: (number|null); + + /** ShardingConfig pagesOverlap */ + pagesOverlap?: (number|null); + } + + /** Represents a ShardingConfig. */ + class ShardingConfig implements IShardingConfig { + + /** + * Constructs a new ShardingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig); + + /** ShardingConfig pagesPerShard. */ + public pagesPerShard: number; + + /** ShardingConfig pagesOverlap. */ + public pagesOverlap: number; + + /** + * Creates a new ShardingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardingConfig instance + */ + public static create(properties?: google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig): google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; + + /** + * Encodes the specified ShardingConfig message. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. + * @param message ShardingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShardingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. + * @param message ShardingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShardingConfig + * @throws {Error} If the payload is not a 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.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; + + /** + * Decodes a ShardingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShardingConfig + * @throws {Error} If the payload is 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.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; + + /** + * Verifies a ShardingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShardingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShardingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; + + /** + * Creates a plain object from a ShardingConfig message. Also converts values to other types if specified. + * @param message ShardingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShardingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShardingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an OcrConfig. */ + interface IOcrConfig { + + /** OcrConfig hints */ + hints?: (google.cloud.documentai.v1.OcrConfig.IHints|null); + + /** OcrConfig enableNativePdfParsing */ + enableNativePdfParsing?: (boolean|null); + + /** OcrConfig enableImageQualityScores */ + enableImageQualityScores?: (boolean|null); + + /** OcrConfig advancedOcrOptions */ + advancedOcrOptions?: (string[]|null); + + /** OcrConfig enableSymbol */ + enableSymbol?: (boolean|null); + + /** OcrConfig computeStyleInfo */ + computeStyleInfo?: (boolean|null); + + /** OcrConfig disableCharacterBoxesDetection */ + disableCharacterBoxesDetection?: (boolean|null); + + /** OcrConfig premiumFeatures */ + premiumFeatures?: (google.cloud.documentai.v1.OcrConfig.IPremiumFeatures|null); + } + + /** Represents an OcrConfig. */ + class OcrConfig implements IOcrConfig { + + /** + * Constructs a new OcrConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IOcrConfig); + + /** OcrConfig hints. */ + public hints?: (google.cloud.documentai.v1.OcrConfig.IHints|null); + + /** OcrConfig enableNativePdfParsing. */ + public enableNativePdfParsing: boolean; + + /** OcrConfig enableImageQualityScores. */ + public enableImageQualityScores: boolean; + + /** OcrConfig advancedOcrOptions. */ + public advancedOcrOptions: string[]; + + /** OcrConfig enableSymbol. */ + public enableSymbol: boolean; + + /** OcrConfig computeStyleInfo. */ + public computeStyleInfo: boolean; + + /** OcrConfig disableCharacterBoxesDetection. */ + public disableCharacterBoxesDetection: boolean; + + /** OcrConfig premiumFeatures. */ + public premiumFeatures?: (google.cloud.documentai.v1.OcrConfig.IPremiumFeatures|null); + + /** + * Creates a new OcrConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OcrConfig instance + */ + public static create(properties?: google.cloud.documentai.v1.IOcrConfig): google.cloud.documentai.v1.OcrConfig; + + /** + * Encodes the specified OcrConfig message. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.verify|verify} messages. + * @param message OcrConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IOcrConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OcrConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.verify|verify} messages. + * @param message OcrConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IOcrConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OcrConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OcrConfig + * @throws {Error} If the payload is not a 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.OcrConfig; + + /** + * Decodes an OcrConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OcrConfig + * @throws {Error} If the payload is 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.OcrConfig; + + /** + * Verifies an OcrConfig message. + * @param message Plain 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 OcrConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OcrConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.OcrConfig; + + /** + * Creates a plain object from an OcrConfig message. Also converts values to other types if specified. + * @param message OcrConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.OcrConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OcrConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OcrConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OcrConfig { + + /** Properties of a Hints. */ + interface IHints { + + /** Hints languageHints */ + languageHints?: (string[]|null); + } + + /** Represents a Hints. */ + class Hints implements IHints { + + /** + * Constructs a new Hints. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.OcrConfig.IHints); + + /** Hints languageHints. */ + public languageHints: string[]; + + /** + * Creates a new Hints instance using the specified properties. + * @param [properties] Properties to set + * @returns Hints instance + */ + public static create(properties?: google.cloud.documentai.v1.OcrConfig.IHints): google.cloud.documentai.v1.OcrConfig.Hints; + + /** + * Encodes the specified Hints message. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.Hints.verify|verify} messages. + * @param message Hints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.OcrConfig.IHints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Hints message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.Hints.verify|verify} messages. + * @param message Hints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.OcrConfig.IHints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Hints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Hints + * @throws {Error} If the payload is not a 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.OcrConfig.Hints; + + /** + * Decodes a Hints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Hints + * @throws {Error} If the payload is 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.OcrConfig.Hints; + + /** + * Verifies a Hints message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Hints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Hints + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.OcrConfig.Hints; + + /** + * Creates a plain object from a Hints message. Also converts values to other types if specified. + * @param message Hints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.OcrConfig.Hints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Hints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Hints + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PremiumFeatures. */ + interface IPremiumFeatures { + + /** PremiumFeatures enableSelectionMarkDetection */ + enableSelectionMarkDetection?: (boolean|null); + + /** PremiumFeatures computeStyleInfo */ + computeStyleInfo?: (boolean|null); + + /** PremiumFeatures enableMathOcr */ + enableMathOcr?: (boolean|null); + } + + /** Represents a PremiumFeatures. */ + class PremiumFeatures implements IPremiumFeatures { + + /** + * Constructs a new PremiumFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.OcrConfig.IPremiumFeatures); + + /** PremiumFeatures enableSelectionMarkDetection. */ + public enableSelectionMarkDetection: boolean; + + /** PremiumFeatures computeStyleInfo. */ + public computeStyleInfo: boolean; + + /** PremiumFeatures enableMathOcr. */ + public enableMathOcr: boolean; + + /** + * Creates a new PremiumFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns PremiumFeatures instance + */ + public static create(properties?: google.cloud.documentai.v1.OcrConfig.IPremiumFeatures): google.cloud.documentai.v1.OcrConfig.PremiumFeatures; + + /** + * Encodes the specified PremiumFeatures message. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.PremiumFeatures.verify|verify} messages. + * @param message PremiumFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.OcrConfig.IPremiumFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PremiumFeatures message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.PremiumFeatures.verify|verify} messages. + * @param message PremiumFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.OcrConfig.IPremiumFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PremiumFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PremiumFeatures + * @throws {Error} If the payload is not a 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.OcrConfig.PremiumFeatures; + + /** + * Decodes a PremiumFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PremiumFeatures + * @throws {Error} If the payload is 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.OcrConfig.PremiumFeatures; + + /** + * Verifies a PremiumFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PremiumFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PremiumFeatures + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.OcrConfig.PremiumFeatures; + + /** + * Creates a plain object from a PremiumFeatures message. Also converts values to other types if specified. + * @param message PremiumFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.OcrConfig.PremiumFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PremiumFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PremiumFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a DocumentProcessorService */ + class DocumentProcessorService extends $protobuf.rpc.Service { + + /** + * Constructs a new DocumentProcessorService 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 DocumentProcessorService 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): DocumentProcessorService; + + /** + * Calls ProcessDocument. + * @param request ProcessRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProcessResponse + */ + public processDocument(request: google.cloud.documentai.v1.IProcessRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.ProcessDocumentCallback): void; + + /** + * Calls ProcessDocument. + * @param request ProcessRequest message or plain object + * @returns Promise + */ + public processDocument(request: google.cloud.documentai.v1.IProcessRequest): Promise; + + /** + * Calls BatchProcessDocuments. + * @param request BatchProcessRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchProcessDocuments(request: google.cloud.documentai.v1.IBatchProcessRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocumentsCallback): void; + + /** + * Calls BatchProcessDocuments. + * @param request BatchProcessRequest message or plain object + * @returns Promise + */ + public batchProcessDocuments(request: google.cloud.documentai.v1.IBatchProcessRequest): Promise; + + /** + * Calls FetchProcessorTypes. + * @param request FetchProcessorTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchProcessorTypesResponse + */ + public fetchProcessorTypes(request: google.cloud.documentai.v1.IFetchProcessorTypesRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypesCallback): void; + + /** + * Calls FetchProcessorTypes. + * @param request FetchProcessorTypesRequest message or plain object + * @returns Promise + */ + public fetchProcessorTypes(request: google.cloud.documentai.v1.IFetchProcessorTypesRequest): Promise; + + /** + * Calls ListProcessorTypes. + * @param request ListProcessorTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProcessorTypesResponse + */ + public listProcessorTypes(request: google.cloud.documentai.v1.IListProcessorTypesRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypesCallback): void; + + /** + * Calls ListProcessorTypes. + * @param request ListProcessorTypesRequest message or plain object + * @returns Promise + */ + public listProcessorTypes(request: google.cloud.documentai.v1.IListProcessorTypesRequest): Promise; + + /** + * Calls GetProcessorType. + * @param request GetProcessorTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProcessorType + */ + public getProcessorType(request: google.cloud.documentai.v1.IGetProcessorTypeRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.GetProcessorTypeCallback): void; + + /** + * Calls GetProcessorType. + * @param request GetProcessorTypeRequest message or plain object + * @returns Promise + */ + public getProcessorType(request: google.cloud.documentai.v1.IGetProcessorTypeRequest): Promise; + + /** + * Calls ListProcessors. + * @param request ListProcessorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProcessorsResponse + */ + public listProcessors(request: google.cloud.documentai.v1.IListProcessorsRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.ListProcessorsCallback): void; + + /** + * Calls ListProcessors. + * @param request ListProcessorsRequest message or plain object + * @returns Promise + */ + public listProcessors(request: google.cloud.documentai.v1.IListProcessorsRequest): Promise; + + /** + * Calls GetProcessor. + * @param request GetProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Processor + */ + public getProcessor(request: google.cloud.documentai.v1.IGetProcessorRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.GetProcessorCallback): void; + + /** + * Calls GetProcessor. + * @param request GetProcessorRequest message or plain object + * @returns Promise + */ + public getProcessor(request: google.cloud.documentai.v1.IGetProcessorRequest): Promise; + + /** + * Calls TrainProcessorVersion. + * @param request TrainProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public trainProcessorVersion(request: google.cloud.documentai.v1.ITrainProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersionCallback): void; + + /** + * Calls TrainProcessorVersion. + * @param request TrainProcessorVersionRequest message or plain object + * @returns Promise + */ + public trainProcessorVersion(request: google.cloud.documentai.v1.ITrainProcessorVersionRequest): Promise; + + /** + * Calls GetProcessorVersion. + * @param request GetProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProcessorVersion + */ + public getProcessorVersion(request: google.cloud.documentai.v1.IGetProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersionCallback): void; + + /** + * Calls GetProcessorVersion. + * @param request GetProcessorVersionRequest message or plain object + * @returns Promise + */ + public getProcessorVersion(request: google.cloud.documentai.v1.IGetProcessorVersionRequest): Promise; + + /** + * Calls ListProcessorVersions. + * @param request ListProcessorVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProcessorVersionsResponse + */ + public listProcessorVersions(request: google.cloud.documentai.v1.IListProcessorVersionsRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersionsCallback): void; + + /** + * Calls ListProcessorVersions. + * @param request ListProcessorVersionsRequest message or plain object + * @returns Promise + */ + public listProcessorVersions(request: google.cloud.documentai.v1.IListProcessorVersionsRequest): Promise; + + /** + * Calls DeleteProcessorVersion. + * @param request DeleteProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteProcessorVersion(request: google.cloud.documentai.v1.IDeleteProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersionCallback): void; + + /** + * Calls DeleteProcessorVersion. + * @param request DeleteProcessorVersionRequest message or plain object + * @returns Promise + */ + public deleteProcessorVersion(request: google.cloud.documentai.v1.IDeleteProcessorVersionRequest): Promise; + + /** + * Calls DeployProcessorVersion. + * @param request DeployProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deployProcessorVersion(request: google.cloud.documentai.v1.IDeployProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersionCallback): void; + + /** + * Calls DeployProcessorVersion. + * @param request DeployProcessorVersionRequest message or plain object + * @returns Promise + */ + public deployProcessorVersion(request: google.cloud.documentai.v1.IDeployProcessorVersionRequest): Promise; + + /** + * Calls UndeployProcessorVersion. + * @param request UndeployProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeployProcessorVersion(request: google.cloud.documentai.v1.IUndeployProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersionCallback): void; + + /** + * Calls UndeployProcessorVersion. + * @param request UndeployProcessorVersionRequest message or plain object + * @returns Promise + */ + public undeployProcessorVersion(request: google.cloud.documentai.v1.IUndeployProcessorVersionRequest): Promise; + + /** + * Calls CreateProcessor. + * @param request CreateProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Processor + */ + public createProcessor(request: google.cloud.documentai.v1.ICreateProcessorRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.CreateProcessorCallback): void; + + /** + * Calls CreateProcessor. + * @param request CreateProcessorRequest message or plain object + * @returns Promise + */ + public createProcessor(request: google.cloud.documentai.v1.ICreateProcessorRequest): Promise; + + /** + * Calls DeleteProcessor. + * @param request DeleteProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteProcessor(request: google.cloud.documentai.v1.IDeleteProcessorRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorCallback): void; + + /** + * Calls DeleteProcessor. + * @param request DeleteProcessorRequest message or plain object + * @returns Promise + */ + public deleteProcessor(request: google.cloud.documentai.v1.IDeleteProcessorRequest): Promise; + + /** + * Calls EnableProcessor. + * @param request EnableProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public enableProcessor(request: google.cloud.documentai.v1.IEnableProcessorRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.EnableProcessorCallback): void; + + /** + * Calls EnableProcessor. + * @param request EnableProcessorRequest message or plain object + * @returns Promise + */ + public enableProcessor(request: google.cloud.documentai.v1.IEnableProcessorRequest): Promise; + + /** + * Calls DisableProcessor. + * @param request DisableProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public disableProcessor(request: google.cloud.documentai.v1.IDisableProcessorRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.DisableProcessorCallback): void; + + /** + * Calls DisableProcessor. + * @param request DisableProcessorRequest message or plain object + * @returns Promise + */ + public disableProcessor(request: google.cloud.documentai.v1.IDisableProcessorRequest): Promise; + + /** + * Calls SetDefaultProcessorVersion. + * @param request SetDefaultProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setDefaultProcessorVersion(request: google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersionCallback): void; + + /** + * Calls SetDefaultProcessorVersion. + * @param request SetDefaultProcessorVersionRequest message or plain object + * @returns Promise + */ + public setDefaultProcessorVersion(request: google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest): Promise; + + /** + * Calls ReviewDocument. + * @param request ReviewDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public reviewDocument(request: google.cloud.documentai.v1.IReviewDocumentRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.ReviewDocumentCallback): void; + + /** + * Calls ReviewDocument. + * @param request ReviewDocumentRequest message or plain object + * @returns Promise + */ + public reviewDocument(request: google.cloud.documentai.v1.IReviewDocumentRequest): Promise; + + /** + * Calls EvaluateProcessorVersion. + * @param request EvaluateProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public evaluateProcessorVersion(request: google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersionCallback): void; + + /** + * Calls EvaluateProcessorVersion. + * @param request EvaluateProcessorVersionRequest message or plain object + * @returns Promise + */ + public evaluateProcessorVersion(request: google.cloud.documentai.v1.IEvaluateProcessorVersionRequest): Promise; + + /** + * Calls GetEvaluation. + * @param request GetEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Evaluation + */ + public getEvaluation(request: google.cloud.documentai.v1.IGetEvaluationRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.GetEvaluationCallback): void; + + /** + * Calls GetEvaluation. + * @param request GetEvaluationRequest message or plain object + * @returns Promise + */ + public getEvaluation(request: google.cloud.documentai.v1.IGetEvaluationRequest): Promise; + + /** + * Calls ListEvaluations. + * @param request ListEvaluationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationsResponse + */ + public listEvaluations(request: google.cloud.documentai.v1.IListEvaluationsRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.ListEvaluationsCallback): void; + + /** + * Calls ListEvaluations. + * @param request ListEvaluationsRequest message or plain object + * @returns Promise + */ + public listEvaluations(request: google.cloud.documentai.v1.IListEvaluationsRequest): Promise; + } + + namespace DocumentProcessorService { + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|processDocument}. + * @param error Error, if any + * @param [response] ProcessResponse + */ + type ProcessDocumentCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ProcessResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|batchProcessDocuments}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchProcessDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|fetchProcessorTypes}. + * @param error Error, if any + * @param [response] FetchProcessorTypesResponse + */ + type FetchProcessorTypesCallback = (error: (Error|null), response?: google.cloud.documentai.v1.FetchProcessorTypesResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listProcessorTypes}. + * @param error Error, if any + * @param [response] ListProcessorTypesResponse + */ + type ListProcessorTypesCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ListProcessorTypesResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getProcessorType}. + * @param error Error, if any + * @param [response] ProcessorType + */ + type GetProcessorTypeCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ProcessorType) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listProcessors}. + * @param error Error, if any + * @param [response] ListProcessorsResponse + */ + type ListProcessorsCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ListProcessorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getProcessor}. + * @param error Error, if any + * @param [response] Processor + */ + type GetProcessorCallback = (error: (Error|null), response?: google.cloud.documentai.v1.Processor) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|trainProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type TrainProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getProcessorVersion}. + * @param error Error, if any + * @param [response] ProcessorVersion + */ + type GetProcessorVersionCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ProcessorVersion) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listProcessorVersions}. + * @param error Error, if any + * @param [response] ListProcessorVersionsResponse + */ + type ListProcessorVersionsCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ListProcessorVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|deleteProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|deployProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type DeployProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|undeployProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeployProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|createProcessor}. + * @param error Error, if any + * @param [response] Processor + */ + type CreateProcessorCallback = (error: (Error|null), response?: google.cloud.documentai.v1.Processor) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|deleteProcessor}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|enableProcessor}. + * @param error Error, if any + * @param [response] Operation + */ + type EnableProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|disableProcessor}. + * @param error Error, if any + * @param [response] Operation + */ + type DisableProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|setDefaultProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type SetDefaultProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|reviewDocument}. + * @param error Error, if any + * @param [response] Operation + */ + type ReviewDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|evaluateProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type EvaluateProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getEvaluation}. + * @param error Error, if any + * @param [response] Evaluation + */ + type GetEvaluationCallback = (error: (Error|null), response?: google.cloud.documentai.v1.Evaluation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listEvaluations}. + * @param error Error, if any + * @param [response] ListEvaluationsResponse + */ + type ListEvaluationsCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ListEvaluationsResponse) => void; + } + + /** Properties of a ProcessOptions. */ + interface IProcessOptions { + + /** ProcessOptions individualPageSelector */ + individualPageSelector?: (google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector|null); + + /** ProcessOptions fromStart */ + fromStart?: (number|null); + + /** ProcessOptions fromEnd */ + fromEnd?: (number|null); + + /** ProcessOptions ocrConfig */ + ocrConfig?: (google.cloud.documentai.v1.IOcrConfig|null); + + /** ProcessOptions layoutConfig */ + layoutConfig?: (google.cloud.documentai.v1.ProcessOptions.ILayoutConfig|null); + + /** ProcessOptions schemaOverride */ + schemaOverride?: (google.cloud.documentai.v1.IDocumentSchema|null); + } + + /** Represents a ProcessOptions. */ + class ProcessOptions implements IProcessOptions { + + /** + * Constructs a new ProcessOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IProcessOptions); + + /** ProcessOptions individualPageSelector. */ + public individualPageSelector?: (google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector|null); + + /** ProcessOptions fromStart. */ + public fromStart?: (number|null); + + /** ProcessOptions fromEnd. */ + public fromEnd?: (number|null); + + /** ProcessOptions ocrConfig. */ + public ocrConfig?: (google.cloud.documentai.v1.IOcrConfig|null); + + /** ProcessOptions layoutConfig. */ + public layoutConfig?: (google.cloud.documentai.v1.ProcessOptions.ILayoutConfig|null); + + /** ProcessOptions schemaOverride. */ + public schemaOverride?: (google.cloud.documentai.v1.IDocumentSchema|null); + + /** ProcessOptions pageRange. */ + public pageRange?: ("individualPageSelector"|"fromStart"|"fromEnd"); + + /** + * Creates a new ProcessOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessOptions instance + */ + public static create(properties?: google.cloud.documentai.v1.IProcessOptions): google.cloud.documentai.v1.ProcessOptions; + + /** + * Encodes the specified ProcessOptions message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.verify|verify} messages. + * @param message ProcessOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IProcessOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.verify|verify} messages. + * @param message ProcessOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IProcessOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessOptions + * @throws {Error} If the payload is not a 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.ProcessOptions; + + /** + * Decodes a ProcessOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessOptions + * @throws {Error} If the payload is 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.ProcessOptions; + + /** + * Verifies a ProcessOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessOptions; + + /** + * Creates a plain object from a ProcessOptions message. Also converts values to other types if specified. + * @param message ProcessOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ProcessOptions { + + /** Properties of a LayoutConfig. */ + interface ILayoutConfig { + + /** LayoutConfig chunkingConfig */ + chunkingConfig?: (google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig|null); + + /** LayoutConfig returnImages */ + returnImages?: (boolean|null); + + /** LayoutConfig returnBoundingBoxes */ + returnBoundingBoxes?: (boolean|null); + } + + /** Represents a LayoutConfig. */ + class LayoutConfig implements ILayoutConfig { + + /** + * Constructs a new LayoutConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ProcessOptions.ILayoutConfig); + + /** LayoutConfig chunkingConfig. */ + public chunkingConfig?: (google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig|null); + + /** LayoutConfig returnImages. */ + public returnImages: boolean; + + /** LayoutConfig returnBoundingBoxes. */ + public returnBoundingBoxes: boolean; + + /** + * Creates a new LayoutConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutConfig instance + */ + public static create(properties?: google.cloud.documentai.v1.ProcessOptions.ILayoutConfig): google.cloud.documentai.v1.ProcessOptions.LayoutConfig; + + /** + * Encodes the specified LayoutConfig message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.verify|verify} messages. + * @param message LayoutConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ProcessOptions.ILayoutConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.verify|verify} messages. + * @param message LayoutConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ProcessOptions.ILayoutConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LayoutConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LayoutConfig + * @throws {Error} If the payload is not a 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.ProcessOptions.LayoutConfig; + + /** + * Decodes a LayoutConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LayoutConfig + * @throws {Error} If the payload is 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.ProcessOptions.LayoutConfig; + + /** + * Verifies a LayoutConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LayoutConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LayoutConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessOptions.LayoutConfig; + + /** + * Creates a plain object from a LayoutConfig message. Also converts values to other types if specified. + * @param message LayoutConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessOptions.LayoutConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LayoutConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LayoutConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LayoutConfig { + + /** Properties of a ChunkingConfig. */ + interface IChunkingConfig { + + /** ChunkingConfig chunkSize */ + chunkSize?: (number|null); + + /** ChunkingConfig includeAncestorHeadings */ + includeAncestorHeadings?: (boolean|null); + } + + /** Represents a ChunkingConfig. */ + class ChunkingConfig implements IChunkingConfig { + + /** + * Constructs a new ChunkingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig); + + /** ChunkingConfig chunkSize. */ + public chunkSize: number; + + /** ChunkingConfig includeAncestorHeadings. */ + public includeAncestorHeadings: boolean; + + /** + * Creates a new ChunkingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkingConfig instance + */ + public static create(properties?: google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig): google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig; + + /** + * Encodes the specified ChunkingConfig message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. + * @param message ChunkingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. + * @param message ChunkingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkingConfig + * @throws {Error} If the payload is not a 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.ProcessOptions.LayoutConfig.ChunkingConfig; + + /** + * Decodes a ChunkingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkingConfig + * @throws {Error} If the payload is 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.ProcessOptions.LayoutConfig.ChunkingConfig; + + /** + * Verifies a ChunkingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChunkingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig; + + /** + * Creates a plain object from a ChunkingConfig message. Also converts values to other types if specified. + * @param message ChunkingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an IndividualPageSelector. */ + interface IIndividualPageSelector { + + /** IndividualPageSelector pages */ + pages?: (number[]|null); + } + + /** Represents an IndividualPageSelector. */ + class IndividualPageSelector implements IIndividualPageSelector { + + /** + * Constructs a new IndividualPageSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector); + + /** IndividualPageSelector pages. */ + public pages: number[]; + + /** + * Creates a new IndividualPageSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns IndividualPageSelector instance + */ + public static create(properties?: google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector): google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector; + + /** + * Encodes the specified IndividualPageSelector message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.verify|verify} messages. + * @param message IndividualPageSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndividualPageSelector message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.verify|verify} messages. + * @param message IndividualPageSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndividualPageSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndividualPageSelector + * @throws {Error} If the payload is not a 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.ProcessOptions.IndividualPageSelector; + + /** + * Decodes an IndividualPageSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndividualPageSelector + * @throws {Error} If the payload is 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.ProcessOptions.IndividualPageSelector; + + /** + * Verifies an IndividualPageSelector message. + * @param message Plain 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 IndividualPageSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndividualPageSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector; + + /** + * Creates a plain object from an IndividualPageSelector message. Also converts values to other types if specified. + * @param message IndividualPageSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndividualPageSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndividualPageSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ProcessRequest. */ + interface IProcessRequest { + + /** ProcessRequest inlineDocument */ + inlineDocument?: (google.cloud.documentai.v1.IDocument|null); + + /** ProcessRequest rawDocument */ + rawDocument?: (google.cloud.documentai.v1.IRawDocument|null); + + /** ProcessRequest gcsDocument */ + gcsDocument?: (google.cloud.documentai.v1.IGcsDocument|null); + + /** ProcessRequest name */ + name?: (string|null); + + /** ProcessRequest skipHumanReview */ + skipHumanReview?: (boolean|null); + + /** ProcessRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ProcessRequest processOptions */ + processOptions?: (google.cloud.documentai.v1.IProcessOptions|null); + + /** ProcessRequest labels */ + labels?: ({ [k: string]: string }|null); + + /** ProcessRequest imagelessMode */ + imagelessMode?: (boolean|null); + } + + /** Represents a ProcessRequest. */ + class ProcessRequest implements IProcessRequest { + + /** + * Constructs a new ProcessRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IProcessRequest); + + /** ProcessRequest inlineDocument. */ + public inlineDocument?: (google.cloud.documentai.v1.IDocument|null); + + /** ProcessRequest rawDocument. */ + public rawDocument?: (google.cloud.documentai.v1.IRawDocument|null); + + /** ProcessRequest gcsDocument. */ + public gcsDocument?: (google.cloud.documentai.v1.IGcsDocument|null); + + /** ProcessRequest name. */ + public name: string; + + /** ProcessRequest skipHumanReview. */ + public skipHumanReview: boolean; + + /** ProcessRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ProcessRequest processOptions. */ + public processOptions?: (google.cloud.documentai.v1.IProcessOptions|null); + + /** ProcessRequest labels. */ + public labels: { [k: string]: string }; + + /** ProcessRequest imagelessMode. */ + public imagelessMode: boolean; + + /** ProcessRequest source. */ + public source?: ("inlineDocument"|"rawDocument"|"gcsDocument"); + + /** + * Creates a new ProcessRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IProcessRequest): google.cloud.documentai.v1.ProcessRequest; + + /** + * Encodes the specified ProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1.ProcessRequest.verify|verify} messages. + * @param message ProcessRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessRequest.verify|verify} messages. + * @param message ProcessRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessRequest + * @throws {Error} If the payload is not a 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.ProcessRequest; + + /** + * Decodes a ProcessRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessRequest + * @throws {Error} If the payload is 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.ProcessRequest; + + /** + * Verifies a ProcessRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessRequest; + + /** + * Creates a plain object from a ProcessRequest message. Also converts values to other types if specified. + * @param message ProcessRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HumanReviewStatus. */ + interface IHumanReviewStatus { + + /** HumanReviewStatus state */ + state?: (google.cloud.documentai.v1.HumanReviewStatus.State|keyof typeof google.cloud.documentai.v1.HumanReviewStatus.State|null); + + /** HumanReviewStatus stateMessage */ + stateMessage?: (string|null); + + /** HumanReviewStatus humanReviewOperation */ + humanReviewOperation?: (string|null); + } + + /** Represents a HumanReviewStatus. */ + class HumanReviewStatus implements IHumanReviewStatus { + + /** + * Constructs a new HumanReviewStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IHumanReviewStatus); + + /** HumanReviewStatus state. */ + public state: (google.cloud.documentai.v1.HumanReviewStatus.State|keyof typeof google.cloud.documentai.v1.HumanReviewStatus.State); + + /** HumanReviewStatus stateMessage. */ + public stateMessage: string; + + /** HumanReviewStatus humanReviewOperation. */ + public humanReviewOperation: string; + + /** + * Creates a new HumanReviewStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns HumanReviewStatus instance + */ + public static create(properties?: google.cloud.documentai.v1.IHumanReviewStatus): google.cloud.documentai.v1.HumanReviewStatus; + + /** + * Encodes the specified HumanReviewStatus message. Does not implicitly {@link google.cloud.documentai.v1.HumanReviewStatus.verify|verify} messages. + * @param message HumanReviewStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IHumanReviewStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HumanReviewStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.HumanReviewStatus.verify|verify} messages. + * @param message HumanReviewStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IHumanReviewStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HumanReviewStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HumanReviewStatus + * @throws {Error} If the payload is not a 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.HumanReviewStatus; + + /** + * Decodes a HumanReviewStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HumanReviewStatus + * @throws {Error} If the payload is 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.HumanReviewStatus; + + /** + * Verifies a HumanReviewStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HumanReviewStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HumanReviewStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.HumanReviewStatus; + + /** + * Creates a plain object from a HumanReviewStatus message. Also converts values to other types if specified. + * @param message HumanReviewStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.HumanReviewStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HumanReviewStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HumanReviewStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace HumanReviewStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + SKIPPED = 1, + VALIDATION_PASSED = 2, + IN_PROGRESS = 3, + ERROR = 4 + } + } + + /** Properties of a ProcessResponse. */ + interface IProcessResponse { + + /** ProcessResponse document */ + document?: (google.cloud.documentai.v1.IDocument|null); + + /** ProcessResponse humanReviewStatus */ + humanReviewStatus?: (google.cloud.documentai.v1.IHumanReviewStatus|null); + } + + /** Represents a ProcessResponse. */ + class ProcessResponse implements IProcessResponse { + + /** + * Constructs a new ProcessResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IProcessResponse); + + /** ProcessResponse document. */ + public document?: (google.cloud.documentai.v1.IDocument|null); + + /** ProcessResponse humanReviewStatus. */ + public humanReviewStatus?: (google.cloud.documentai.v1.IHumanReviewStatus|null); + + /** + * Creates a new ProcessResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IProcessResponse): google.cloud.documentai.v1.ProcessResponse; + + /** + * Encodes the specified ProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1.ProcessResponse.verify|verify} messages. + * @param message ProcessResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessResponse.verify|verify} messages. + * @param message ProcessResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessResponse + * @throws {Error} If the payload is not a 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.ProcessResponse; + + /** + * Decodes a ProcessResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessResponse + * @throws {Error} If the payload is 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.ProcessResponse; + + /** + * Verifies a ProcessResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessResponse; + + /** + * Creates a plain object from a ProcessResponse message. Also converts values to other types if specified. + * @param message ProcessResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchProcessRequest. */ + interface IBatchProcessRequest { + + /** BatchProcessRequest name */ + name?: (string|null); + + /** BatchProcessRequest inputDocuments */ + inputDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); + + /** BatchProcessRequest documentOutputConfig */ + documentOutputConfig?: (google.cloud.documentai.v1.IDocumentOutputConfig|null); + + /** BatchProcessRequest skipHumanReview */ + skipHumanReview?: (boolean|null); + + /** BatchProcessRequest processOptions */ + processOptions?: (google.cloud.documentai.v1.IProcessOptions|null); + + /** BatchProcessRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a BatchProcessRequest. */ + class BatchProcessRequest implements IBatchProcessRequest { + + /** + * Constructs a new BatchProcessRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IBatchProcessRequest); + + /** BatchProcessRequest name. */ + public name: string; + + /** BatchProcessRequest inputDocuments. */ + public inputDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); + + /** BatchProcessRequest documentOutputConfig. */ + public documentOutputConfig?: (google.cloud.documentai.v1.IDocumentOutputConfig|null); + + /** BatchProcessRequest skipHumanReview. */ + public skipHumanReview: boolean; + + /** BatchProcessRequest processOptions. */ + public processOptions?: (google.cloud.documentai.v1.IProcessOptions|null); + + /** BatchProcessRequest labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new BatchProcessRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchProcessRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IBatchProcessRequest): google.cloud.documentai.v1.BatchProcessRequest; + + /** + * Encodes the specified BatchProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessRequest.verify|verify} messages. + * @param message BatchProcessRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IBatchProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessRequest.verify|verify} messages. + * @param message BatchProcessRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IBatchProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchProcessRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchProcessRequest + * @throws {Error} If the payload is not a 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.BatchProcessRequest; + + /** + * Decodes a BatchProcessRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchProcessRequest + * @throws {Error} If the payload is 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.BatchProcessRequest; + + /** + * Verifies a BatchProcessRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchProcessRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchProcessRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.BatchProcessRequest; + + /** + * Creates a plain object from a BatchProcessRequest message. Also converts values to other types if specified. + * @param message BatchProcessRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.BatchProcessRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchProcessRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchProcessRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchProcessResponse. */ + interface IBatchProcessResponse { + } + + /** Represents a BatchProcessResponse. */ + class BatchProcessResponse implements IBatchProcessResponse { + + /** + * Constructs a new BatchProcessResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IBatchProcessResponse); + + /** + * Creates a new BatchProcessResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchProcessResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IBatchProcessResponse): google.cloud.documentai.v1.BatchProcessResponse; + + /** + * Encodes the specified BatchProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessResponse.verify|verify} messages. + * @param message BatchProcessResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IBatchProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessResponse.verify|verify} messages. + * @param message BatchProcessResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IBatchProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchProcessResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchProcessResponse + * @throws {Error} If the payload is not a 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.BatchProcessResponse; + + /** + * Decodes a BatchProcessResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchProcessResponse + * @throws {Error} If the payload is 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.BatchProcessResponse; + + /** + * Verifies a BatchProcessResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchProcessResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchProcessResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.BatchProcessResponse; + + /** + * Creates a plain object from a BatchProcessResponse message. Also converts values to other types if specified. + * @param message BatchProcessResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.BatchProcessResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchProcessResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchProcessResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchProcessMetadata. */ + interface IBatchProcessMetadata { + + /** BatchProcessMetadata state */ + state?: (google.cloud.documentai.v1.BatchProcessMetadata.State|keyof typeof google.cloud.documentai.v1.BatchProcessMetadata.State|null); + + /** BatchProcessMetadata stateMessage */ + stateMessage?: (string|null); + + /** BatchProcessMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BatchProcessMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BatchProcessMetadata individualProcessStatuses */ + individualProcessStatuses?: (google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus[]|null); + } + + /** Represents a BatchProcessMetadata. */ + class BatchProcessMetadata implements IBatchProcessMetadata { + + /** + * Constructs a new BatchProcessMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IBatchProcessMetadata); + + /** BatchProcessMetadata state. */ + public state: (google.cloud.documentai.v1.BatchProcessMetadata.State|keyof typeof google.cloud.documentai.v1.BatchProcessMetadata.State); + + /** BatchProcessMetadata stateMessage. */ + public stateMessage: string; + + /** BatchProcessMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BatchProcessMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BatchProcessMetadata individualProcessStatuses. */ + public individualProcessStatuses: google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus[]; + + /** + * Creates a new BatchProcessMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchProcessMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1.IBatchProcessMetadata): google.cloud.documentai.v1.BatchProcessMetadata; + + /** + * Encodes the specified BatchProcessMetadata message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.verify|verify} messages. + * @param message BatchProcessMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IBatchProcessMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchProcessMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.verify|verify} messages. + * @param message BatchProcessMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IBatchProcessMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchProcessMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchProcessMetadata + * @throws {Error} If the payload is not a 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.BatchProcessMetadata; + + /** + * Decodes a BatchProcessMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchProcessMetadata + * @throws {Error} If the payload is 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.BatchProcessMetadata; + + /** + * Verifies a BatchProcessMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchProcessMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchProcessMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.BatchProcessMetadata; + + /** + * Creates a plain object from a BatchProcessMetadata message. Also converts values to other types if specified. + * @param message BatchProcessMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.BatchProcessMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchProcessMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchProcessMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchProcessMetadata { + + /** Properties of an IndividualProcessStatus. */ + interface IIndividualProcessStatus { + + /** IndividualProcessStatus inputGcsSource */ + inputGcsSource?: (string|null); + + /** IndividualProcessStatus status */ + status?: (google.rpc.IStatus|null); + + /** IndividualProcessStatus outputGcsDestination */ + outputGcsDestination?: (string|null); + + /** IndividualProcessStatus humanReviewStatus */ + humanReviewStatus?: (google.cloud.documentai.v1.IHumanReviewStatus|null); + } + + /** Represents an IndividualProcessStatus. */ + class IndividualProcessStatus implements IIndividualProcessStatus { + + /** + * Constructs a new IndividualProcessStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus); + + /** IndividualProcessStatus inputGcsSource. */ + public inputGcsSource: string; + + /** IndividualProcessStatus status. */ + public status?: (google.rpc.IStatus|null); + + /** IndividualProcessStatus outputGcsDestination. */ + public outputGcsDestination: string; + + /** IndividualProcessStatus humanReviewStatus. */ + public humanReviewStatus?: (google.cloud.documentai.v1.IHumanReviewStatus|null); + + /** + * Creates a new IndividualProcessStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns IndividualProcessStatus instance + */ + public static create(properties?: google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus): google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus; + + /** + * Encodes the specified IndividualProcessStatus message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. + * @param message IndividualProcessStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndividualProcessStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. + * @param message IndividualProcessStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndividualProcessStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndividualProcessStatus + * @throws {Error} If the payload is not a 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.BatchProcessMetadata.IndividualProcessStatus; + + /** + * Decodes an IndividualProcessStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndividualProcessStatus + * @throws {Error} If the payload is 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.BatchProcessMetadata.IndividualProcessStatus; + + /** + * Verifies an IndividualProcessStatus message. + * @param message Plain 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 IndividualProcessStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndividualProcessStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus; + + /** + * Creates a plain object from an IndividualProcessStatus message. Also converts values to other types if specified. + * @param message IndividualProcessStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndividualProcessStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndividualProcessStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + WAITING = 1, + RUNNING = 2, + SUCCEEDED = 3, + CANCELLING = 4, + CANCELLED = 5, + FAILED = 6 + } + } + + /** Properties of a FetchProcessorTypesRequest. */ + interface IFetchProcessorTypesRequest { + + /** FetchProcessorTypesRequest parent */ + parent?: (string|null); + } + + /** Represents a FetchProcessorTypesRequest. */ + class FetchProcessorTypesRequest implements IFetchProcessorTypesRequest { + + /** + * Constructs a new FetchProcessorTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IFetchProcessorTypesRequest); + + /** FetchProcessorTypesRequest parent. */ + public parent: string; + + /** + * Creates a new FetchProcessorTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchProcessorTypesRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IFetchProcessorTypesRequest): google.cloud.documentai.v1.FetchProcessorTypesRequest; + + /** + * Encodes the specified FetchProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesRequest.verify|verify} messages. + * @param message FetchProcessorTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IFetchProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesRequest.verify|verify} messages. + * @param message FetchProcessorTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IFetchProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchProcessorTypesRequest + * @throws {Error} If the payload is not a 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.FetchProcessorTypesRequest; + + /** + * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchProcessorTypesRequest + * @throws {Error} If the payload is 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.FetchProcessorTypesRequest; + + /** + * Verifies a FetchProcessorTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchProcessorTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.FetchProcessorTypesRequest; + + /** + * Creates a plain object from a FetchProcessorTypesRequest message. Also converts values to other types if specified. + * @param message FetchProcessorTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.FetchProcessorTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchProcessorTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchProcessorTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchProcessorTypesResponse. */ + interface IFetchProcessorTypesResponse { + + /** FetchProcessorTypesResponse processorTypes */ + processorTypes?: (google.cloud.documentai.v1.IProcessorType[]|null); + } + + /** Represents a FetchProcessorTypesResponse. */ + class FetchProcessorTypesResponse implements IFetchProcessorTypesResponse { + + /** + * Constructs a new FetchProcessorTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IFetchProcessorTypesResponse); + + /** FetchProcessorTypesResponse processorTypes. */ + public processorTypes: google.cloud.documentai.v1.IProcessorType[]; + + /** + * Creates a new FetchProcessorTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchProcessorTypesResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IFetchProcessorTypesResponse): google.cloud.documentai.v1.FetchProcessorTypesResponse; + + /** + * Encodes the specified FetchProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesResponse.verify|verify} messages. + * @param message FetchProcessorTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IFetchProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesResponse.verify|verify} messages. + * @param message FetchProcessorTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IFetchProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchProcessorTypesResponse + * @throws {Error} If the payload is not a 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.FetchProcessorTypesResponse; + + /** + * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchProcessorTypesResponse + * @throws {Error} If the payload is 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.FetchProcessorTypesResponse; + + /** + * Verifies a FetchProcessorTypesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchProcessorTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.FetchProcessorTypesResponse; + + /** + * Creates a plain object from a FetchProcessorTypesResponse message. Also converts values to other types if specified. + * @param message FetchProcessorTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.FetchProcessorTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchProcessorTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchProcessorTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorTypesRequest. */ + interface IListProcessorTypesRequest { + + /** ListProcessorTypesRequest parent */ + parent?: (string|null); + + /** ListProcessorTypesRequest pageSize */ + pageSize?: (number|null); + + /** ListProcessorTypesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProcessorTypesRequest. */ + class ListProcessorTypesRequest implements IListProcessorTypesRequest { + + /** + * Constructs a new ListProcessorTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IListProcessorTypesRequest); + + /** ListProcessorTypesRequest parent. */ + public parent: string; + + /** ListProcessorTypesRequest pageSize. */ + public pageSize: number; + + /** ListProcessorTypesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProcessorTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorTypesRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IListProcessorTypesRequest): google.cloud.documentai.v1.ListProcessorTypesRequest; + + /** + * Encodes the specified ListProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesRequest.verify|verify} messages. + * @param message ListProcessorTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IListProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesRequest.verify|verify} messages. + * @param message ListProcessorTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IListProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorTypesRequest + * @throws {Error} If the payload is not a 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.ListProcessorTypesRequest; + + /** + * Decodes a ListProcessorTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorTypesRequest + * @throws {Error} If the payload is 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.ListProcessorTypesRequest; + + /** + * Verifies a ListProcessorTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListProcessorTypesRequest; + + /** + * Creates a plain object from a ListProcessorTypesRequest message. Also converts values to other types if specified. + * @param message ListProcessorTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ListProcessorTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorTypesResponse. */ + interface IListProcessorTypesResponse { + + /** ListProcessorTypesResponse processorTypes */ + processorTypes?: (google.cloud.documentai.v1.IProcessorType[]|null); + + /** ListProcessorTypesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProcessorTypesResponse. */ + class ListProcessorTypesResponse implements IListProcessorTypesResponse { + + /** + * Constructs a new ListProcessorTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IListProcessorTypesResponse); + + /** ListProcessorTypesResponse processorTypes. */ + public processorTypes: google.cloud.documentai.v1.IProcessorType[]; + + /** ListProcessorTypesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProcessorTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorTypesResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IListProcessorTypesResponse): google.cloud.documentai.v1.ListProcessorTypesResponse; + + /** + * Encodes the specified ListProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesResponse.verify|verify} messages. + * @param message ListProcessorTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IListProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesResponse.verify|verify} messages. + * @param message ListProcessorTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IListProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorTypesResponse + * @throws {Error} If the payload is not a 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.ListProcessorTypesResponse; + + /** + * Decodes a ListProcessorTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorTypesResponse + * @throws {Error} If the payload is 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.ListProcessorTypesResponse; + + /** + * Verifies a ListProcessorTypesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListProcessorTypesResponse; + + /** + * Creates a plain object from a ListProcessorTypesResponse message. Also converts values to other types if specified. + * @param message ListProcessorTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ListProcessorTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorsRequest. */ + interface IListProcessorsRequest { + + /** ListProcessorsRequest parent */ + parent?: (string|null); + + /** ListProcessorsRequest pageSize */ + pageSize?: (number|null); + + /** ListProcessorsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProcessorsRequest. */ + class ListProcessorsRequest implements IListProcessorsRequest { + + /** + * Constructs a new ListProcessorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IListProcessorsRequest); + + /** ListProcessorsRequest parent. */ + public parent: string; + + /** ListProcessorsRequest pageSize. */ + public pageSize: number; + + /** ListProcessorsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProcessorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorsRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IListProcessorsRequest): google.cloud.documentai.v1.ListProcessorsRequest; + + /** + * Encodes the specified ListProcessorsRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsRequest.verify|verify} messages. + * @param message ListProcessorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IListProcessorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsRequest.verify|verify} messages. + * @param message ListProcessorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IListProcessorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorsRequest + * @throws {Error} If the payload is not a 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.ListProcessorsRequest; + + /** + * Decodes a ListProcessorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorsRequest + * @throws {Error} If the payload is 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.ListProcessorsRequest; + + /** + * Verifies a ListProcessorsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListProcessorsRequest; + + /** + * Creates a plain object from a ListProcessorsRequest message. Also converts values to other types if specified. + * @param message ListProcessorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ListProcessorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorsResponse. */ + interface IListProcessorsResponse { + + /** ListProcessorsResponse processors */ + processors?: (google.cloud.documentai.v1.IProcessor[]|null); + + /** ListProcessorsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProcessorsResponse. */ + class ListProcessorsResponse implements IListProcessorsResponse { + + /** + * Constructs a new ListProcessorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IListProcessorsResponse); + + /** ListProcessorsResponse processors. */ + public processors: google.cloud.documentai.v1.IProcessor[]; + + /** ListProcessorsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProcessorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorsResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IListProcessorsResponse): google.cloud.documentai.v1.ListProcessorsResponse; + + /** + * Encodes the specified ListProcessorsResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsResponse.verify|verify} messages. + * @param message ListProcessorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IListProcessorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsResponse.verify|verify} messages. + * @param message ListProcessorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IListProcessorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorsResponse + * @throws {Error} If the payload is not a 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.ListProcessorsResponse; + + /** + * Decodes a ListProcessorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorsResponse + * @throws {Error} If the payload is 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.ListProcessorsResponse; + + /** + * Verifies a ListProcessorsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListProcessorsResponse; + + /** + * Creates a plain object from a ListProcessorsResponse message. Also converts values to other types if specified. + * @param message ListProcessorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ListProcessorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetProcessorTypeRequest. */ + interface IGetProcessorTypeRequest { + + /** GetProcessorTypeRequest name */ + name?: (string|null); + } + + /** Represents a GetProcessorTypeRequest. */ + class GetProcessorTypeRequest implements IGetProcessorTypeRequest { + + /** + * Constructs a new GetProcessorTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IGetProcessorTypeRequest); + + /** GetProcessorTypeRequest name. */ + public name: string; + + /** + * Creates a new GetProcessorTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProcessorTypeRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IGetProcessorTypeRequest): google.cloud.documentai.v1.GetProcessorTypeRequest; + + /** + * Encodes the specified GetProcessorTypeRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorTypeRequest.verify|verify} messages. + * @param message GetProcessorTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IGetProcessorTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProcessorTypeRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorTypeRequest.verify|verify} messages. + * @param message GetProcessorTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IGetProcessorTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProcessorTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProcessorTypeRequest + * @throws {Error} If the payload is not a 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.GetProcessorTypeRequest; + + /** + * Decodes a GetProcessorTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProcessorTypeRequest + * @throws {Error} If the payload is 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.GetProcessorTypeRequest; + + /** + * Verifies a GetProcessorTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProcessorTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProcessorTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GetProcessorTypeRequest; + + /** + * Creates a plain object from a GetProcessorTypeRequest message. Also converts values to other types if specified. + * @param message GetProcessorTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.GetProcessorTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProcessorTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetProcessorTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetProcessorRequest. */ + interface IGetProcessorRequest { + + /** GetProcessorRequest name */ + name?: (string|null); + } + + /** Represents a GetProcessorRequest. */ + class GetProcessorRequest implements IGetProcessorRequest { + + /** + * Constructs a new GetProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IGetProcessorRequest); + + /** GetProcessorRequest name. */ + public name: string; + + /** + * Creates a new GetProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProcessorRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IGetProcessorRequest): google.cloud.documentai.v1.GetProcessorRequest; + + /** + * Encodes the specified GetProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorRequest.verify|verify} messages. + * @param message GetProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IGetProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorRequest.verify|verify} messages. + * @param message GetProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IGetProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProcessorRequest + * @throws {Error} If the payload is not a 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.GetProcessorRequest; + + /** + * Decodes a GetProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProcessorRequest + * @throws {Error} If the payload is 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.GetProcessorRequest; + + /** + * Verifies a GetProcessorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GetProcessorRequest; + + /** + * Creates a plain object from a GetProcessorRequest message. Also converts values to other types if specified. + * @param message GetProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.GetProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetProcessorVersionRequest. */ + interface IGetProcessorVersionRequest { + + /** GetProcessorVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetProcessorVersionRequest. */ + class GetProcessorVersionRequest implements IGetProcessorVersionRequest { + + /** + * Constructs a new GetProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IGetProcessorVersionRequest); + + /** GetProcessorVersionRequest name. */ + public name: string; + + /** + * Creates a new GetProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IGetProcessorVersionRequest): google.cloud.documentai.v1.GetProcessorVersionRequest; + + /** + * Encodes the specified GetProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorVersionRequest.verify|verify} messages. + * @param message GetProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IGetProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorVersionRequest.verify|verify} messages. + * @param message GetProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IGetProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProcessorVersionRequest + * @throws {Error} If the payload is not a 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.GetProcessorVersionRequest; + + /** + * Decodes a GetProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProcessorVersionRequest + * @throws {Error} If the payload is 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.GetProcessorVersionRequest; + + /** + * Verifies a GetProcessorVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GetProcessorVersionRequest; + + /** + * Creates a plain object from a GetProcessorVersionRequest message. Also converts values to other types if specified. + * @param message GetProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.GetProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorVersionsRequest. */ + interface IListProcessorVersionsRequest { + + /** ListProcessorVersionsRequest parent */ + parent?: (string|null); + + /** ListProcessorVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListProcessorVersionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProcessorVersionsRequest. */ + class ListProcessorVersionsRequest implements IListProcessorVersionsRequest { + + /** + * Constructs a new ListProcessorVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IListProcessorVersionsRequest); + + /** ListProcessorVersionsRequest parent. */ + public parent: string; + + /** ListProcessorVersionsRequest pageSize. */ + public pageSize: number; + + /** ListProcessorVersionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProcessorVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorVersionsRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IListProcessorVersionsRequest): google.cloud.documentai.v1.ListProcessorVersionsRequest; + + /** + * Encodes the specified ListProcessorVersionsRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsRequest.verify|verify} messages. + * @param message ListProcessorVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IListProcessorVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsRequest.verify|verify} messages. + * @param message ListProcessorVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IListProcessorVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorVersionsRequest + * @throws {Error} If the payload is not a 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.ListProcessorVersionsRequest; + + /** + * Decodes a ListProcessorVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorVersionsRequest + * @throws {Error} If the payload is 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.ListProcessorVersionsRequest; + + /** + * Verifies a ListProcessorVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListProcessorVersionsRequest; + + /** + * Creates a plain object from a ListProcessorVersionsRequest message. Also converts values to other types if specified. + * @param message ListProcessorVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ListProcessorVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorVersionsResponse. */ + interface IListProcessorVersionsResponse { + + /** ListProcessorVersionsResponse processorVersions */ + processorVersions?: (google.cloud.documentai.v1.IProcessorVersion[]|null); + + /** ListProcessorVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProcessorVersionsResponse. */ + class ListProcessorVersionsResponse implements IListProcessorVersionsResponse { + + /** + * Constructs a new ListProcessorVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IListProcessorVersionsResponse); + + /** ListProcessorVersionsResponse processorVersions. */ + public processorVersions: google.cloud.documentai.v1.IProcessorVersion[]; + + /** ListProcessorVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProcessorVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorVersionsResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IListProcessorVersionsResponse): google.cloud.documentai.v1.ListProcessorVersionsResponse; + + /** + * Encodes the specified ListProcessorVersionsResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsResponse.verify|verify} messages. + * @param message ListProcessorVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IListProcessorVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsResponse.verify|verify} messages. + * @param message ListProcessorVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IListProcessorVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorVersionsResponse + * @throws {Error} If the payload is not a 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.ListProcessorVersionsResponse; + + /** + * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorVersionsResponse + * @throws {Error} If the payload is 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.ListProcessorVersionsResponse; + + /** + * Verifies a ListProcessorVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListProcessorVersionsResponse; + + /** + * Creates a plain object from a ListProcessorVersionsResponse message. Also converts values to other types if specified. + * @param message ListProcessorVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ListProcessorVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteProcessorVersionRequest. */ + interface IDeleteProcessorVersionRequest { + + /** DeleteProcessorVersionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteProcessorVersionRequest. */ + class DeleteProcessorVersionRequest implements IDeleteProcessorVersionRequest { + + /** + * Constructs a new DeleteProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDeleteProcessorVersionRequest); + + /** DeleteProcessorVersionRequest name. */ + public name: string; + + /** + * Creates a new DeleteProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IDeleteProcessorVersionRequest): google.cloud.documentai.v1.DeleteProcessorVersionRequest; + + /** + * Encodes the specified DeleteProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionRequest.verify|verify} messages. + * @param message DeleteProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IDeleteProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionRequest.verify|verify} messages. + * @param message DeleteProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IDeleteProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProcessorVersionRequest + * @throws {Error} If the payload is not a 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.DeleteProcessorVersionRequest; + + /** + * Decodes a DeleteProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProcessorVersionRequest + * @throws {Error} If the payload is 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.DeleteProcessorVersionRequest; + + /** + * Verifies a DeleteProcessorVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeleteProcessorVersionRequest; + + /** + * Creates a plain object from a DeleteProcessorVersionRequest message. Also converts values to other types if specified. + * @param message DeleteProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DeleteProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteProcessorVersionMetadata. */ + interface IDeleteProcessorVersionMetadata { + + /** DeleteProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + } + + /** Represents a DeleteProcessorVersionMetadata. */ + class DeleteProcessorVersionMetadata implements IDeleteProcessorVersionMetadata { + + /** + * Constructs a new DeleteProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDeleteProcessorVersionMetadata); + + /** DeleteProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + + /** + * Creates a new DeleteProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1.IDeleteProcessorVersionMetadata): google.cloud.documentai.v1.DeleteProcessorVersionMetadata; + + /** + * Encodes the specified DeleteProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionMetadata.verify|verify} messages. + * @param message DeleteProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IDeleteProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionMetadata.verify|verify} messages. + * @param message DeleteProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IDeleteProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.DeleteProcessorVersionMetadata; + + /** + * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProcessorVersionMetadata + * @throws {Error} If the payload is 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.DeleteProcessorVersionMetadata; + + /** + * Verifies a DeleteProcessorVersionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeleteProcessorVersionMetadata; + + /** + * Creates a plain object from a DeleteProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message DeleteProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DeleteProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployProcessorVersionRequest. */ + interface IDeployProcessorVersionRequest { + + /** DeployProcessorVersionRequest name */ + name?: (string|null); + } + + /** Represents a DeployProcessorVersionRequest. */ + class DeployProcessorVersionRequest implements IDeployProcessorVersionRequest { + + /** + * Constructs a new DeployProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDeployProcessorVersionRequest); + + /** DeployProcessorVersionRequest name. */ + public name: string; + + /** + * Creates a new DeployProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IDeployProcessorVersionRequest): google.cloud.documentai.v1.DeployProcessorVersionRequest; + + /** + * Encodes the specified DeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionRequest.verify|verify} messages. + * @param message DeployProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IDeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionRequest.verify|verify} messages. + * @param message DeployProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IDeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployProcessorVersionRequest + * @throws {Error} If the payload is not a 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.DeployProcessorVersionRequest; + + /** + * Decodes a DeployProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployProcessorVersionRequest + * @throws {Error} If the payload is 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.DeployProcessorVersionRequest; + + /** + * Verifies a DeployProcessorVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeployProcessorVersionRequest; + + /** + * Creates a plain object from a DeployProcessorVersionRequest message. Also converts values to other types if specified. + * @param message DeployProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DeployProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployProcessorVersionResponse. */ + interface IDeployProcessorVersionResponse { + } + + /** Represents a DeployProcessorVersionResponse. */ + class DeployProcessorVersionResponse implements IDeployProcessorVersionResponse { + + /** + * Constructs a new DeployProcessorVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDeployProcessorVersionResponse); + + /** + * Creates a new DeployProcessorVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployProcessorVersionResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IDeployProcessorVersionResponse): google.cloud.documentai.v1.DeployProcessorVersionResponse; + + /** + * Encodes the specified DeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionResponse.verify|verify} messages. + * @param message DeployProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IDeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionResponse.verify|verify} messages. + * @param message DeployProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IDeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployProcessorVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployProcessorVersionResponse + * @throws {Error} If the payload is not a 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.DeployProcessorVersionResponse; + + /** + * Decodes a DeployProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployProcessorVersionResponse + * @throws {Error} If the payload is 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.DeployProcessorVersionResponse; + + /** + * Verifies a DeployProcessorVersionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployProcessorVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeployProcessorVersionResponse; + + /** + * Creates a plain object from a DeployProcessorVersionResponse message. Also converts values to other types if specified. + * @param message DeployProcessorVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DeployProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployProcessorVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployProcessorVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployProcessorVersionMetadata. */ + interface IDeployProcessorVersionMetadata { + + /** DeployProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + } + + /** Represents a DeployProcessorVersionMetadata. */ + class DeployProcessorVersionMetadata implements IDeployProcessorVersionMetadata { + + /** + * Constructs a new DeployProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDeployProcessorVersionMetadata); + + /** DeployProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + + /** + * Creates a new DeployProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1.IDeployProcessorVersionMetadata): google.cloud.documentai.v1.DeployProcessorVersionMetadata; + + /** + * Encodes the specified DeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionMetadata.verify|verify} messages. + * @param message DeployProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IDeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionMetadata.verify|verify} messages. + * @param message DeployProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IDeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.DeployProcessorVersionMetadata; + + /** + * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployProcessorVersionMetadata + * @throws {Error} If the payload is 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.DeployProcessorVersionMetadata; + + /** + * Verifies a DeployProcessorVersionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeployProcessorVersionMetadata; + + /** + * Creates a plain object from a DeployProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message DeployProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DeployProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployProcessorVersionRequest. */ + interface IUndeployProcessorVersionRequest { + + /** UndeployProcessorVersionRequest name */ + name?: (string|null); + } + + /** Represents an UndeployProcessorVersionRequest. */ + class UndeployProcessorVersionRequest implements IUndeployProcessorVersionRequest { + + /** + * Constructs a new UndeployProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IUndeployProcessorVersionRequest); + + /** UndeployProcessorVersionRequest name. */ + public name: string; + + /** + * Creates a new UndeployProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IUndeployProcessorVersionRequest): google.cloud.documentai.v1.UndeployProcessorVersionRequest; + + /** + * Encodes the specified UndeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionRequest.verify|verify} messages. + * @param message UndeployProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IUndeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionRequest.verify|verify} messages. + * @param message UndeployProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IUndeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployProcessorVersionRequest + * @throws {Error} If the payload is not a 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.UndeployProcessorVersionRequest; + + /** + * Decodes an UndeployProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployProcessorVersionRequest + * @throws {Error} If the payload is 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.UndeployProcessorVersionRequest; + + /** + * Verifies an UndeployProcessorVersionRequest message. + * @param message Plain 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 UndeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.UndeployProcessorVersionRequest; + + /** + * Creates a plain object from an UndeployProcessorVersionRequest message. Also converts values to other types if specified. + * @param message UndeployProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.UndeployProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployProcessorVersionResponse. */ + interface IUndeployProcessorVersionResponse { + } + + /** Represents an UndeployProcessorVersionResponse. */ + class UndeployProcessorVersionResponse implements IUndeployProcessorVersionResponse { + + /** + * Constructs a new UndeployProcessorVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IUndeployProcessorVersionResponse); + + /** + * Creates a new UndeployProcessorVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployProcessorVersionResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IUndeployProcessorVersionResponse): google.cloud.documentai.v1.UndeployProcessorVersionResponse; + + /** + * Encodes the specified UndeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionResponse.verify|verify} messages. + * @param message UndeployProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IUndeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionResponse.verify|verify} messages. + * @param message UndeployProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IUndeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployProcessorVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployProcessorVersionResponse + * @throws {Error} If the payload is not a 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.UndeployProcessorVersionResponse; + + /** + * Decodes an UndeployProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployProcessorVersionResponse + * @throws {Error} If the payload is 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.UndeployProcessorVersionResponse; + + /** + * Verifies an UndeployProcessorVersionResponse message. + * @param message Plain 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 UndeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployProcessorVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.UndeployProcessorVersionResponse; + + /** + * Creates a plain object from an UndeployProcessorVersionResponse message. Also converts values to other types if specified. + * @param message UndeployProcessorVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.UndeployProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployProcessorVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployProcessorVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployProcessorVersionMetadata. */ + interface IUndeployProcessorVersionMetadata { + + /** UndeployProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + } + + /** Represents an UndeployProcessorVersionMetadata. */ + class UndeployProcessorVersionMetadata implements IUndeployProcessorVersionMetadata { + + /** + * Constructs a new UndeployProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IUndeployProcessorVersionMetadata); + + /** UndeployProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + + /** + * Creates a new UndeployProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1.IUndeployProcessorVersionMetadata): google.cloud.documentai.v1.UndeployProcessorVersionMetadata; + + /** + * Encodes the specified UndeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionMetadata.verify|verify} messages. + * @param message UndeployProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IUndeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionMetadata.verify|verify} messages. + * @param message UndeployProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IUndeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.UndeployProcessorVersionMetadata; + + /** + * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployProcessorVersionMetadata + * @throws {Error} If the payload is 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.UndeployProcessorVersionMetadata; + + /** + * Verifies an UndeployProcessorVersionMetadata message. + * @param message Plain 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 UndeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.UndeployProcessorVersionMetadata; + + /** + * Creates a plain object from an UndeployProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message UndeployProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.UndeployProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateProcessorRequest. */ + interface ICreateProcessorRequest { + + /** CreateProcessorRequest parent */ + parent?: (string|null); + + /** CreateProcessorRequest processor */ + processor?: (google.cloud.documentai.v1.IProcessor|null); + } + + /** Represents a CreateProcessorRequest. */ + class CreateProcessorRequest implements ICreateProcessorRequest { + + /** + * Constructs a new CreateProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ICreateProcessorRequest); + + /** CreateProcessorRequest parent. */ + public parent: string; + + /** CreateProcessorRequest processor. */ + public processor?: (google.cloud.documentai.v1.IProcessor|null); + + /** + * Creates a new CreateProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateProcessorRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.ICreateProcessorRequest): google.cloud.documentai.v1.CreateProcessorRequest; + + /** + * Encodes the specified CreateProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.CreateProcessorRequest.verify|verify} messages. + * @param message CreateProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ICreateProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.CreateProcessorRequest.verify|verify} messages. + * @param message CreateProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ICreateProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateProcessorRequest + * @throws {Error} If the payload is not a 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.CreateProcessorRequest; + + /** + * Decodes a CreateProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateProcessorRequest + * @throws {Error} If the payload is 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.CreateProcessorRequest; + + /** + * Verifies a CreateProcessorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.CreateProcessorRequest; + + /** + * Creates a plain object from a CreateProcessorRequest message. Also converts values to other types if specified. + * @param message CreateProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.CreateProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteProcessorRequest. */ + interface IDeleteProcessorRequest { + + /** DeleteProcessorRequest name */ + name?: (string|null); + } + + /** Represents a DeleteProcessorRequest. */ + class DeleteProcessorRequest implements IDeleteProcessorRequest { + + /** + * Constructs a new DeleteProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDeleteProcessorRequest); + + /** DeleteProcessorRequest name. */ + public name: string; + + /** + * Creates a new DeleteProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProcessorRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IDeleteProcessorRequest): google.cloud.documentai.v1.DeleteProcessorRequest; + + /** + * Encodes the specified DeleteProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorRequest.verify|verify} messages. + * @param message DeleteProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IDeleteProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorRequest.verify|verify} messages. + * @param message DeleteProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IDeleteProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProcessorRequest + * @throws {Error} If the payload is not a 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.DeleteProcessorRequest; + + /** + * Decodes a DeleteProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProcessorRequest + * @throws {Error} If the payload is 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.DeleteProcessorRequest; + + /** + * Verifies a DeleteProcessorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeleteProcessorRequest; + + /** + * Creates a plain object from a DeleteProcessorRequest message. Also converts values to other types if specified. + * @param message DeleteProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DeleteProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteProcessorMetadata. */ + interface IDeleteProcessorMetadata { + + /** DeleteProcessorMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + } + + /** Represents a DeleteProcessorMetadata. */ + class DeleteProcessorMetadata implements IDeleteProcessorMetadata { + + /** + * Constructs a new DeleteProcessorMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDeleteProcessorMetadata); + + /** DeleteProcessorMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + + /** + * Creates a new DeleteProcessorMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProcessorMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1.IDeleteProcessorMetadata): google.cloud.documentai.v1.DeleteProcessorMetadata; + + /** + * Encodes the specified DeleteProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorMetadata.verify|verify} messages. + * @param message DeleteProcessorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IDeleteProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorMetadata.verify|verify} messages. + * @param message DeleteProcessorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IDeleteProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProcessorMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProcessorMetadata + * @throws {Error} If the payload is not a 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.DeleteProcessorMetadata; + + /** + * Decodes a DeleteProcessorMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProcessorMetadata + * @throws {Error} If the payload is 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.DeleteProcessorMetadata; + + /** + * Verifies a DeleteProcessorMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProcessorMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProcessorMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeleteProcessorMetadata; + + /** + * Creates a plain object from a DeleteProcessorMetadata message. Also converts values to other types if specified. + * @param message DeleteProcessorMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DeleteProcessorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProcessorMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteProcessorMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnableProcessorRequest. */ + interface IEnableProcessorRequest { + + /** EnableProcessorRequest name */ + name?: (string|null); + } + + /** Represents an EnableProcessorRequest. */ + class EnableProcessorRequest implements IEnableProcessorRequest { + + /** + * Constructs a new EnableProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IEnableProcessorRequest); + + /** EnableProcessorRequest name. */ + public name: string; + + /** + * Creates a new EnableProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EnableProcessorRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IEnableProcessorRequest): google.cloud.documentai.v1.EnableProcessorRequest; + + /** + * Encodes the specified EnableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorRequest.verify|verify} messages. + * @param message EnableProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IEnableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorRequest.verify|verify} messages. + * @param message EnableProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IEnableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnableProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnableProcessorRequest + * @throws {Error} If the payload is not a 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.EnableProcessorRequest; + + /** + * Decodes an EnableProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnableProcessorRequest + * @throws {Error} If the payload is 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.EnableProcessorRequest; + + /** + * Verifies an EnableProcessorRequest message. + * @param message Plain 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 EnableProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnableProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EnableProcessorRequest; + + /** + * Creates a plain object from an EnableProcessorRequest message. Also converts values to other types if specified. + * @param message EnableProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.EnableProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnableProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnableProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnableProcessorResponse. */ + interface IEnableProcessorResponse { + } + + /** Represents an EnableProcessorResponse. */ + class EnableProcessorResponse implements IEnableProcessorResponse { + + /** + * Constructs a new EnableProcessorResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IEnableProcessorResponse); + + /** + * Creates a new EnableProcessorResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns EnableProcessorResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IEnableProcessorResponse): google.cloud.documentai.v1.EnableProcessorResponse; + + /** + * Encodes the specified EnableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorResponse.verify|verify} messages. + * @param message EnableProcessorResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IEnableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorResponse.verify|verify} messages. + * @param message EnableProcessorResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IEnableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnableProcessorResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnableProcessorResponse + * @throws {Error} If the payload is not a 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.EnableProcessorResponse; + + /** + * Decodes an EnableProcessorResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnableProcessorResponse + * @throws {Error} If the payload is 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.EnableProcessorResponse; + + /** + * Verifies an EnableProcessorResponse message. + * @param message Plain 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 EnableProcessorResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnableProcessorResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EnableProcessorResponse; + + /** + * Creates a plain object from an EnableProcessorResponse message. Also converts values to other types if specified. + * @param message EnableProcessorResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.EnableProcessorResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnableProcessorResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnableProcessorResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnableProcessorMetadata. */ + interface IEnableProcessorMetadata { + + /** EnableProcessorMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + } + + /** Represents an EnableProcessorMetadata. */ + class EnableProcessorMetadata implements IEnableProcessorMetadata { + + /** + * Constructs a new EnableProcessorMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IEnableProcessorMetadata); + + /** EnableProcessorMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + + /** + * Creates a new EnableProcessorMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns EnableProcessorMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1.IEnableProcessorMetadata): google.cloud.documentai.v1.EnableProcessorMetadata; + + /** + * Encodes the specified EnableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorMetadata.verify|verify} messages. + * @param message EnableProcessorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IEnableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorMetadata.verify|verify} messages. + * @param message EnableProcessorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IEnableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnableProcessorMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnableProcessorMetadata + * @throws {Error} If the payload is not a 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.EnableProcessorMetadata; + + /** + * Decodes an EnableProcessorMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnableProcessorMetadata + * @throws {Error} If the payload is 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.EnableProcessorMetadata; + + /** + * Verifies an EnableProcessorMetadata message. + * @param message Plain 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 EnableProcessorMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnableProcessorMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EnableProcessorMetadata; + + /** + * Creates a plain object from an EnableProcessorMetadata message. Also converts values to other types if specified. + * @param message EnableProcessorMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.EnableProcessorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnableProcessorMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnableProcessorMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisableProcessorRequest. */ + interface IDisableProcessorRequest { + + /** DisableProcessorRequest name */ + name?: (string|null); + } + + /** Represents a DisableProcessorRequest. */ + class DisableProcessorRequest implements IDisableProcessorRequest { + + /** + * Constructs a new DisableProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDisableProcessorRequest); + + /** DisableProcessorRequest name. */ + public name: string; + + /** + * Creates a new DisableProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableProcessorRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IDisableProcessorRequest): google.cloud.documentai.v1.DisableProcessorRequest; + + /** + * Encodes the specified DisableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorRequest.verify|verify} messages. + * @param message DisableProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IDisableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorRequest.verify|verify} messages. + * @param message DisableProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IDisableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableProcessorRequest + * @throws {Error} If the payload is not a 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.DisableProcessorRequest; + + /** + * Decodes a DisableProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableProcessorRequest + * @throws {Error} If the payload is 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.DisableProcessorRequest; + + /** + * Verifies a DisableProcessorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisableProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DisableProcessorRequest; + + /** + * Creates a plain object from a DisableProcessorRequest message. Also converts values to other types if specified. + * @param message DisableProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DisableProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisableProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisableProcessorResponse. */ + interface IDisableProcessorResponse { + } + + /** Represents a DisableProcessorResponse. */ + class DisableProcessorResponse implements IDisableProcessorResponse { + + /** + * Constructs a new DisableProcessorResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDisableProcessorResponse); + + /** + * Creates a new DisableProcessorResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableProcessorResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IDisableProcessorResponse): google.cloud.documentai.v1.DisableProcessorResponse; + + /** + * Encodes the specified DisableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorResponse.verify|verify} messages. + * @param message DisableProcessorResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IDisableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorResponse.verify|verify} messages. + * @param message DisableProcessorResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IDisableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableProcessorResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableProcessorResponse + * @throws {Error} If the payload is not a 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.DisableProcessorResponse; + + /** + * Decodes a DisableProcessorResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableProcessorResponse + * @throws {Error} If the payload is 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.DisableProcessorResponse; + + /** + * Verifies a DisableProcessorResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisableProcessorResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableProcessorResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DisableProcessorResponse; + + /** + * Creates a plain object from a DisableProcessorResponse message. Also converts values to other types if specified. + * @param message DisableProcessorResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DisableProcessorResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableProcessorResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisableProcessorResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisableProcessorMetadata. */ + interface IDisableProcessorMetadata { + + /** DisableProcessorMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + } + + /** Represents a DisableProcessorMetadata. */ + class DisableProcessorMetadata implements IDisableProcessorMetadata { + + /** + * Constructs a new DisableProcessorMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDisableProcessorMetadata); + + /** DisableProcessorMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + + /** + * Creates a new DisableProcessorMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableProcessorMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1.IDisableProcessorMetadata): google.cloud.documentai.v1.DisableProcessorMetadata; + + /** + * Encodes the specified DisableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorMetadata.verify|verify} messages. + * @param message DisableProcessorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IDisableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorMetadata.verify|verify} messages. + * @param message DisableProcessorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IDisableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableProcessorMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableProcessorMetadata + * @throws {Error} If the payload is not a 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.DisableProcessorMetadata; + + /** + * Decodes a DisableProcessorMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableProcessorMetadata + * @throws {Error} If the payload is 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.DisableProcessorMetadata; + + /** + * Verifies a DisableProcessorMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisableProcessorMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableProcessorMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DisableProcessorMetadata; + + /** + * Creates a plain object from a DisableProcessorMetadata message. Also converts values to other types if specified. + * @param message DisableProcessorMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DisableProcessorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableProcessorMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisableProcessorMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SetDefaultProcessorVersionRequest. */ + interface ISetDefaultProcessorVersionRequest { + + /** SetDefaultProcessorVersionRequest processor */ + processor?: (string|null); + + /** SetDefaultProcessorVersionRequest defaultProcessorVersion */ + defaultProcessorVersion?: (string|null); + } + + /** Represents a SetDefaultProcessorVersionRequest. */ + class SetDefaultProcessorVersionRequest implements ISetDefaultProcessorVersionRequest { + + /** + * Constructs a new SetDefaultProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest); + + /** SetDefaultProcessorVersionRequest processor. */ + public processor: string; + + /** SetDefaultProcessorVersionRequest defaultProcessorVersion. */ + public defaultProcessorVersion: string; + + /** + * Creates a new SetDefaultProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetDefaultProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest): google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; + + /** + * Encodes the specified SetDefaultProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.verify|verify} messages. + * @param message SetDefaultProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetDefaultProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.verify|verify} messages. + * @param message SetDefaultProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetDefaultProcessorVersionRequest + * @throws {Error} If the payload is not a 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.SetDefaultProcessorVersionRequest; + + /** + * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetDefaultProcessorVersionRequest + * @throws {Error} If the payload is 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.SetDefaultProcessorVersionRequest; + + /** + * Verifies a SetDefaultProcessorVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetDefaultProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetDefaultProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; + + /** + * Creates a plain object from a SetDefaultProcessorVersionRequest message. Also converts values to other types if specified. + * @param message SetDefaultProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.SetDefaultProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetDefaultProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetDefaultProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SetDefaultProcessorVersionResponse. */ + interface ISetDefaultProcessorVersionResponse { + } + + /** Represents a SetDefaultProcessorVersionResponse. */ + class SetDefaultProcessorVersionResponse implements ISetDefaultProcessorVersionResponse { + + /** + * Constructs a new SetDefaultProcessorVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse); + + /** + * Creates a new SetDefaultProcessorVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SetDefaultProcessorVersionResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse): google.cloud.documentai.v1.SetDefaultProcessorVersionResponse; + + /** + * Encodes the specified SetDefaultProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.verify|verify} messages. + * @param message SetDefaultProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetDefaultProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.verify|verify} messages. + * @param message SetDefaultProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetDefaultProcessorVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetDefaultProcessorVersionResponse + * @throws {Error} If the payload is not a 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.SetDefaultProcessorVersionResponse; + + /** + * Decodes a SetDefaultProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetDefaultProcessorVersionResponse + * @throws {Error} If the payload is 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.SetDefaultProcessorVersionResponse; + + /** + * Verifies a SetDefaultProcessorVersionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetDefaultProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetDefaultProcessorVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.SetDefaultProcessorVersionResponse; + + /** + * Creates a plain object from a SetDefaultProcessorVersionResponse message. Also converts values to other types if specified. + * @param message SetDefaultProcessorVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.SetDefaultProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetDefaultProcessorVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetDefaultProcessorVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SetDefaultProcessorVersionMetadata. */ + interface ISetDefaultProcessorVersionMetadata { + + /** SetDefaultProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + } + + /** Represents a SetDefaultProcessorVersionMetadata. */ + class SetDefaultProcessorVersionMetadata implements ISetDefaultProcessorVersionMetadata { + + /** + * Constructs a new SetDefaultProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata); + + /** SetDefaultProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + + /** + * Creates a new SetDefaultProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns SetDefaultProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata): google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata; + + /** + * Encodes the specified SetDefaultProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.verify|verify} messages. + * @param message SetDefaultProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetDefaultProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.verify|verify} messages. + * @param message SetDefaultProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetDefaultProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.SetDefaultProcessorVersionMetadata; + + /** + * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetDefaultProcessorVersionMetadata + * @throws {Error} If the payload is 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.SetDefaultProcessorVersionMetadata; + + /** + * Verifies a SetDefaultProcessorVersionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetDefaultProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetDefaultProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata; + + /** + * Creates a plain object from a SetDefaultProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message SetDefaultProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetDefaultProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetDefaultProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrainProcessorVersionRequest. */ + interface ITrainProcessorVersionRequest { + + /** TrainProcessorVersionRequest customDocumentExtractionOptions */ + customDocumentExtractionOptions?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null); + + /** TrainProcessorVersionRequest foundationModelTuningOptions */ + foundationModelTuningOptions?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null); + + /** TrainProcessorVersionRequest parent */ + parent?: (string|null); + + /** TrainProcessorVersionRequest processorVersion */ + processorVersion?: (google.cloud.documentai.v1.IProcessorVersion|null); + + /** TrainProcessorVersionRequest documentSchema */ + documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); + + /** TrainProcessorVersionRequest inputData */ + inputData?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData|null); + + /** TrainProcessorVersionRequest baseProcessorVersion */ + baseProcessorVersion?: (string|null); + } + + /** Represents a TrainProcessorVersionRequest. */ + class TrainProcessorVersionRequest implements ITrainProcessorVersionRequest { + + /** + * Constructs a new TrainProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ITrainProcessorVersionRequest); + + /** TrainProcessorVersionRequest customDocumentExtractionOptions. */ + public customDocumentExtractionOptions?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null); + + /** TrainProcessorVersionRequest foundationModelTuningOptions. */ + public foundationModelTuningOptions?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null); + + /** TrainProcessorVersionRequest parent. */ + public parent: string; + + /** TrainProcessorVersionRequest processorVersion. */ + public processorVersion?: (google.cloud.documentai.v1.IProcessorVersion|null); + + /** TrainProcessorVersionRequest documentSchema. */ + public documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); + + /** TrainProcessorVersionRequest inputData. */ + public inputData?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData|null); + + /** TrainProcessorVersionRequest baseProcessorVersion. */ + public baseProcessorVersion: string; + + /** TrainProcessorVersionRequest processorFlags. */ + public processorFlags?: ("customDocumentExtractionOptions"|"foundationModelTuningOptions"); + + /** + * Creates a new TrainProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.ITrainProcessorVersionRequest): google.cloud.documentai.v1.TrainProcessorVersionRequest; + + /** + * Encodes the specified TrainProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.verify|verify} messages. + * @param message TrainProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ITrainProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.verify|verify} messages. + * @param message TrainProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ITrainProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainProcessorVersionRequest + * @throws {Error} If the payload is not a 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.TrainProcessorVersionRequest; + + /** + * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainProcessorVersionRequest + * @throws {Error} If the payload is 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.TrainProcessorVersionRequest; + + /** + * Verifies a TrainProcessorVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrainProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionRequest; + + /** + * Creates a plain object from a TrainProcessorVersionRequest message. Also converts values to other types if specified. + * @param message TrainProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrainProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TrainProcessorVersionRequest { + + /** Properties of an InputData. */ + interface IInputData { + + /** InputData trainingDocuments */ + trainingDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); + + /** InputData testDocuments */ + testDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); + } + + /** Represents an InputData. */ + class InputData implements IInputData { + + /** + * Constructs a new InputData. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData); + + /** InputData trainingDocuments. */ + public trainingDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); + + /** InputData testDocuments. */ + public testDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); + + /** + * Creates a new InputData instance using the specified properties. + * @param [properties] Properties to set + * @returns InputData instance + */ + public static create(properties?: google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData): google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData; + + /** + * Encodes the specified InputData message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.verify|verify} messages. + * @param message InputData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputData message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.verify|verify} messages. + * @param message InputData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputData + * @throws {Error} If the payload is not a 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.TrainProcessorVersionRequest.InputData; + + /** + * Decodes an InputData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputData + * @throws {Error} If the payload is 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.TrainProcessorVersionRequest.InputData; + + /** + * Verifies an InputData message. + * @param message Plain 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 InputData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputData + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData; + + /** + * Creates a plain object from an InputData message. Also converts values to other types if specified. + * @param message InputData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomDocumentExtractionOptions. */ + interface ICustomDocumentExtractionOptions { + + /** CustomDocumentExtractionOptions trainingMethod */ + trainingMethod?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|keyof typeof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|null); + } + + /** Represents a CustomDocumentExtractionOptions. */ + class CustomDocumentExtractionOptions implements ICustomDocumentExtractionOptions { + + /** + * Constructs a new CustomDocumentExtractionOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions); + + /** CustomDocumentExtractionOptions trainingMethod. */ + public trainingMethod: (google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|keyof typeof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod); + + /** + * Creates a new CustomDocumentExtractionOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomDocumentExtractionOptions instance + */ + public static create(properties?: google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions): google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; + + /** + * Encodes the specified CustomDocumentExtractionOptions message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. + * @param message CustomDocumentExtractionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomDocumentExtractionOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. + * @param message CustomDocumentExtractionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomDocumentExtractionOptions + * @throws {Error} If the payload is not a 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.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; + + /** + * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomDocumentExtractionOptions + * @throws {Error} If the payload is 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.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; + + /** + * Verifies a CustomDocumentExtractionOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomDocumentExtractionOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomDocumentExtractionOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; + + /** + * Creates a plain object from a CustomDocumentExtractionOptions message. Also converts values to other types if specified. + * @param message CustomDocumentExtractionOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomDocumentExtractionOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomDocumentExtractionOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomDocumentExtractionOptions { + + /** TrainingMethod enum. */ + enum TrainingMethod { + TRAINING_METHOD_UNSPECIFIED = 0, + MODEL_BASED = 1, + TEMPLATE_BASED = 2 + } + } + + /** Properties of a FoundationModelTuningOptions. */ + interface IFoundationModelTuningOptions { + + /** FoundationModelTuningOptions trainSteps */ + trainSteps?: (number|null); + + /** FoundationModelTuningOptions learningRateMultiplier */ + learningRateMultiplier?: (number|null); + } + + /** Represents a FoundationModelTuningOptions. */ + class FoundationModelTuningOptions implements IFoundationModelTuningOptions { + + /** + * Constructs a new FoundationModelTuningOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions); + + /** FoundationModelTuningOptions trainSteps. */ + public trainSteps: number; + + /** FoundationModelTuningOptions learningRateMultiplier. */ + public learningRateMultiplier: number; + + /** + * Creates a new FoundationModelTuningOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FoundationModelTuningOptions instance + */ + public static create(properties?: google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions): google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions; + + /** + * Encodes the specified FoundationModelTuningOptions message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. + * @param message FoundationModelTuningOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FoundationModelTuningOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. + * @param message FoundationModelTuningOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FoundationModelTuningOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FoundationModelTuningOptions + * @throws {Error} If the payload is not a 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.TrainProcessorVersionRequest.FoundationModelTuningOptions; + + /** + * Decodes a FoundationModelTuningOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FoundationModelTuningOptions + * @throws {Error} If the payload is 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.TrainProcessorVersionRequest.FoundationModelTuningOptions; + + /** + * Verifies a FoundationModelTuningOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FoundationModelTuningOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FoundationModelTuningOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions; + + /** + * Creates a plain object from a FoundationModelTuningOptions message. Also converts values to other types if specified. + * @param message FoundationModelTuningOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FoundationModelTuningOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FoundationModelTuningOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TrainProcessorVersionResponse. */ + interface ITrainProcessorVersionResponse { + + /** TrainProcessorVersionResponse processorVersion */ + processorVersion?: (string|null); + } + + /** Represents a TrainProcessorVersionResponse. */ + class TrainProcessorVersionResponse implements ITrainProcessorVersionResponse { + + /** + * Constructs a new TrainProcessorVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ITrainProcessorVersionResponse); + + /** TrainProcessorVersionResponse processorVersion. */ + public processorVersion: string; + + /** + * Creates a new TrainProcessorVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainProcessorVersionResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.ITrainProcessorVersionResponse): google.cloud.documentai.v1.TrainProcessorVersionResponse; + + /** + * Encodes the specified TrainProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionResponse.verify|verify} messages. + * @param message TrainProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ITrainProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionResponse.verify|verify} messages. + * @param message TrainProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ITrainProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainProcessorVersionResponse + * @throws {Error} If the payload is not a 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.TrainProcessorVersionResponse; + + /** + * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainProcessorVersionResponse + * @throws {Error} If the payload is 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.TrainProcessorVersionResponse; + + /** + * Verifies a TrainProcessorVersionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrainProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainProcessorVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionResponse; + + /** + * Creates a plain object from a TrainProcessorVersionResponse message. Also converts values to other types if specified. + * @param message TrainProcessorVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainProcessorVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrainProcessorVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrainProcessorVersionMetadata. */ + interface ITrainProcessorVersionMetadata { + + /** TrainProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + + /** TrainProcessorVersionMetadata trainingDatasetValidation */ + trainingDatasetValidation?: (google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null); + + /** TrainProcessorVersionMetadata testDatasetValidation */ + testDatasetValidation?: (google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null); + } + + /** Represents a TrainProcessorVersionMetadata. */ + class TrainProcessorVersionMetadata implements ITrainProcessorVersionMetadata { + + /** + * Constructs a new TrainProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ITrainProcessorVersionMetadata); + + /** TrainProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + + /** TrainProcessorVersionMetadata trainingDatasetValidation. */ + public trainingDatasetValidation?: (google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null); + + /** TrainProcessorVersionMetadata testDatasetValidation. */ + public testDatasetValidation?: (google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null); + + /** + * Creates a new TrainProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1.ITrainProcessorVersionMetadata): google.cloud.documentai.v1.TrainProcessorVersionMetadata; + + /** + * Encodes the specified TrainProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.verify|verify} messages. + * @param message TrainProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ITrainProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.verify|verify} messages. + * @param message TrainProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ITrainProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.TrainProcessorVersionMetadata; + + /** + * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainProcessorVersionMetadata + * @throws {Error} If the payload is 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.TrainProcessorVersionMetadata; + + /** + * Verifies a TrainProcessorVersionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrainProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionMetadata; + + /** + * Creates a plain object from a TrainProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message TrainProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrainProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TrainProcessorVersionMetadata { + + /** Properties of a DatasetValidation. */ + interface IDatasetValidation { + + /** DatasetValidation documentErrorCount */ + documentErrorCount?: (number|null); + + /** DatasetValidation datasetErrorCount */ + datasetErrorCount?: (number|null); + + /** DatasetValidation documentErrors */ + documentErrors?: (google.rpc.IStatus[]|null); + + /** DatasetValidation datasetErrors */ + datasetErrors?: (google.rpc.IStatus[]|null); + } + + /** Represents a DatasetValidation. */ + class DatasetValidation implements IDatasetValidation { + + /** + * Constructs a new DatasetValidation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation); + + /** DatasetValidation documentErrorCount. */ + public documentErrorCount: number; + + /** DatasetValidation datasetErrorCount. */ + public datasetErrorCount: number; + + /** DatasetValidation documentErrors. */ + public documentErrors: google.rpc.IStatus[]; + + /** DatasetValidation datasetErrors. */ + public datasetErrors: google.rpc.IStatus[]; + + /** + * Creates a new DatasetValidation instance using the specified properties. + * @param [properties] Properties to set + * @returns DatasetValidation instance + */ + public static create(properties?: google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation): google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation; + + /** + * Encodes the specified DatasetValidation message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. + * @param message DatasetValidation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatasetValidation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. + * @param message DatasetValidation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatasetValidation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatasetValidation + * @throws {Error} If the payload is not a 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.TrainProcessorVersionMetadata.DatasetValidation; + + /** + * Decodes a DatasetValidation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatasetValidation + * @throws {Error} If the payload is 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.TrainProcessorVersionMetadata.DatasetValidation; + + /** + * Verifies a DatasetValidation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DatasetValidation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatasetValidation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation; + + /** + * Creates a plain object from a DatasetValidation message. Also converts values to other types if specified. + * @param message DatasetValidation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatasetValidation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatasetValidation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ReviewDocumentRequest. */ + interface IReviewDocumentRequest { + + /** ReviewDocumentRequest inlineDocument */ + inlineDocument?: (google.cloud.documentai.v1.IDocument|null); + + /** ReviewDocumentRequest humanReviewConfig */ + humanReviewConfig?: (string|null); + + /** ReviewDocumentRequest enableSchemaValidation */ + enableSchemaValidation?: (boolean|null); + + /** ReviewDocumentRequest priority */ + priority?: (google.cloud.documentai.v1.ReviewDocumentRequest.Priority|keyof typeof google.cloud.documentai.v1.ReviewDocumentRequest.Priority|null); + + /** ReviewDocumentRequest documentSchema */ + documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); + } + + /** Represents a ReviewDocumentRequest. */ + class ReviewDocumentRequest implements IReviewDocumentRequest { + + /** + * Constructs a new ReviewDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IReviewDocumentRequest); + + /** ReviewDocumentRequest inlineDocument. */ + public inlineDocument?: (google.cloud.documentai.v1.IDocument|null); + + /** ReviewDocumentRequest humanReviewConfig. */ + public humanReviewConfig: string; + + /** ReviewDocumentRequest enableSchemaValidation. */ + public enableSchemaValidation: boolean; + + /** ReviewDocumentRequest priority. */ + public priority: (google.cloud.documentai.v1.ReviewDocumentRequest.Priority|keyof typeof google.cloud.documentai.v1.ReviewDocumentRequest.Priority); + + /** ReviewDocumentRequest documentSchema. */ + public documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); + + /** ReviewDocumentRequest source. */ + public source?: "inlineDocument"; + + /** + * Creates a new ReviewDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReviewDocumentRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IReviewDocumentRequest): google.cloud.documentai.v1.ReviewDocumentRequest; + + /** + * Encodes the specified ReviewDocumentRequest message. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentRequest.verify|verify} messages. + * @param message ReviewDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IReviewDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReviewDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentRequest.verify|verify} messages. + * @param message ReviewDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IReviewDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReviewDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReviewDocumentRequest + * @throws {Error} If the payload is not a 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.ReviewDocumentRequest; + + /** + * Decodes a ReviewDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReviewDocumentRequest + * @throws {Error} If the payload is 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.ReviewDocumentRequest; + + /** + * Verifies a ReviewDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReviewDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReviewDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ReviewDocumentRequest; + + /** + * Creates a plain object from a ReviewDocumentRequest message. Also converts values to other types if specified. + * @param message ReviewDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ReviewDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReviewDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReviewDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReviewDocumentRequest { + + /** Priority enum. */ + enum Priority { + DEFAULT = 0, + URGENT = 1 + } + } + + /** Properties of a ReviewDocumentResponse. */ + interface IReviewDocumentResponse { + + /** ReviewDocumentResponse gcsDestination */ + gcsDestination?: (string|null); + + /** ReviewDocumentResponse state */ + state?: (google.cloud.documentai.v1.ReviewDocumentResponse.State|keyof typeof google.cloud.documentai.v1.ReviewDocumentResponse.State|null); + + /** ReviewDocumentResponse rejectionReason */ + rejectionReason?: (string|null); + } + + /** Represents a ReviewDocumentResponse. */ + class ReviewDocumentResponse implements IReviewDocumentResponse { + + /** + * Constructs a new ReviewDocumentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IReviewDocumentResponse); + + /** ReviewDocumentResponse gcsDestination. */ + public gcsDestination: string; + + /** ReviewDocumentResponse state. */ + public state: (google.cloud.documentai.v1.ReviewDocumentResponse.State|keyof typeof google.cloud.documentai.v1.ReviewDocumentResponse.State); + + /** ReviewDocumentResponse rejectionReason. */ + public rejectionReason: string; + + /** + * Creates a new ReviewDocumentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReviewDocumentResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IReviewDocumentResponse): google.cloud.documentai.v1.ReviewDocumentResponse; + + /** + * Encodes the specified ReviewDocumentResponse message. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentResponse.verify|verify} messages. + * @param message ReviewDocumentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IReviewDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReviewDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentResponse.verify|verify} messages. + * @param message ReviewDocumentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IReviewDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReviewDocumentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReviewDocumentResponse + * @throws {Error} If the payload is not a 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.ReviewDocumentResponse; + + /** + * Decodes a ReviewDocumentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReviewDocumentResponse + * @throws {Error} If the payload is 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.ReviewDocumentResponse; + + /** + * Verifies a ReviewDocumentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReviewDocumentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReviewDocumentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ReviewDocumentResponse; + + /** + * Creates a plain object from a ReviewDocumentResponse message. Also converts values to other types if specified. + * @param message ReviewDocumentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ReviewDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReviewDocumentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReviewDocumentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReviewDocumentResponse { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + REJECTED = 1, + SUCCEEDED = 2 + } + } + + /** Properties of a ReviewDocumentOperationMetadata. */ + interface IReviewDocumentOperationMetadata { + + /** ReviewDocumentOperationMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + + /** ReviewDocumentOperationMetadata questionId */ + questionId?: (string|null); + } + + /** Represents a ReviewDocumentOperationMetadata. */ + class ReviewDocumentOperationMetadata implements IReviewDocumentOperationMetadata { + + /** + * Constructs a new ReviewDocumentOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IReviewDocumentOperationMetadata); + + /** ReviewDocumentOperationMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + + /** ReviewDocumentOperationMetadata questionId. */ + public questionId: string; + + /** + * Creates a new ReviewDocumentOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ReviewDocumentOperationMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1.IReviewDocumentOperationMetadata): google.cloud.documentai.v1.ReviewDocumentOperationMetadata; + + /** + * Encodes the specified ReviewDocumentOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentOperationMetadata.verify|verify} messages. + * @param message ReviewDocumentOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IReviewDocumentOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReviewDocumentOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentOperationMetadata.verify|verify} messages. + * @param message ReviewDocumentOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IReviewDocumentOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReviewDocumentOperationMetadata + * @throws {Error} If the payload is not a 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.ReviewDocumentOperationMetadata; + + /** + * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReviewDocumentOperationMetadata + * @throws {Error} If the payload is 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.ReviewDocumentOperationMetadata; + + /** + * Verifies a ReviewDocumentOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReviewDocumentOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReviewDocumentOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ReviewDocumentOperationMetadata; + + /** + * Creates a plain object from a ReviewDocumentOperationMetadata message. Also converts values to other types if specified. + * @param message ReviewDocumentOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ReviewDocumentOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReviewDocumentOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReviewDocumentOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluateProcessorVersionRequest. */ + interface IEvaluateProcessorVersionRequest { + + /** EvaluateProcessorVersionRequest processorVersion */ + processorVersion?: (string|null); + + /** EvaluateProcessorVersionRequest evaluationDocuments */ + evaluationDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); + } + + /** Represents an EvaluateProcessorVersionRequest. */ + class EvaluateProcessorVersionRequest implements IEvaluateProcessorVersionRequest { + + /** + * Constructs a new EvaluateProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IEvaluateProcessorVersionRequest); + + /** EvaluateProcessorVersionRequest processorVersion. */ + public processorVersion: string; + + /** EvaluateProcessorVersionRequest evaluationDocuments. */ + public evaluationDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); + + /** + * Creates a new EvaluateProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluateProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IEvaluateProcessorVersionRequest): google.cloud.documentai.v1.EvaluateProcessorVersionRequest; + + /** + * Encodes the specified EvaluateProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionRequest.verify|verify} messages. + * @param message EvaluateProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluateProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionRequest.verify|verify} messages. + * @param message EvaluateProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluateProcessorVersionRequest + * @throws {Error} If the payload is not a 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.EvaluateProcessorVersionRequest; + + /** + * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluateProcessorVersionRequest + * @throws {Error} If the payload is 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.EvaluateProcessorVersionRequest; + + /** + * Verifies an EvaluateProcessorVersionRequest message. + * @param message Plain 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 EvaluateProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluateProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EvaluateProcessorVersionRequest; + + /** + * Creates a plain object from an EvaluateProcessorVersionRequest message. Also converts values to other types if specified. + * @param message EvaluateProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.EvaluateProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluateProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluateProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluateProcessorVersionMetadata. */ + interface IEvaluateProcessorVersionMetadata { + + /** EvaluateProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + } + + /** Represents an EvaluateProcessorVersionMetadata. */ + class EvaluateProcessorVersionMetadata implements IEvaluateProcessorVersionMetadata { + + /** + * Constructs a new EvaluateProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata); + + /** EvaluateProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); + + /** + * Creates a new EvaluateProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluateProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata): google.cloud.documentai.v1.EvaluateProcessorVersionMetadata; + + /** + * Encodes the specified EvaluateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.verify|verify} messages. + * @param message EvaluateProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.verify|verify} messages. + * @param message EvaluateProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluateProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.EvaluateProcessorVersionMetadata; + + /** + * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluateProcessorVersionMetadata + * @throws {Error} If the payload is 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.EvaluateProcessorVersionMetadata; + + /** + * Verifies an EvaluateProcessorVersionMetadata message. + * @param message Plain 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 EvaluateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluateProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EvaluateProcessorVersionMetadata; + + /** + * Creates a plain object from an EvaluateProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message EvaluateProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.EvaluateProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluateProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluateProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluateProcessorVersionResponse. */ + interface IEvaluateProcessorVersionResponse { + + /** EvaluateProcessorVersionResponse evaluation */ + evaluation?: (string|null); + } + + /** Represents an EvaluateProcessorVersionResponse. */ + class EvaluateProcessorVersionResponse implements IEvaluateProcessorVersionResponse { + + /** + * Constructs a new EvaluateProcessorVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IEvaluateProcessorVersionResponse); + + /** EvaluateProcessorVersionResponse evaluation. */ + public evaluation: string; + + /** + * Creates a new EvaluateProcessorVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluateProcessorVersionResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IEvaluateProcessorVersionResponse): google.cloud.documentai.v1.EvaluateProcessorVersionResponse; + + /** + * Encodes the specified EvaluateProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionResponse.verify|verify} messages. + * @param message EvaluateProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IEvaluateProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluateProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionResponse.verify|verify} messages. + * @param message EvaluateProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IEvaluateProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluateProcessorVersionResponse + * @throws {Error} If the payload is not a 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.EvaluateProcessorVersionResponse; + + /** + * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluateProcessorVersionResponse + * @throws {Error} If the payload is 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.EvaluateProcessorVersionResponse; + + /** + * Verifies an EvaluateProcessorVersionResponse message. + * @param message Plain 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 EvaluateProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluateProcessorVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EvaluateProcessorVersionResponse; + + /** + * Creates a plain object from an EvaluateProcessorVersionResponse message. Also converts values to other types if specified. + * @param message EvaluateProcessorVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.EvaluateProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluateProcessorVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluateProcessorVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationRequest. */ + interface IGetEvaluationRequest { + + /** GetEvaluationRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationRequest. */ + class GetEvaluationRequest implements IGetEvaluationRequest { + + /** + * Constructs a new GetEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IGetEvaluationRequest); + + /** GetEvaluationRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IGetEvaluationRequest): google.cloud.documentai.v1.GetEvaluationRequest; + + /** + * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetEvaluationRequest.verify|verify} messages. + * @param message GetEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetEvaluationRequest.verify|verify} messages. + * @param message GetEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationRequest + * @throws {Error} If the payload is not a 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.GetEvaluationRequest; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationRequest + * @throws {Error} If the payload is 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.GetEvaluationRequest; + + /** + * Verifies a GetEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GetEvaluationRequest; + + /** + * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. + * @param message GetEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.GetEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationsRequest. */ + interface IListEvaluationsRequest { + + /** ListEvaluationsRequest parent */ + parent?: (string|null); + + /** ListEvaluationsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEvaluationsRequest. */ + class ListEvaluationsRequest implements IListEvaluationsRequest { + + /** + * Constructs a new ListEvaluationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IListEvaluationsRequest); + + /** ListEvaluationsRequest parent. */ + public parent: string; + + /** ListEvaluationsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEvaluationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationsRequest instance + */ + public static create(properties?: google.cloud.documentai.v1.IListEvaluationsRequest): google.cloud.documentai.v1.ListEvaluationsRequest; + + /** + * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsRequest.verify|verify} messages. + * @param message ListEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsRequest.verify|verify} messages. + * @param message ListEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationsRequest + * @throws {Error} If the payload is not a 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.ListEvaluationsRequest; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationsRequest + * @throws {Error} If the payload is 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.ListEvaluationsRequest; + + /** + * Verifies a ListEvaluationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListEvaluationsRequest; + + /** + * Creates a plain object from a ListEvaluationsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ListEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationsResponse. */ + interface IListEvaluationsResponse { + + /** ListEvaluationsResponse evaluations */ + evaluations?: (google.cloud.documentai.v1.IEvaluation[]|null); + + /** ListEvaluationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationsResponse. */ + class ListEvaluationsResponse implements IListEvaluationsResponse { + + /** + * Constructs a new ListEvaluationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IListEvaluationsResponse); + + /** ListEvaluationsResponse evaluations. */ + public evaluations: google.cloud.documentai.v1.IEvaluation[]; + + /** ListEvaluationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationsResponse instance + */ + public static create(properties?: google.cloud.documentai.v1.IListEvaluationsResponse): google.cloud.documentai.v1.ListEvaluationsResponse; + + /** + * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsResponse.verify|verify} messages. + * @param message ListEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsResponse.verify|verify} messages. + * @param message ListEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationsResponse + * @throws {Error} If the payload is not a 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.ListEvaluationsResponse; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationsResponse + * @throws {Error} If the payload is 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.ListEvaluationsResponse; + + /** + * Verifies a ListEvaluationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListEvaluationsResponse; + + /** + * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ListEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationsResponse + * @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 displayName */ + displayName?: (string|null); + + /** DocumentSchema description */ + description?: (string|null); + + /** DocumentSchema entityTypes */ + entityTypes?: (google.cloud.documentai.v1.DocumentSchema.IEntityType[]|null); + + /** DocumentSchema metadata */ + metadata?: (google.cloud.documentai.v1.DocumentSchema.IMetadata|null); + } + + /** Represents a DocumentSchema. */ + class DocumentSchema implements IDocumentSchema { + + /** + * Constructs a new DocumentSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IDocumentSchema); + + /** DocumentSchema displayName. */ + public displayName: string; + + /** DocumentSchema description. */ + public description: string; + + /** DocumentSchema entityTypes. */ + public entityTypes: google.cloud.documentai.v1.DocumentSchema.IEntityType[]; + + /** DocumentSchema metadata. */ + public metadata?: (google.cloud.documentai.v1.DocumentSchema.IMetadata|null); + + /** + * Creates a new DocumentSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentSchema instance + */ + public static create(properties?: google.cloud.documentai.v1.IDocumentSchema): google.cloud.documentai.v1.DocumentSchema; + + /** + * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.documentai.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.documentai.v1.IDocumentSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.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.documentai.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.documentai.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.documentai.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.documentai.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.documentai.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; + } + + namespace DocumentSchema { + + /** Properties of an EntityType. */ + interface IEntityType { + + /** EntityType enumValues */ + enumValues?: (google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues|null); + + /** EntityType displayName */ + displayName?: (string|null); + + /** EntityType name */ + name?: (string|null); + + /** EntityType baseTypes */ + baseTypes?: (string[]|null); + + /** EntityType properties */ + properties?: (google.cloud.documentai.v1.DocumentSchema.EntityType.IProperty[]|null); + } + + /** Represents an EntityType. */ + class EntityType implements IEntityType { + + /** + * Constructs a new EntityType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.DocumentSchema.IEntityType); + + /** EntityType enumValues. */ + public enumValues?: (google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues|null); + + /** EntityType displayName. */ + public displayName: string; + + /** EntityType name. */ + public name: string; + + /** EntityType baseTypes. */ + public baseTypes: string[]; + + /** EntityType properties. */ + public properties: google.cloud.documentai.v1.DocumentSchema.EntityType.IProperty[]; + + /** EntityType valueSource. */ + public valueSource?: "enumValues"; + + /** + * Creates a new EntityType instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityType instance + */ + public static create(properties?: google.cloud.documentai.v1.DocumentSchema.IEntityType): google.cloud.documentai.v1.DocumentSchema.EntityType; + + /** + * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.verify|verify} messages. + * @param message EntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.DocumentSchema.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.verify|verify} messages. + * @param message EntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.DocumentSchema.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityType + * @throws {Error} If the payload is not a 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.DocumentSchema.EntityType; + + /** + * Decodes an EntityType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityType + * @throws {Error} If the payload is 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.DocumentSchema.EntityType; + + /** + * Verifies an EntityType message. + * @param message Plain 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 EntityType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DocumentSchema.EntityType; + + /** + * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * @param message EntityType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DocumentSchema.EntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EntityType { + + /** Properties of an EnumValues. */ + interface IEnumValues { + + /** EnumValues values */ + values?: (string[]|null); + } + + /** Represents an EnumValues. */ + class EnumValues implements IEnumValues { + + /** + * Constructs a new EnumValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues); + + /** EnumValues values. */ + public values: string[]; + + /** + * Creates a new EnumValues instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValues instance + */ + public static create(properties?: google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues): google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues; + + /** + * Encodes the specified EnumValues message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.verify|verify} messages. + * @param message EnumValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValues message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.verify|verify} messages. + * @param message EnumValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValues + * @throws {Error} If the payload is not a 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.DocumentSchema.EntityType.EnumValues; + + /** + * Decodes an EnumValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValues + * @throws {Error} If the payload is 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.DocumentSchema.EntityType.EnumValues; + + /** + * Verifies an EnumValues message. + * @param message Plain 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 EnumValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues; + + /** + * Creates a plain object from an EnumValues message. Also converts values to other types if specified. + * @param message EnumValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValues + * @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 displayName */ + displayName?: (string|null); + + /** Property valueType */ + valueType?: (string|null); + + /** Property occurrenceType */ + occurrenceType?: (google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType|keyof typeof google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType|null); + + /** Property method */ + method?: (google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method|keyof typeof google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method|null); + } + + /** Represents a Property. */ + class Property implements IProperty { + + /** + * Constructs a new Property. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.DocumentSchema.EntityType.IProperty); + + /** Property name. */ + public name: string; + + /** Property displayName. */ + public displayName: string; + + /** Property valueType. */ + public valueType: string; + + /** Property occurrenceType. */ + public occurrenceType: (google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType|keyof typeof google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType); + + /** Property method. */ + public method: (google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method|keyof typeof google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method); + + /** + * Creates a new Property instance using the specified properties. + * @param [properties] Properties to set + * @returns Property instance + */ + public static create(properties?: google.cloud.documentai.v1.DocumentSchema.EntityType.IProperty): google.cloud.documentai.v1.DocumentSchema.EntityType.Property; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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; + } + + namespace Property { + + /** OccurrenceType enum. */ + enum OccurrenceType { + OCCURRENCE_TYPE_UNSPECIFIED = 0, + OPTIONAL_ONCE = 1, + OPTIONAL_MULTIPLE = 2, + REQUIRED_ONCE = 3, + REQUIRED_MULTIPLE = 4 + } + + /** Method enum. */ + enum Method { + METHOD_UNSPECIFIED = 0, + EXTRACT = 1, + DERIVE = 2 + } + } + } + + /** Properties of a Metadata. */ + interface IMetadata { + + /** Metadata documentSplitter */ + documentSplitter?: (boolean|null); + + /** Metadata documentAllowMultipleLabels */ + documentAllowMultipleLabels?: (boolean|null); + + /** Metadata prefixedNamingOnProperties */ + prefixedNamingOnProperties?: (boolean|null); + + /** Metadata skipNamingValidation */ + skipNamingValidation?: (boolean|null); + } + + /** Represents a Metadata. */ + class Metadata implements IMetadata { + + /** + * Constructs a new Metadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.DocumentSchema.IMetadata); + + /** Metadata documentSplitter. */ + public documentSplitter: boolean; + + /** Metadata documentAllowMultipleLabels. */ + public documentAllowMultipleLabels: boolean; + + /** Metadata prefixedNamingOnProperties. */ + public prefixedNamingOnProperties: boolean; + + /** Metadata skipNamingValidation. */ + public skipNamingValidation: boolean; + + /** + * Creates a new Metadata instance using the specified properties. + * @param [properties] Properties to set + * @returns Metadata instance + */ + public static create(properties?: google.cloud.documentai.v1.DocumentSchema.IMetadata): google.cloud.documentai.v1.DocumentSchema.Metadata; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.DocumentSchema.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.DocumentSchema.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metadata + * @throws {Error} If the payload is not a 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.DocumentSchema.Metadata; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metadata + * @throws {Error} If the payload is 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.DocumentSchema.Metadata; + + /** + * Verifies a Metadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DocumentSchema.Metadata; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @param message Metadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.DocumentSchema.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EvaluationReference. */ + interface IEvaluationReference { + + /** EvaluationReference operation */ + operation?: (string|null); + + /** EvaluationReference evaluation */ + evaluation?: (string|null); + + /** EvaluationReference aggregateMetrics */ + aggregateMetrics?: (google.cloud.documentai.v1.Evaluation.IMetrics|null); + + /** EvaluationReference aggregateMetricsExact */ + aggregateMetricsExact?: (google.cloud.documentai.v1.Evaluation.IMetrics|null); + } + + /** Represents an EvaluationReference. */ + class EvaluationReference implements IEvaluationReference { + + /** + * Constructs a new EvaluationReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IEvaluationReference); + + /** EvaluationReference operation. */ + public operation: string; + + /** EvaluationReference evaluation. */ + public evaluation: string; + + /** EvaluationReference aggregateMetrics. */ + public aggregateMetrics?: (google.cloud.documentai.v1.Evaluation.IMetrics|null); + + /** EvaluationReference aggregateMetricsExact. */ + public aggregateMetricsExact?: (google.cloud.documentai.v1.Evaluation.IMetrics|null); + + /** + * Creates a new EvaluationReference instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationReference instance + */ + public static create(properties?: google.cloud.documentai.v1.IEvaluationReference): google.cloud.documentai.v1.EvaluationReference; + + /** + * Encodes the specified EvaluationReference message. Does not implicitly {@link google.cloud.documentai.v1.EvaluationReference.verify|verify} messages. + * @param message EvaluationReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IEvaluationReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationReference message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluationReference.verify|verify} messages. + * @param message EvaluationReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IEvaluationReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationReference + * @throws {Error} If the payload is not a 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.EvaluationReference; + + /** + * Decodes an EvaluationReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationReference + * @throws {Error} If the payload is 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.EvaluationReference; + + /** + * Verifies an EvaluationReference message. + * @param message Plain 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 EvaluationReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EvaluationReference; + + /** + * Creates a plain object from an EvaluationReference message. Also converts values to other types if specified. + * @param message EvaluationReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.EvaluationReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Evaluation. */ + interface IEvaluation { + + /** Evaluation name */ + name?: (string|null); + + /** Evaluation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation documentCounters */ + documentCounters?: (google.cloud.documentai.v1.Evaluation.ICounters|null); + + /** Evaluation allEntitiesMetrics */ + allEntitiesMetrics?: (google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics|null); + + /** Evaluation entityMetrics */ + entityMetrics?: ({ [k: string]: google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics }|null); + + /** Evaluation kmsKeyName */ + kmsKeyName?: (string|null); + + /** Evaluation kmsKeyVersionName */ + kmsKeyVersionName?: (string|null); + } + + /** Represents an Evaluation. */ + class Evaluation implements IEvaluation { + + /** + * Constructs a new Evaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IEvaluation); + + /** Evaluation name. */ + public name: string; + + /** Evaluation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation documentCounters. */ + public documentCounters?: (google.cloud.documentai.v1.Evaluation.ICounters|null); + + /** Evaluation allEntitiesMetrics. */ + public allEntitiesMetrics?: (google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics|null); + + /** Evaluation entityMetrics. */ + public entityMetrics: { [k: string]: google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics }; + + /** Evaluation kmsKeyName. */ + public kmsKeyName: string; + + /** Evaluation kmsKeyVersionName. */ + public kmsKeyVersionName: string; + + /** + * Creates a new Evaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns Evaluation instance + */ + public static create(properties?: google.cloud.documentai.v1.IEvaluation): google.cloud.documentai.v1.Evaluation; + + /** + * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.verify|verify} messages. + * @param message Evaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.verify|verify} messages. + * @param message Evaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Evaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Evaluation + * @throws {Error} If the payload is not a 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.Evaluation; + + /** + * Decodes an Evaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Evaluation + * @throws {Error} If the payload is 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.Evaluation; + + /** + * Verifies an Evaluation message. + * @param message Plain 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 Evaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Evaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Evaluation; + + /** + * Creates a plain object from an Evaluation message. Also converts values to other types if specified. + * @param message Evaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Evaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Evaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Evaluation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Evaluation { + + /** Properties of a Counters. */ + interface ICounters { + + /** Counters inputDocumentsCount */ + inputDocumentsCount?: (number|null); + + /** Counters invalidDocumentsCount */ + invalidDocumentsCount?: (number|null); + + /** Counters failedDocumentsCount */ + failedDocumentsCount?: (number|null); + + /** Counters evaluatedDocumentsCount */ + evaluatedDocumentsCount?: (number|null); + } + + /** Represents a Counters. */ + class Counters implements ICounters { + + /** + * Constructs a new Counters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Evaluation.ICounters); + + /** Counters inputDocumentsCount. */ + public inputDocumentsCount: number; + + /** Counters invalidDocumentsCount. */ + public invalidDocumentsCount: number; + + /** Counters failedDocumentsCount. */ + public failedDocumentsCount: number; + + /** Counters evaluatedDocumentsCount. */ + public evaluatedDocumentsCount: number; + + /** + * Creates a new Counters instance using the specified properties. + * @param [properties] Properties to set + * @returns Counters instance + */ + public static create(properties?: google.cloud.documentai.v1.Evaluation.ICounters): google.cloud.documentai.v1.Evaluation.Counters; + + /** + * Encodes the specified Counters message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Counters.verify|verify} messages. + * @param message Counters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Evaluation.ICounters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Counters message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Counters.verify|verify} messages. + * @param message Counters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Evaluation.ICounters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Counters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Counters + * @throws {Error} If the payload is not a 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.Evaluation.Counters; + + /** + * Decodes a Counters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Counters + * @throws {Error} If the payload is 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.Evaluation.Counters; + + /** + * Verifies a Counters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Counters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Counters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Evaluation.Counters; + + /** + * Creates a plain object from a Counters message. Also converts values to other types if specified. + * @param message Counters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Evaluation.Counters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Counters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Counters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Metrics. */ + interface IMetrics { + + /** Metrics precision */ + precision?: (number|null); + + /** Metrics recall */ + recall?: (number|null); + + /** Metrics f1Score */ + f1Score?: (number|null); + + /** Metrics predictedOccurrencesCount */ + predictedOccurrencesCount?: (number|null); + + /** Metrics groundTruthOccurrencesCount */ + groundTruthOccurrencesCount?: (number|null); + + /** Metrics predictedDocumentCount */ + predictedDocumentCount?: (number|null); + + /** Metrics groundTruthDocumentCount */ + groundTruthDocumentCount?: (number|null); + + /** Metrics truePositivesCount */ + truePositivesCount?: (number|null); + + /** Metrics falsePositivesCount */ + falsePositivesCount?: (number|null); + + /** Metrics falseNegativesCount */ + falseNegativesCount?: (number|null); + + /** Metrics totalDocumentsCount */ + totalDocumentsCount?: (number|null); + } + + /** Represents a Metrics. */ + class Metrics implements IMetrics { + + /** + * Constructs a new Metrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Evaluation.IMetrics); + + /** Metrics precision. */ + public precision: number; + + /** Metrics recall. */ + public recall: number; + + /** Metrics f1Score. */ + public f1Score: number; + + /** Metrics predictedOccurrencesCount. */ + public predictedOccurrencesCount: number; + + /** Metrics groundTruthOccurrencesCount. */ + public groundTruthOccurrencesCount: number; + + /** Metrics predictedDocumentCount. */ + public predictedDocumentCount: number; + + /** Metrics groundTruthDocumentCount. */ + public groundTruthDocumentCount: number; + + /** Metrics truePositivesCount. */ + public truePositivesCount: number; + + /** Metrics falsePositivesCount. */ + public falsePositivesCount: number; + + /** Metrics falseNegativesCount. */ + public falseNegativesCount: number; + + /** Metrics totalDocumentsCount. */ + public totalDocumentsCount: number; + + /** + * Creates a new Metrics instance using the specified properties. + * @param [properties] Properties to set + * @returns Metrics instance + */ + public static create(properties?: google.cloud.documentai.v1.Evaluation.IMetrics): google.cloud.documentai.v1.Evaluation.Metrics; + + /** + * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Metrics.verify|verify} messages. + * @param message Metrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Evaluation.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Metrics.verify|verify} messages. + * @param message Metrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Evaluation.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metrics + * @throws {Error} If the payload is not a 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.Evaluation.Metrics; + + /** + * Decodes a Metrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metrics + * @throws {Error} If the payload is 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.Evaluation.Metrics; + + /** + * Verifies a Metrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Evaluation.Metrics; + + /** + * Creates a plain object from a Metrics message. Also converts values to other types if specified. + * @param message Metrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Evaluation.Metrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfidenceLevelMetrics. */ + interface IConfidenceLevelMetrics { + + /** ConfidenceLevelMetrics confidenceLevel */ + confidenceLevel?: (number|null); + + /** ConfidenceLevelMetrics metrics */ + metrics?: (google.cloud.documentai.v1.Evaluation.IMetrics|null); + } + + /** Represents a ConfidenceLevelMetrics. */ + class ConfidenceLevelMetrics implements IConfidenceLevelMetrics { + + /** + * Constructs a new ConfidenceLevelMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics); + + /** ConfidenceLevelMetrics confidenceLevel. */ + public confidenceLevel: number; + + /** ConfidenceLevelMetrics metrics. */ + public metrics?: (google.cloud.documentai.v1.Evaluation.IMetrics|null); + + /** + * Creates a new ConfidenceLevelMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceLevelMetrics instance + */ + public static create(properties?: google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics): google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics; + + /** + * Encodes the specified ConfidenceLevelMetrics message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. + * @param message ConfidenceLevelMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceLevelMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. + * @param message ConfidenceLevelMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceLevelMetrics + * @throws {Error} If the payload is not a 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.Evaluation.ConfidenceLevelMetrics; + + /** + * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceLevelMetrics + * @throws {Error} If the payload is 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.Evaluation.ConfidenceLevelMetrics; + + /** + * Verifies a ConfidenceLevelMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidenceLevelMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceLevelMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics; + + /** + * Creates a plain object from a ConfidenceLevelMetrics message. Also converts values to other types if specified. + * @param message ConfidenceLevelMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceLevelMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidenceLevelMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MultiConfidenceMetrics. */ + interface IMultiConfidenceMetrics { + + /** MultiConfidenceMetrics confidenceLevelMetrics */ + confidenceLevelMetrics?: (google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics[]|null); + + /** MultiConfidenceMetrics confidenceLevelMetricsExact */ + confidenceLevelMetricsExact?: (google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics[]|null); + + /** MultiConfidenceMetrics auprc */ + auprc?: (number|null); + + /** MultiConfidenceMetrics estimatedCalibrationError */ + estimatedCalibrationError?: (number|null); + + /** MultiConfidenceMetrics auprcExact */ + auprcExact?: (number|null); + + /** MultiConfidenceMetrics estimatedCalibrationErrorExact */ + estimatedCalibrationErrorExact?: (number|null); + + /** MultiConfidenceMetrics metricsType */ + metricsType?: (google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType|keyof typeof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType|null); + } + + /** Represents a MultiConfidenceMetrics. */ + class MultiConfidenceMetrics implements IMultiConfidenceMetrics { + + /** + * Constructs a new MultiConfidenceMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics); + + /** MultiConfidenceMetrics confidenceLevelMetrics. */ + public confidenceLevelMetrics: google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics[]; + + /** MultiConfidenceMetrics confidenceLevelMetricsExact. */ + public confidenceLevelMetricsExact: google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics[]; + + /** MultiConfidenceMetrics auprc. */ + public auprc: number; + + /** MultiConfidenceMetrics estimatedCalibrationError. */ + public estimatedCalibrationError: number; + + /** MultiConfidenceMetrics auprcExact. */ + public auprcExact: number; + + /** MultiConfidenceMetrics estimatedCalibrationErrorExact. */ + public estimatedCalibrationErrorExact: number; + + /** MultiConfidenceMetrics metricsType. */ + public metricsType: (google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType|keyof typeof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType); + + /** + * Creates a new MultiConfidenceMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiConfidenceMetrics instance + */ + public static create(properties?: google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics): google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics; + + /** + * Encodes the specified MultiConfidenceMetrics message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.verify|verify} messages. + * @param message MultiConfidenceMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiConfidenceMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.verify|verify} messages. + * @param message MultiConfidenceMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiConfidenceMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiConfidenceMetrics + * @throws {Error} If the payload is not a 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.Evaluation.MultiConfidenceMetrics; + + /** + * Decodes a MultiConfidenceMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiConfidenceMetrics + * @throws {Error} If the payload is 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.Evaluation.MultiConfidenceMetrics; + + /** + * Verifies a MultiConfidenceMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MultiConfidenceMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiConfidenceMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics; + + /** + * Creates a plain object from a MultiConfidenceMetrics message. Also converts values to other types if specified. + * @param message MultiConfidenceMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiConfidenceMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiConfidenceMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MultiConfidenceMetrics { + + /** MetricsType enum. */ + enum MetricsType { + METRICS_TYPE_UNSPECIFIED = 0, + AGGREGATE = 1 + } + } + } + + /** Properties of a CommonOperationMetadata. */ + interface ICommonOperationMetadata { + + /** CommonOperationMetadata state */ + state?: (google.cloud.documentai.v1.CommonOperationMetadata.State|keyof typeof google.cloud.documentai.v1.CommonOperationMetadata.State|null); + + /** CommonOperationMetadata stateMessage */ + stateMessage?: (string|null); + + /** CommonOperationMetadata resource */ + resource?: (string|null); + + /** CommonOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CommonOperationMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CommonOperationMetadata. */ + class CommonOperationMetadata implements ICommonOperationMetadata { + + /** + * Constructs a new CommonOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ICommonOperationMetadata); + + /** CommonOperationMetadata state. */ + public state: (google.cloud.documentai.v1.CommonOperationMetadata.State|keyof typeof google.cloud.documentai.v1.CommonOperationMetadata.State); + + /** CommonOperationMetadata stateMessage. */ + public stateMessage: string; + + /** CommonOperationMetadata resource. */ + public resource: string; + + /** CommonOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CommonOperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CommonOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonOperationMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1.ICommonOperationMetadata): google.cloud.documentai.v1.CommonOperationMetadata; + + /** + * Encodes the specified CommonOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1.CommonOperationMetadata.verify|verify} messages. + * @param message CommonOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ICommonOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.CommonOperationMetadata.verify|verify} messages. + * @param message CommonOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ICommonOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonOperationMetadata + * @throws {Error} If the payload is not a 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.CommonOperationMetadata; + + /** + * Decodes a CommonOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonOperationMetadata + * @throws {Error} If the payload is 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.CommonOperationMetadata; + + /** + * Verifies a CommonOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.CommonOperationMetadata; + + /** + * Creates a plain object from a CommonOperationMetadata message. Also converts values to other types if specified. + * @param message CommonOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.CommonOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CommonOperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + CANCELLING = 2, + SUCCEEDED = 3, + FAILED = 4, + CANCELLED = 5 + } + } + + /** Properties of a ProcessorVersion. */ + interface IProcessorVersion { + + /** ProcessorVersion name */ + name?: (string|null); + + /** ProcessorVersion displayName */ + displayName?: (string|null); + + /** ProcessorVersion documentSchema */ + documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); + + /** ProcessorVersion state */ + state?: (google.cloud.documentai.v1.ProcessorVersion.State|keyof typeof google.cloud.documentai.v1.ProcessorVersion.State|null); + + /** ProcessorVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ProcessorVersion latestEvaluation */ + latestEvaluation?: (google.cloud.documentai.v1.IEvaluationReference|null); + + /** ProcessorVersion kmsKeyName */ + kmsKeyName?: (string|null); + + /** ProcessorVersion kmsKeyVersionName */ + kmsKeyVersionName?: (string|null); + + /** ProcessorVersion googleManaged */ + googleManaged?: (boolean|null); + + /** ProcessorVersion deprecationInfo */ + deprecationInfo?: (google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo|null); + + /** ProcessorVersion modelType */ + modelType?: (google.cloud.documentai.v1.ProcessorVersion.ModelType|keyof typeof google.cloud.documentai.v1.ProcessorVersion.ModelType|null); + + /** ProcessorVersion satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** ProcessorVersion satisfiesPzi */ + satisfiesPzi?: (boolean|null); + + /** ProcessorVersion genAiModelInfo */ + genAiModelInfo?: (google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo|null); + } + + /** Represents a ProcessorVersion. */ + class ProcessorVersion implements IProcessorVersion { + + /** + * Constructs a new ProcessorVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IProcessorVersion); + + /** ProcessorVersion name. */ + public name: string; + + /** ProcessorVersion displayName. */ + public displayName: string; + + /** ProcessorVersion documentSchema. */ + public documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); + + /** ProcessorVersion state. */ + public state: (google.cloud.documentai.v1.ProcessorVersion.State|keyof typeof google.cloud.documentai.v1.ProcessorVersion.State); + + /** ProcessorVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ProcessorVersion latestEvaluation. */ + public latestEvaluation?: (google.cloud.documentai.v1.IEvaluationReference|null); + + /** ProcessorVersion kmsKeyName. */ + public kmsKeyName: string; + + /** ProcessorVersion kmsKeyVersionName. */ + public kmsKeyVersionName: string; + + /** ProcessorVersion googleManaged. */ + public googleManaged: boolean; + + /** ProcessorVersion deprecationInfo. */ + public deprecationInfo?: (google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo|null); + + /** ProcessorVersion modelType. */ + public modelType: (google.cloud.documentai.v1.ProcessorVersion.ModelType|keyof typeof google.cloud.documentai.v1.ProcessorVersion.ModelType); + + /** ProcessorVersion satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** ProcessorVersion satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** ProcessorVersion genAiModelInfo. */ + public genAiModelInfo?: (google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo|null); + + /** + * Creates a new ProcessorVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessorVersion instance + */ + public static create(properties?: google.cloud.documentai.v1.IProcessorVersion): google.cloud.documentai.v1.ProcessorVersion; + + /** + * Encodes the specified ProcessorVersion message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.verify|verify} messages. + * @param message ProcessorVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IProcessorVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessorVersion message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.verify|verify} messages. + * @param message ProcessorVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IProcessorVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessorVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessorVersion + * @throws {Error} If the payload is not a 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.ProcessorVersion; + + /** + * Decodes a ProcessorVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessorVersion + * @throws {Error} If the payload is 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.ProcessorVersion; + + /** + * Verifies a ProcessorVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessorVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessorVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersion; + + /** + * Creates a plain object from a ProcessorVersion message. Also converts values to other types if specified. + * @param message ProcessorVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessorVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessorVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessorVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ProcessorVersion { + + /** Properties of a DeprecationInfo. */ + interface IDeprecationInfo { + + /** DeprecationInfo deprecationTime */ + deprecationTime?: (google.protobuf.ITimestamp|null); + + /** DeprecationInfo replacementProcessorVersion */ + replacementProcessorVersion?: (string|null); + } + + /** Represents a DeprecationInfo. */ + class DeprecationInfo implements IDeprecationInfo { + + /** + * Constructs a new DeprecationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo); + + /** DeprecationInfo deprecationTime. */ + public deprecationTime?: (google.protobuf.ITimestamp|null); + + /** DeprecationInfo replacementProcessorVersion. */ + public replacementProcessorVersion: string; + + /** + * Creates a new DeprecationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DeprecationInfo instance + */ + public static create(properties?: google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo): google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo; + + /** + * Encodes the specified DeprecationInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.verify|verify} messages. + * @param message DeprecationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeprecationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.verify|verify} messages. + * @param message DeprecationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeprecationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeprecationInfo + * @throws {Error} If the payload is not a 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.ProcessorVersion.DeprecationInfo; + + /** + * Decodes a DeprecationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeprecationInfo + * @throws {Error} If the payload is 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.ProcessorVersion.DeprecationInfo; + + /** + * Verifies a DeprecationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeprecationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeprecationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo; + + /** + * Creates a plain object from a DeprecationInfo message. Also converts values to other types if specified. + * @param message DeprecationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeprecationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeprecationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenAiModelInfo. */ + interface IGenAiModelInfo { + + /** GenAiModelInfo foundationGenAiModelInfo */ + foundationGenAiModelInfo?: (google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null); + + /** GenAiModelInfo customGenAiModelInfo */ + customGenAiModelInfo?: (google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null); + } + + /** Represents a GenAiModelInfo. */ + class GenAiModelInfo implements IGenAiModelInfo { + + /** + * Constructs a new GenAiModelInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo); + + /** GenAiModelInfo foundationGenAiModelInfo. */ + public foundationGenAiModelInfo?: (google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null); + + /** GenAiModelInfo customGenAiModelInfo. */ + public customGenAiModelInfo?: (google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null); + + /** GenAiModelInfo modelInfo. */ + public modelInfo?: ("foundationGenAiModelInfo"|"customGenAiModelInfo"); + + /** + * Creates a new GenAiModelInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GenAiModelInfo instance + */ + public static create(properties?: google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo): google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo; + + /** + * Encodes the specified GenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.verify|verify} messages. + * @param message GenAiModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.verify|verify} messages. + * @param message GenAiModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenAiModelInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenAiModelInfo + * @throws {Error} If the payload is not a 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.ProcessorVersion.GenAiModelInfo; + + /** + * Decodes a GenAiModelInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenAiModelInfo + * @throws {Error} If the payload is 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.ProcessorVersion.GenAiModelInfo; + + /** + * Verifies a GenAiModelInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenAiModelInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenAiModelInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo; + + /** + * Creates a plain object from a GenAiModelInfo message. Also converts values to other types if specified. + * @param message GenAiModelInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenAiModelInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenAiModelInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenAiModelInfo { + + /** Properties of a FoundationGenAiModelInfo. */ + interface IFoundationGenAiModelInfo { + + /** FoundationGenAiModelInfo finetuningAllowed */ + finetuningAllowed?: (boolean|null); + + /** FoundationGenAiModelInfo minTrainLabeledDocuments */ + minTrainLabeledDocuments?: (number|null); + } + + /** Represents a FoundationGenAiModelInfo. */ + class FoundationGenAiModelInfo implements IFoundationGenAiModelInfo { + + /** + * Constructs a new FoundationGenAiModelInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo); + + /** FoundationGenAiModelInfo finetuningAllowed. */ + public finetuningAllowed: boolean; + + /** FoundationGenAiModelInfo minTrainLabeledDocuments. */ + public minTrainLabeledDocuments: number; + + /** + * Creates a new FoundationGenAiModelInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FoundationGenAiModelInfo instance + */ + public static create(properties?: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo): google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; + + /** + * Encodes the specified FoundationGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. + * @param message FoundationGenAiModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FoundationGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. + * @param message FoundationGenAiModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FoundationGenAiModelInfo + * @throws {Error} If the payload is not a 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.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; + + /** + * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FoundationGenAiModelInfo + * @throws {Error} If the payload is 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.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; + + /** + * Verifies a FoundationGenAiModelInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FoundationGenAiModelInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FoundationGenAiModelInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; + + /** + * Creates a plain object from a FoundationGenAiModelInfo message. Also converts values to other types if specified. + * @param message FoundationGenAiModelInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FoundationGenAiModelInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FoundationGenAiModelInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomGenAiModelInfo. */ + interface ICustomGenAiModelInfo { + + /** CustomGenAiModelInfo customModelType */ + customModelType?: (google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|keyof typeof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|null); + + /** CustomGenAiModelInfo baseProcessorVersionId */ + baseProcessorVersionId?: (string|null); + } + + /** Represents a CustomGenAiModelInfo. */ + class CustomGenAiModelInfo implements ICustomGenAiModelInfo { + + /** + * Constructs a new CustomGenAiModelInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo); + + /** CustomGenAiModelInfo customModelType. */ + public customModelType: (google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|keyof typeof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType); + + /** CustomGenAiModelInfo baseProcessorVersionId. */ + public baseProcessorVersionId: string; + + /** + * Creates a new CustomGenAiModelInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomGenAiModelInfo instance + */ + public static create(properties?: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo): google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; + + /** + * Encodes the specified CustomGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. + * @param message CustomGenAiModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. + * @param message CustomGenAiModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomGenAiModelInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomGenAiModelInfo + * @throws {Error} If the payload is not a 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.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; + + /** + * Decodes a CustomGenAiModelInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomGenAiModelInfo + * @throws {Error} If the payload is 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.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; + + /** + * Verifies a CustomGenAiModelInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomGenAiModelInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomGenAiModelInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; + + /** + * Creates a plain object from a CustomGenAiModelInfo message. Also converts values to other types if specified. + * @param message CustomGenAiModelInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomGenAiModelInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomGenAiModelInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomGenAiModelInfo { + + /** CustomModelType enum. */ + enum CustomModelType { + CUSTOM_MODEL_TYPE_UNSPECIFIED = 0, + VERSIONED_FOUNDATION = 1, + FINE_TUNED = 2 + } + } + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + DEPLOYED = 1, + DEPLOYING = 2, + UNDEPLOYED = 3, + UNDEPLOYING = 4, + CREATING = 5, + DELETING = 6, + FAILED = 7, + IMPORTING = 8 + } + + /** ModelType enum. */ + enum ModelType { + MODEL_TYPE_UNSPECIFIED = 0, + MODEL_TYPE_GENERATIVE = 1, + MODEL_TYPE_CUSTOM = 2 + } + } + + /** Properties of a ProcessorVersionAlias. */ + interface IProcessorVersionAlias { + + /** ProcessorVersionAlias alias */ + alias?: (string|null); + + /** ProcessorVersionAlias processorVersion */ + processorVersion?: (string|null); + } + + /** Represents a ProcessorVersionAlias. */ + class ProcessorVersionAlias implements IProcessorVersionAlias { + + /** + * Constructs a new ProcessorVersionAlias. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IProcessorVersionAlias); + + /** ProcessorVersionAlias alias. */ + public alias: string; + + /** ProcessorVersionAlias processorVersion. */ + public processorVersion: string; + + /** + * Creates a new ProcessorVersionAlias instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessorVersionAlias instance + */ + public static create(properties?: google.cloud.documentai.v1.IProcessorVersionAlias): google.cloud.documentai.v1.ProcessorVersionAlias; + + /** + * Encodes the specified ProcessorVersionAlias message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersionAlias.verify|verify} messages. + * @param message ProcessorVersionAlias message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IProcessorVersionAlias, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessorVersionAlias message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersionAlias.verify|verify} messages. + * @param message ProcessorVersionAlias message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IProcessorVersionAlias, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessorVersionAlias message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessorVersionAlias + * @throws {Error} If the payload is not a 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.ProcessorVersionAlias; + + /** + * Decodes a ProcessorVersionAlias message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessorVersionAlias + * @throws {Error} If the payload is 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.ProcessorVersionAlias; + + /** + * Verifies a ProcessorVersionAlias message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessorVersionAlias message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessorVersionAlias + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersionAlias; + + /** + * Creates a plain object from a ProcessorVersionAlias message. Also converts values to other types if specified. + * @param message ProcessorVersionAlias + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessorVersionAlias, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessorVersionAlias to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessorVersionAlias + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Processor. */ + interface IProcessor { + + /** Processor name */ + name?: (string|null); + + /** Processor type */ + type?: (string|null); + + /** Processor displayName */ + displayName?: (string|null); + + /** Processor state */ + state?: (google.cloud.documentai.v1.Processor.State|keyof typeof google.cloud.documentai.v1.Processor.State|null); + + /** Processor defaultProcessorVersion */ + defaultProcessorVersion?: (string|null); + + /** Processor processorVersionAliases */ + processorVersionAliases?: (google.cloud.documentai.v1.IProcessorVersionAlias[]|null); + + /** Processor processEndpoint */ + processEndpoint?: (string|null); + + /** Processor createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Processor kmsKeyName */ + kmsKeyName?: (string|null); + + /** Processor satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Processor satisfiesPzi */ + satisfiesPzi?: (boolean|null); + } + + /** Represents a Processor. */ + class Processor implements IProcessor { + + /** + * Constructs a new Processor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IProcessor); + + /** Processor name. */ + public name: string; + + /** Processor type. */ + public type: string; + + /** Processor displayName. */ + public displayName: string; + + /** Processor state. */ + public state: (google.cloud.documentai.v1.Processor.State|keyof typeof google.cloud.documentai.v1.Processor.State); + + /** Processor defaultProcessorVersion. */ + public defaultProcessorVersion: string; + + /** Processor processorVersionAliases. */ + public processorVersionAliases: google.cloud.documentai.v1.IProcessorVersionAlias[]; + + /** Processor processEndpoint. */ + public processEndpoint: string; + + /** Processor createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Processor kmsKeyName. */ + public kmsKeyName: string; + + /** Processor satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Processor satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** + * Creates a new Processor instance using the specified properties. + * @param [properties] Properties to set + * @returns Processor instance + */ + public static create(properties?: google.cloud.documentai.v1.IProcessor): google.cloud.documentai.v1.Processor; + + /** + * Encodes the specified Processor message. Does not implicitly {@link google.cloud.documentai.v1.Processor.verify|verify} messages. + * @param message Processor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IProcessor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Processor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Processor.verify|verify} messages. + * @param message Processor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IProcessor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Processor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Processor + * @throws {Error} If the payload is not a 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.Processor; + + /** + * Decodes a Processor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Processor + * @throws {Error} If the payload is 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.Processor; + + /** + * Verifies a Processor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Processor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Processor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Processor; + + /** + * Creates a plain object from a Processor message. Also converts values to other types if specified. + * @param message Processor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.Processor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Processor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Processor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Processor { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2, + ENABLING = 3, + DISABLING = 4, + CREATING = 5, + FAILED = 6, + DELETING = 7 + } + } + + /** Properties of a ProcessorType. */ + interface IProcessorType { + + /** ProcessorType name */ + name?: (string|null); + + /** ProcessorType type */ + type?: (string|null); + + /** ProcessorType category */ + category?: (string|null); + + /** ProcessorType availableLocations */ + availableLocations?: (google.cloud.documentai.v1.ProcessorType.ILocationInfo[]|null); + + /** ProcessorType allowCreation */ + allowCreation?: (boolean|null); + + /** ProcessorType launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ProcessorType sampleDocumentUris */ + sampleDocumentUris?: (string[]|null); + } + + /** Represents a ProcessorType. */ + class ProcessorType implements IProcessorType { + + /** + * Constructs a new ProcessorType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.IProcessorType); + + /** ProcessorType name. */ + public name: string; + + /** ProcessorType type. */ + public type: string; + + /** ProcessorType category. */ + public category: string; + + /** ProcessorType availableLocations. */ + public availableLocations: google.cloud.documentai.v1.ProcessorType.ILocationInfo[]; + + /** ProcessorType allowCreation. */ + public allowCreation: boolean; + + /** ProcessorType launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ProcessorType sampleDocumentUris. */ + public sampleDocumentUris: string[]; + + /** + * Creates a new ProcessorType instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessorType instance + */ + public static create(properties?: google.cloud.documentai.v1.IProcessorType): google.cloud.documentai.v1.ProcessorType; + + /** + * Encodes the specified ProcessorType message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.verify|verify} messages. + * @param message ProcessorType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.IProcessorType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessorType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.verify|verify} messages. + * @param message ProcessorType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.IProcessorType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessorType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessorType + * @throws {Error} If the payload is not a 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.ProcessorType; + + /** + * Decodes a ProcessorType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessorType + * @throws {Error} If the payload is 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.ProcessorType; + + /** + * Verifies a ProcessorType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessorType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessorType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorType; + + /** + * Creates a plain object from a ProcessorType message. Also converts values to other types if specified. + * @param message ProcessorType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessorType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessorType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessorType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ProcessorType { + + /** Properties of a LocationInfo. */ + interface ILocationInfo { + + /** LocationInfo locationId */ + locationId?: (string|null); + } + + /** Represents a LocationInfo. */ + class LocationInfo implements ILocationInfo { + + /** + * Constructs a new LocationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1.ProcessorType.ILocationInfo); + + /** LocationInfo locationId. */ + public locationId: string; + + /** + * Creates a new LocationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationInfo instance + */ + public static create(properties?: google.cloud.documentai.v1.ProcessorType.ILocationInfo): google.cloud.documentai.v1.ProcessorType.LocationInfo; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1.ProcessorType.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1.ProcessorType.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationInfo + * @throws {Error} If the payload is not a 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.ProcessorType.LocationInfo; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationInfo + * @throws {Error} If the payload is 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.ProcessorType.LocationInfo; + + /** + * Verifies a LocationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorType.LocationInfo; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @param message LocationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1.ProcessorType.LocationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace v1beta3. */ + namespace v1beta3 { + + /** 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.v1beta3.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.v1beta3.IBarcode): google.cloud.documentai.v1beta3.Barcode; + + /** + * Encodes the specified Barcode message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.IBarcode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Barcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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 Dataset. */ + interface IDataset { + + /** Dataset gcsManagedConfig */ + gcsManagedConfig?: (google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig|null); + + /** Dataset documentWarehouseConfig */ + documentWarehouseConfig?: (google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig|null); + + /** Dataset unmanagedDatasetConfig */ + unmanagedDatasetConfig?: (google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null); + + /** Dataset name */ + name?: (string|null); + + /** Dataset state */ + state?: (google.cloud.documentai.v1beta3.Dataset.State|keyof typeof google.cloud.documentai.v1beta3.Dataset.State|null); + + /** Dataset satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Dataset satisfiesPzi */ + satisfiesPzi?: (boolean|null); + } + + /** Represents a Dataset. */ + class Dataset implements IDataset { + + /** + * Constructs a new Dataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDataset); + + /** Dataset gcsManagedConfig. */ + public gcsManagedConfig?: (google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig|null); + + /** Dataset documentWarehouseConfig. */ + public documentWarehouseConfig?: (google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig|null); + + /** Dataset unmanagedDatasetConfig. */ + public unmanagedDatasetConfig?: (google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null); + + /** Dataset name. */ + public name: string; + + /** Dataset state. */ + public state: (google.cloud.documentai.v1beta3.Dataset.State|keyof typeof google.cloud.documentai.v1beta3.Dataset.State); + + /** Dataset satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Dataset satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** Dataset storageSource. */ + public storageSource?: ("gcsManagedConfig"|"documentWarehouseConfig"|"unmanagedDatasetConfig"); + + /** + * Creates a new Dataset instance using the specified properties. + * @param [properties] Properties to set + * @returns Dataset instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDataset): google.cloud.documentai.v1beta3.Dataset; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dataset + * @throws {Error} If the payload is not a 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.v1beta3.Dataset; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dataset + * @throws {Error} If the payload is 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.v1beta3.Dataset; + + /** + * Verifies a Dataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Dataset; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @param message Dataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Dataset { + + /** Properties of a GCSManagedConfig. */ + interface IGCSManagedConfig { + + /** GCSManagedConfig gcsPrefix */ + gcsPrefix?: (google.cloud.documentai.v1beta3.IGcsPrefix|null); + } + + /** Represents a GCSManagedConfig. */ + class GCSManagedConfig implements IGCSManagedConfig { + + /** + * Constructs a new GCSManagedConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig); + + /** GCSManagedConfig gcsPrefix. */ + public gcsPrefix?: (google.cloud.documentai.v1beta3.IGcsPrefix|null); + + /** + * Creates a new GCSManagedConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GCSManagedConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig): google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig; + + /** + * Encodes the specified GCSManagedConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.verify|verify} messages. + * @param message GCSManagedConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GCSManagedConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.verify|verify} messages. + * @param message GCSManagedConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GCSManagedConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GCSManagedConfig + * @throws {Error} If the payload is not a 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.v1beta3.Dataset.GCSManagedConfig; + + /** + * Decodes a GCSManagedConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GCSManagedConfig + * @throws {Error} If the payload is 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.v1beta3.Dataset.GCSManagedConfig; + + /** + * Verifies a GCSManagedConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GCSManagedConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GCSManagedConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig; + + /** + * Creates a plain object from a GCSManagedConfig message. Also converts values to other types if specified. + * @param message GCSManagedConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GCSManagedConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GCSManagedConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentWarehouseConfig. */ + interface IDocumentWarehouseConfig { + + /** DocumentWarehouseConfig collection */ + collection?: (string|null); + + /** DocumentWarehouseConfig schema */ + schema?: (string|null); + } + + /** Represents a DocumentWarehouseConfig. */ + class DocumentWarehouseConfig implements IDocumentWarehouseConfig { + + /** + * Constructs a new DocumentWarehouseConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig); + + /** DocumentWarehouseConfig collection. */ + public collection: string; + + /** DocumentWarehouseConfig schema. */ + public schema: string; + + /** + * Creates a new DocumentWarehouseConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentWarehouseConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig): google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig; + + /** + * Encodes the specified DocumentWarehouseConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.verify|verify} messages. + * @param message DocumentWarehouseConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentWarehouseConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.verify|verify} messages. + * @param message DocumentWarehouseConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentWarehouseConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentWarehouseConfig + * @throws {Error} If the payload is not a 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.v1beta3.Dataset.DocumentWarehouseConfig; + + /** + * Decodes a DocumentWarehouseConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentWarehouseConfig + * @throws {Error} If the payload is 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.v1beta3.Dataset.DocumentWarehouseConfig; + + /** + * Verifies a DocumentWarehouseConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentWarehouseConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentWarehouseConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig; + + /** + * Creates a plain object from a DocumentWarehouseConfig message. Also converts values to other types if specified. + * @param message DocumentWarehouseConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentWarehouseConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentWarehouseConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UnmanagedDatasetConfig. */ + interface IUnmanagedDatasetConfig { + } + + /** Represents an UnmanagedDatasetConfig. */ + class UnmanagedDatasetConfig implements IUnmanagedDatasetConfig { + + /** + * Constructs a new UnmanagedDatasetConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig); + + /** + * Creates a new UnmanagedDatasetConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns UnmanagedDatasetConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig): google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig; + + /** + * Encodes the specified UnmanagedDatasetConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.verify|verify} messages. + * @param message UnmanagedDatasetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UnmanagedDatasetConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.verify|verify} messages. + * @param message UnmanagedDatasetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UnmanagedDatasetConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnmanagedDatasetConfig + * @throws {Error} If the payload is not a 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.v1beta3.Dataset.UnmanagedDatasetConfig; + + /** + * Decodes an UnmanagedDatasetConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnmanagedDatasetConfig + * @throws {Error} If the payload is 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.v1beta3.Dataset.UnmanagedDatasetConfig; + + /** + * Verifies an UnmanagedDatasetConfig message. + * @param message Plain 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 UnmanagedDatasetConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnmanagedDatasetConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig; + + /** + * Creates a plain object from an UnmanagedDatasetConfig message. Also converts values to other types if specified. + * @param message UnmanagedDatasetConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UnmanagedDatasetConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnmanagedDatasetConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + UNINITIALIZED = 1, + INITIALIZING = 2, + INITIALIZED = 3 + } + } + + /** Properties of a DocumentId. */ + interface IDocumentId { + + /** DocumentId gcsManagedDocId */ + gcsManagedDocId?: (google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId|null); + + /** DocumentId unmanagedDocId */ + unmanagedDocId?: (google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId|null); + + /** DocumentId revisionRef */ + revisionRef?: (google.cloud.documentai.v1beta3.IRevisionRef|null); + } + + /** Represents a DocumentId. */ + class DocumentId implements IDocumentId { + + /** + * Constructs a new DocumentId. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDocumentId); + + /** DocumentId gcsManagedDocId. */ + public gcsManagedDocId?: (google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId|null); + + /** DocumentId unmanagedDocId. */ + public unmanagedDocId?: (google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId|null); + + /** DocumentId revisionRef. */ + public revisionRef?: (google.cloud.documentai.v1beta3.IRevisionRef|null); + + /** DocumentId type. */ + public type?: ("gcsManagedDocId"|"unmanagedDocId"); + + /** + * Creates a new DocumentId instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentId instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDocumentId): google.cloud.documentai.v1beta3.DocumentId; + + /** + * Encodes the specified DocumentId message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.verify|verify} messages. + * @param message DocumentId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDocumentId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentId message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.verify|verify} messages. + * @param message DocumentId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDocumentId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentId + * @throws {Error} If the payload is not a 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.v1beta3.DocumentId; + + /** + * Decodes a DocumentId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentId + * @throws {Error} If the payload is 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.v1beta3.DocumentId; + + /** + * Verifies a DocumentId message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentId + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentId; + + /** + * Creates a plain object from a DocumentId message. Also converts values to other types if specified. + * @param message DocumentId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DocumentId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DocumentId { + + /** Properties of a GCSManagedDocumentId. */ + interface IGCSManagedDocumentId { + + /** GCSManagedDocumentId gcsUri */ + gcsUri?: (string|null); + + /** GCSManagedDocumentId cwDocId */ + cwDocId?: (string|null); + } + + /** Represents a GCSManagedDocumentId. */ + class GCSManagedDocumentId implements IGCSManagedDocumentId { + + /** + * Constructs a new GCSManagedDocumentId. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId); + + /** GCSManagedDocumentId gcsUri. */ + public gcsUri: string; + + /** GCSManagedDocumentId cwDocId. */ + public cwDocId: string; + + /** + * Creates a new GCSManagedDocumentId instance using the specified properties. + * @param [properties] Properties to set + * @returns GCSManagedDocumentId instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId): google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId; + + /** + * Encodes the specified GCSManagedDocumentId message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.verify|verify} messages. + * @param message GCSManagedDocumentId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GCSManagedDocumentId message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.verify|verify} messages. + * @param message GCSManagedDocumentId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GCSManagedDocumentId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GCSManagedDocumentId + * @throws {Error} If the payload is not a 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.v1beta3.DocumentId.GCSManagedDocumentId; + + /** + * Decodes a GCSManagedDocumentId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GCSManagedDocumentId + * @throws {Error} If the payload is 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.v1beta3.DocumentId.GCSManagedDocumentId; + + /** + * Verifies a GCSManagedDocumentId message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GCSManagedDocumentId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GCSManagedDocumentId + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId; + + /** + * Creates a plain object from a GCSManagedDocumentId message. Also converts values to other types if specified. + * @param message GCSManagedDocumentId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GCSManagedDocumentId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GCSManagedDocumentId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UnmanagedDocumentId. */ + interface IUnmanagedDocumentId { + + /** UnmanagedDocumentId docId */ + docId?: (string|null); + } + + /** Represents an UnmanagedDocumentId. */ + class UnmanagedDocumentId implements IUnmanagedDocumentId { + + /** + * Constructs a new UnmanagedDocumentId. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId); + + /** UnmanagedDocumentId docId. */ + public docId: string; + + /** + * Creates a new UnmanagedDocumentId instance using the specified properties. + * @param [properties] Properties to set + * @returns UnmanagedDocumentId instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId): google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId; + + /** + * Encodes the specified UnmanagedDocumentId message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.verify|verify} messages. + * @param message UnmanagedDocumentId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UnmanagedDocumentId message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.verify|verify} messages. + * @param message UnmanagedDocumentId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UnmanagedDocumentId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnmanagedDocumentId + * @throws {Error} If the payload is not a 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.v1beta3.DocumentId.UnmanagedDocumentId; + + /** + * Decodes an UnmanagedDocumentId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnmanagedDocumentId + * @throws {Error} If the payload is 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.v1beta3.DocumentId.UnmanagedDocumentId; + + /** + * Verifies an UnmanagedDocumentId message. + * @param message Plain 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 UnmanagedDocumentId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnmanagedDocumentId + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId; + + /** + * Creates a plain object from an UnmanagedDocumentId message. Also converts values to other types if specified. + * @param message UnmanagedDocumentId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UnmanagedDocumentId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnmanagedDocumentId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DatasetSchema. */ + interface IDatasetSchema { + + /** DatasetSchema name */ + name?: (string|null); + + /** DatasetSchema documentSchema */ + documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); + + /** DatasetSchema satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** DatasetSchema satisfiesPzi */ + satisfiesPzi?: (boolean|null); + } + + /** Represents a DatasetSchema. */ + class DatasetSchema implements IDatasetSchema { + + /** + * Constructs a new DatasetSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDatasetSchema); + + /** DatasetSchema name. */ + public name: string; + + /** DatasetSchema documentSchema. */ + public documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); + + /** DatasetSchema satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** DatasetSchema satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** + * Creates a new DatasetSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns DatasetSchema instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDatasetSchema): google.cloud.documentai.v1beta3.DatasetSchema; + + /** + * Encodes the specified DatasetSchema message. Does not implicitly {@link google.cloud.documentai.v1beta3.DatasetSchema.verify|verify} messages. + * @param message DatasetSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDatasetSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatasetSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DatasetSchema.verify|verify} messages. + * @param message DatasetSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDatasetSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatasetSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatasetSchema + * @throws {Error} If the payload is not a 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.v1beta3.DatasetSchema; + + /** + * Decodes a DatasetSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatasetSchema + * @throws {Error} If the payload is 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.v1beta3.DatasetSchema; + + /** + * Verifies a DatasetSchema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DatasetSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatasetSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DatasetSchema; + + /** + * Creates a plain object from a DatasetSchema message. Also converts values to other types if specified. + * @param message DatasetSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DatasetSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatasetSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatasetSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDatasetDocuments. */ + interface IBatchDatasetDocuments { + + /** BatchDatasetDocuments individualDocumentIds */ + individualDocumentIds?: (google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds|null); + + /** BatchDatasetDocuments filter */ + filter?: (string|null); + } + + /** Represents a BatchDatasetDocuments. */ + class BatchDatasetDocuments implements IBatchDatasetDocuments { + + /** + * Constructs a new BatchDatasetDocuments. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IBatchDatasetDocuments); + + /** BatchDatasetDocuments individualDocumentIds. */ + public individualDocumentIds?: (google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds|null); + + /** BatchDatasetDocuments filter. */ + public filter?: (string|null); + + /** BatchDatasetDocuments criteria. */ + public criteria?: ("individualDocumentIds"|"filter"); + + /** + * Creates a new BatchDatasetDocuments instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDatasetDocuments instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IBatchDatasetDocuments): google.cloud.documentai.v1beta3.BatchDatasetDocuments; + + /** + * Encodes the specified BatchDatasetDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.verify|verify} messages. + * @param message BatchDatasetDocuments message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IBatchDatasetDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDatasetDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.verify|verify} messages. + * @param message BatchDatasetDocuments message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchDatasetDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDatasetDocuments message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDatasetDocuments + * @throws {Error} If the payload is not a 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.v1beta3.BatchDatasetDocuments; + + /** + * Decodes a BatchDatasetDocuments message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDatasetDocuments + * @throws {Error} If the payload is 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.v1beta3.BatchDatasetDocuments; + + /** + * Verifies a BatchDatasetDocuments message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDatasetDocuments message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDatasetDocuments + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDatasetDocuments; + + /** + * Creates a plain object from a BatchDatasetDocuments message. Also converts values to other types if specified. + * @param message BatchDatasetDocuments + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchDatasetDocuments, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDatasetDocuments to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDatasetDocuments + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchDatasetDocuments { + + /** Properties of an IndividualDocumentIds. */ + interface IIndividualDocumentIds { + + /** IndividualDocumentIds documentIds */ + documentIds?: (google.cloud.documentai.v1beta3.IDocumentId[]|null); + } + + /** Represents an IndividualDocumentIds. */ + class IndividualDocumentIds implements IIndividualDocumentIds { + + /** + * Constructs a new IndividualDocumentIds. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds); + + /** IndividualDocumentIds documentIds. */ + public documentIds: google.cloud.documentai.v1beta3.IDocumentId[]; + + /** + * Creates a new IndividualDocumentIds instance using the specified properties. + * @param [properties] Properties to set + * @returns IndividualDocumentIds instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds): google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds; + + /** + * Encodes the specified IndividualDocumentIds message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.verify|verify} messages. + * @param message IndividualDocumentIds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndividualDocumentIds message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.verify|verify} messages. + * @param message IndividualDocumentIds message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndividualDocumentIds message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndividualDocumentIds + * @throws {Error} If the payload is not a 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.v1beta3.BatchDatasetDocuments.IndividualDocumentIds; + + /** + * Decodes an IndividualDocumentIds message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndividualDocumentIds + * @throws {Error} If the payload is 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.v1beta3.BatchDatasetDocuments.IndividualDocumentIds; + + /** + * Verifies an IndividualDocumentIds message. + * @param message Plain 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 IndividualDocumentIds message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndividualDocumentIds + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds; + + /** + * Creates a plain object from an IndividualDocumentIds message. Also converts values to other types if specified. + * @param message IndividualDocumentIds + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndividualDocumentIds to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndividualDocumentIds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** 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.v1beta3.Document.IStyle[]|null); + + /** Document pages */ + pages?: (google.cloud.documentai.v1beta3.Document.IPage[]|null); + + /** Document entities */ + entities?: (google.cloud.documentai.v1beta3.Document.IEntity[]|null); + + /** Document entityRelations */ + entityRelations?: (google.cloud.documentai.v1beta3.Document.IEntityRelation[]|null); + + /** Document textChanges */ + textChanges?: (google.cloud.documentai.v1beta3.Document.ITextChange[]|null); + + /** Document shardInfo */ + shardInfo?: (google.cloud.documentai.v1beta3.Document.IShardInfo|null); + + /** Document error */ + error?: (google.rpc.IStatus|null); + + /** Document revisions */ + revisions?: (google.cloud.documentai.v1beta3.Document.IRevision[]|null); + + /** Document documentLayout */ + documentLayout?: (google.cloud.documentai.v1beta3.Document.IDocumentLayout|null); + + /** Document chunkedDocument */ + chunkedDocument?: (google.cloud.documentai.v1beta3.Document.IChunkedDocument|null); + + /** Document blobAssets */ + blobAssets?: (google.cloud.documentai.v1beta3.Document.IBlobAsset[]|null); + + /** Document entityValidationOutput */ + entityValidationOutput?: (google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null); + + /** Document entitiesRevisions */ + entitiesRevisions?: (google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.IStyle[]; + + /** Document pages. */ + public pages: google.cloud.documentai.v1beta3.Document.IPage[]; + + /** Document entities. */ + public entities: google.cloud.documentai.v1beta3.Document.IEntity[]; + + /** Document entityRelations. */ + public entityRelations: google.cloud.documentai.v1beta3.Document.IEntityRelation[]; + + /** Document textChanges. */ + public textChanges: google.cloud.documentai.v1beta3.Document.ITextChange[]; + + /** Document shardInfo. */ + public shardInfo?: (google.cloud.documentai.v1beta3.Document.IShardInfo|null); + + /** Document error. */ + public error?: (google.rpc.IStatus|null); + + /** Document revisions. */ + public revisions: google.cloud.documentai.v1beta3.Document.IRevision[]; + + /** Document documentLayout. */ + public documentLayout?: (google.cloud.documentai.v1beta3.Document.IDocumentLayout|null); + + /** Document chunkedDocument. */ + public chunkedDocument?: (google.cloud.documentai.v1beta3.Document.IChunkedDocument|null); + + /** Document blobAssets. */ + public blobAssets: google.cloud.documentai.v1beta3.Document.IBlobAsset[]; + + /** Document entityValidationOutput. */ + public entityValidationOutput?: (google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null); + + /** Document entitiesRevisions. */ + public entitiesRevisions: google.cloud.documentai.v1beta3.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.v1beta3.IDocument): google.cloud.documentai.v1beta3.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IShardInfo): google.cloud.documentai.v1beta3.Document.ShardInfo; + + /** + * Encodes the specified ShardInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IShardInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShardInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IStyle); + + /** Style textAnchor. */ + public textAnchor?: (google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.IStyle): google.cloud.documentai.v1beta3.Document.Style; + + /** + * Encodes the specified Style message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IStyle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Style message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style.IFontSize): google.cloud.documentai.v1beta3.Document.Style.FontSize; + + /** + * Encodes the specified FontSize message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.IFontSize, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FontSize message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IImage|null); + + /** Page transforms */ + transforms?: (google.cloud.documentai.v1beta3.Document.Page.IMatrix[]|null); + + /** Page dimension */ + dimension?: (google.cloud.documentai.v1beta3.Document.Page.IDimension|null); + + /** Page layout */ + layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** Page detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + + /** Page blocks */ + blocks?: (google.cloud.documentai.v1beta3.Document.Page.IBlock[]|null); + + /** Page paragraphs */ + paragraphs?: (google.cloud.documentai.v1beta3.Document.Page.IParagraph[]|null); + + /** Page lines */ + lines?: (google.cloud.documentai.v1beta3.Document.Page.ILine[]|null); + + /** Page tokens */ + tokens?: (google.cloud.documentai.v1beta3.Document.Page.IToken[]|null); + + /** Page visualElements */ + visualElements?: (google.cloud.documentai.v1beta3.Document.Page.IVisualElement[]|null); + + /** Page tables */ + tables?: (google.cloud.documentai.v1beta3.Document.Page.ITable[]|null); + + /** Page formFields */ + formFields?: (google.cloud.documentai.v1beta3.Document.Page.IFormField[]|null); + + /** Page symbols */ + symbols?: (google.cloud.documentai.v1beta3.Document.Page.ISymbol[]|null); + + /** Page detectedBarcodes */ + detectedBarcodes?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode[]|null); + + /** Page imageQualityScores */ + imageQualityScores?: (google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores|null); + + /** Page provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + } + + /** Represents a Page. */ + class Page implements IPage { + + /** + * Constructs a new Page. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.IPage); + + /** Page pageNumber. */ + public pageNumber: number; + + /** Page image. */ + public image?: (google.cloud.documentai.v1beta3.Document.Page.IImage|null); + + /** Page transforms. */ + public transforms: google.cloud.documentai.v1beta3.Document.Page.IMatrix[]; + + /** Page dimension. */ + public dimension?: (google.cloud.documentai.v1beta3.Document.Page.IDimension|null); + + /** Page layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** Page detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + + /** Page blocks. */ + public blocks: google.cloud.documentai.v1beta3.Document.Page.IBlock[]; + + /** Page paragraphs. */ + public paragraphs: google.cloud.documentai.v1beta3.Document.Page.IParagraph[]; + + /** Page lines. */ + public lines: google.cloud.documentai.v1beta3.Document.Page.ILine[]; + + /** Page tokens. */ + public tokens: google.cloud.documentai.v1beta3.Document.Page.IToken[]; + + /** Page visualElements. */ + public visualElements: google.cloud.documentai.v1beta3.Document.Page.IVisualElement[]; + + /** Page tables. */ + public tables: google.cloud.documentai.v1beta3.Document.Page.ITable[]; + + /** Page formFields. */ + public formFields: google.cloud.documentai.v1beta3.Document.Page.IFormField[]; + + /** Page symbols. */ + public symbols: google.cloud.documentai.v1beta3.Document.Page.ISymbol[]; + + /** Page detectedBarcodes. */ + public detectedBarcodes: google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode[]; + + /** Page imageQualityScores. */ + public imageQualityScores?: (google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores|null); + + /** Page provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.IPage): google.cloud.documentai.v1beta3.Document.Page; + + /** + * Encodes the specified Page message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IPage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IDimension): google.cloud.documentai.v1beta3.Document.Page.Dimension; + + /** + * Encodes the specified Dimension message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IDimension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dimension message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IImage): google.cloud.documentai.v1beta3.Document.Page.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IMatrix): google.cloud.documentai.v1beta3.Document.Page.Matrix; + + /** + * Encodes the specified Matrix message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IMatrix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Matrix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ITextAnchor|null); + + /** Layout confidence */ + confidence?: (number|null); + + /** Layout boundingPoly */ + boundingPoly?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); + + /** Layout orientation */ + orientation?: (google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout); + + /** Layout textAnchor. */ + public textAnchor?: (google.cloud.documentai.v1beta3.Document.ITextAnchor|null); + + /** Layout confidence. */ + public confidence: number; + + /** Layout boundingPoly. */ + public boundingPoly?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); + + /** Layout orientation. */ + public orientation: (google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout): google.cloud.documentai.v1beta3.Document.Page.Layout; + + /** + * Encodes the specified Layout message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); + + /** Block detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + + /** Block provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + } + + /** Represents a Block. */ + class Block implements IBlock { + + /** + * Constructs a new Block. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IBlock); + + /** Block layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** Block detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + + /** Block provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IBlock): google.cloud.documentai.v1beta3.Document.Page.Block; + + /** + * Encodes the specified Block message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); + + /** Paragraph detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + + /** Paragraph provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + } + + /** Represents a Paragraph. */ + class Paragraph implements IParagraph { + + /** + * Constructs a new Paragraph. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IParagraph); + + /** Paragraph layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** Paragraph detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + + /** Paragraph provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IParagraph): google.cloud.documentai.v1beta3.Document.Page.Paragraph; + + /** + * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); + + /** Line detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + + /** Line provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + } + + /** Represents a Line. */ + class Line implements ILine { + + /** + * Constructs a new Line. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.ILine); + + /** Line layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** Line detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + + /** Line provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILine): google.cloud.documentai.v1beta3.Document.Page.Line; + + /** + * Encodes the specified Line message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); + + /** Token detectedBreak */ + detectedBreak?: (google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak|null); + + /** Token detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + + /** Token provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + + /** Token styleInfo */ + styleInfo?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IToken); + + /** Token layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** Token detectedBreak. */ + public detectedBreak?: (google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak|null); + + /** Token detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + + /** Token provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + + /** Token styleInfo. */ + public styleInfo?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IToken): google.cloud.documentai.v1beta3.Document.Page.Token; + + /** + * Encodes the specified Token message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IToken, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Token message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak.Type|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.IDetectedBreak); + + /** DetectedBreak type. */ + public type: (google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.IDetectedBreak): google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak; + + /** + * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.IStyleInfo): google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo; + + /** + * Encodes the specified StyleInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.IStyleInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StyleInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); + + /** Symbol detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ISymbol); + + /** Symbol layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** Symbol detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ISymbol): google.cloud.documentai.v1beta3.Document.Page.Symbol; + + /** + * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); + + /** VisualElement type */ + type?: (string|null); + + /** VisualElement detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IVisualElement); + + /** VisualElement layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** VisualElement type. */ + public type: string; + + /** VisualElement detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IVisualElement): google.cloud.documentai.v1beta3.Document.Page.VisualElement; + + /** + * Encodes the specified VisualElement message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IVisualElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VisualElement message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); + + /** Table headerRows */ + headerRows?: (google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow[]|null); + + /** Table bodyRows */ + bodyRows?: (google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow[]|null); + + /** Table detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + + /** Table provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + } + + /** Represents a Table. */ + class Table implements ITable { + + /** + * Constructs a new Table. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.ITable); + + /** Table layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** Table headerRows. */ + public headerRows: google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow[]; + + /** Table bodyRows. */ + public bodyRows: google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow[]; + + /** Table detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + + /** Table provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ITable): google.cloud.documentai.v1beta3.Document.Page.Table; + + /** + * Encodes the specified Table message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ITable, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Table message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.ITableRow); + + /** TableRow cells. */ + public cells: google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.ITableRow): google.cloud.documentai.v1beta3.Document.Page.Table.TableRow; + + /** + * Encodes the specified TableRow message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.ITableRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableRow message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); + + /** TableCell rowSpan */ + rowSpan?: (number|null); + + /** TableCell colSpan */ + colSpan?: (number|null); + + /** TableCell detectedLanguages */ + detectedLanguages?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.ITableCell); + + /** TableCell layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** TableCell rowSpan. */ + public rowSpan: number; + + /** TableCell colSpan. */ + public colSpan: number; + + /** TableCell detectedLanguages. */ + public detectedLanguages: google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.ITableCell): google.cloud.documentai.v1beta3.Document.Page.Table.TableCell; + + /** + * Encodes the specified TableCell message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.ITableCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableCell message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); + + /** FormField fieldValue */ + fieldValue?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** FormField nameDetectedLanguages */ + nameDetectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); + + /** FormField valueDetectedLanguages */ + valueDetectedLanguages?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.IProvenance|null); + } + + /** Represents a FormField. */ + class FormField implements IFormField { + + /** + * Constructs a new FormField. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IFormField); + + /** FormField fieldName. */ + public fieldName?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** FormField fieldValue. */ + public fieldValue?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** FormField nameDetectedLanguages. */ + public nameDetectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; + + /** FormField valueDetectedLanguages. */ + public valueDetectedLanguages: google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IFormField): google.cloud.documentai.v1beta3.Document.Page.FormField; + + /** + * Encodes the specified FormField message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IFormField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FormField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); + + /** DetectedBarcode barcode */ + barcode?: (google.cloud.documentai.v1beta3.IBarcode|null); + } + + /** Represents a DetectedBarcode. */ + class DetectedBarcode implements IDetectedBarcode { + + /** + * Constructs a new DetectedBarcode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode); + + /** DetectedBarcode layout. */ + public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); + + /** DetectedBarcode barcode. */ + public barcode?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IDetectedBarcode): google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode; + + /** + * Encodes the specified DetectedBarcode message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IDetectedBarcode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedBarcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IDetectedLanguage): google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage; + + /** + * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IImageQualityScores); + + /** ImageQualityScores qualityScore. */ + public qualityScore: number; + + /** ImageQualityScores detectedDefects. */ + public detectedDefects: google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IImageQualityScores): google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores; + + /** + * Encodes the specified ImageQualityScores message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IImageQualityScores, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageQualityScores message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.IDetectedDefect): google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect; + + /** + * Encodes the specified DetectedDefect message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.IDetectedDefect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectedDefect message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IPageAnchor|null); + + /** Entity id */ + id?: (string|null); + + /** Entity normalizedValue */ + normalizedValue?: (google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue|null); + + /** Entity properties */ + properties?: (google.cloud.documentai.v1beta3.Document.IEntity[]|null); + + /** Entity provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + + /** Entity redacted */ + redacted?: (boolean|null); + + /** Entity method */ + method?: (google.cloud.documentai.v1beta3.Document.Entity.Method|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntity); + + /** Entity textAnchor. */ + public textAnchor?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.IPageAnchor|null); + + /** Entity id. */ + public id: string; + + /** Entity normalizedValue. */ + public normalizedValue?: (google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue|null); + + /** Entity properties. */ + public properties: google.cloud.documentai.v1beta3.Document.IEntity[]; + + /** Entity provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + + /** Entity redacted. */ + public redacted: boolean; + + /** Entity method. */ + public method: (google.cloud.documentai.v1beta3.Document.Entity.Method|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntity): google.cloud.documentai.v1beta3.Document.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.INormalizedValue): google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue; + + /** + * Encodes the specified NormalizedValue message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.INormalizedValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedValue message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IEntityRelation): google.cloud.documentai.v1beta3.Document.EntityRelation; + + /** + * Encodes the specified EntityRelation message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntityRelation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityRelation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ITextAnchor); + + /** TextAnchor textSegments. */ + public textSegments: google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextAnchor): google.cloud.documentai.v1beta3.Document.TextAnchor; + + /** + * Encodes the specified TextAnchor message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextAnchor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.ITextSegment): google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment; + + /** + * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IPageAnchor); + + /** PageAnchor pageRefs. */ + public pageRefs: google.cloud.documentai.v1beta3.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.v1beta3.Document.IPageAnchor): google.cloud.documentai.v1beta3.Document.PageAnchor; + + /** + * Encodes the specified PageAnchor message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IPageAnchor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PageAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.PageRef.LayoutType|keyof typeof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType|null); + + /** PageRef layoutId */ + layoutId?: (string|null); + + /** PageRef boundingPoly */ + boundingPoly?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.IPageRef); + + /** PageRef page. */ + public page: (number|Long|string); + + /** PageRef layoutType. */ + public layoutType: (google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType|keyof typeof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType); + + /** PageRef layoutId. */ + public layoutId: string; + + /** PageRef boundingPoly. */ + public boundingPoly?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.IPageRef): google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef; + + /** + * Encodes the specified PageRef message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.IPageRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PageRef message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.IParent[]|null); + + /** Provenance type */ + type?: (google.cloud.documentai.v1beta3.Document.Provenance.OperationType|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.IProvenance); + + /** Provenance revision. */ + public revision: number; + + /** Provenance id. */ + public id: number; + + /** Provenance parents. */ + public parents: google.cloud.documentai.v1beta3.Document.Provenance.IParent[]; + + /** Provenance type. */ + public type: (google.cloud.documentai.v1beta3.Document.Provenance.OperationType|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.IProvenance): google.cloud.documentai.v1beta3.Document.Provenance; + + /** + * Encodes the specified Provenance message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IProvenance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Provenance message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.IParent): google.cloud.documentai.v1beta3.Document.Provenance.Parent; + + /** + * Encodes the specified Parent message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.IParent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parent message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IRevision): google.cloud.documentai.v1beta3.Document.Revision; + + /** + * Encodes the specified Revision message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Revision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.IHumanReview): google.cloud.documentai.v1beta3.Document.Revision.HumanReview; + + /** + * Encodes the specified HumanReview message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.IHumanReview, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HumanReview message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ITextAnchor|null); + + /** TextChange changedText */ + changedText?: (string|null); + + /** TextChange provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance[]|null); + } + + /** Represents a TextChange. */ + class TextChange implements ITextChange { + + /** + * Constructs a new TextChange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.ITextChange); + + /** TextChange textAnchor. */ + public textAnchor?: (google.cloud.documentai.v1beta3.Document.ITextAnchor|null); + + /** TextChange changedText. */ + public changedText: string; + + /** TextChange provenance. */ + public provenance: google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextChange): google.cloud.documentai.v1beta3.Document.TextChange; + + /** + * Encodes the specified TextChange message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextChange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextChange message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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 an Annotations. */ + interface IAnnotations { + + /** Annotations description */ + description?: (string|null); + } + + /** Represents an Annotations. */ + class Annotations implements IAnnotations { + + /** + * Constructs a new Annotations. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.IAnnotations); + + /** Annotations description. */ + public description: string; + + /** + * Creates a new Annotations instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotations instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Document.IAnnotations): google.cloud.documentai.v1beta3.Document.Annotations; + + /** + * Encodes the specified Annotations message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Annotations.verify|verify} messages. + * @param message Annotations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Document.IAnnotations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotations message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Annotations.verify|verify} messages. + * @param message Annotations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.IAnnotations, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotations + * @throws {Error} If the payload is not a 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.v1beta3.Document.Annotations; + + /** + * Decodes an Annotations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotations + * @throws {Error} If the payload is 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.v1beta3.Document.Annotations; + + /** + * Verifies an Annotations message. + * @param message Plain 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 Annotations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotations + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Annotations; + + /** + * Creates a plain object from an Annotations message. Also converts values to other types if specified. + * @param message Annotations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Document.Annotations, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotations + * @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.v1beta3.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.v1beta3.Document.IDocumentLayout); + + /** DocumentLayout blocks. */ + public blocks: google.cloud.documentai.v1beta3.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.v1beta3.Document.IDocumentLayout): google.cloud.documentai.v1beta3.Document.DocumentLayout; + + /** + * Encodes the specified DocumentLayout message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IDocumentLayout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentLayout message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null); + + /** DocumentLayoutBlock tableBlock */ + tableBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null); + + /** DocumentLayoutBlock listBlock */ + listBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null); + + /** DocumentLayoutBlock imageBlock */ + imageBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock|null); + + /** DocumentLayoutBlock blockId */ + blockId?: (string|null); + + /** DocumentLayoutBlock pageSpan */ + pageSpan?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null); + + /** DocumentLayoutBlock boundingBox */ + boundingBox?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); + } + + /** Represents a DocumentLayoutBlock. */ + class DocumentLayoutBlock implements IDocumentLayoutBlock { + + /** + * Constructs a new DocumentLayoutBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.IDocumentLayoutBlock); + + /** DocumentLayoutBlock textBlock. */ + public textBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null); + + /** DocumentLayoutBlock tableBlock. */ + public tableBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null); + + /** DocumentLayoutBlock listBlock. */ + public listBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null); + + /** DocumentLayoutBlock imageBlock. */ + public imageBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock|null); + + /** DocumentLayoutBlock blockId. */ + public blockId: string; + + /** DocumentLayoutBlock pageSpan. */ + public pageSpan?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null); + + /** DocumentLayoutBlock boundingBox. */ + public boundingBox?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); + + /** DocumentLayoutBlock block. */ + public block?: ("textBlock"|"tableBlock"|"listBlock"|"imageBlock"); + + /** + * Creates a new DocumentLayoutBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentLayoutBlock instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.IDocumentLayoutBlock): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock; + + /** + * Encodes the specified DocumentLayoutBlock message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.IDocumentLayoutBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentLayoutBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan; + + /** + * Encodes the specified LayoutPageSpan message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutPageSpan message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.IDocumentLayoutBlock[]|null); + + /** LayoutTextBlock annotations */ + annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); + } + + /** Represents a LayoutTextBlock. */ + class LayoutTextBlock implements ILayoutTextBlock { + + /** + * Constructs a new LayoutTextBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock); + + /** LayoutTextBlock text. */ + public text: string; + + /** LayoutTextBlock type. */ + public type: string; + + /** LayoutTextBlock blocks. */ + public blocks: google.cloud.documentai.v1beta3.Document.DocumentLayout.IDocumentLayoutBlock[]; + + /** LayoutTextBlock annotations. */ + public annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); + + /** + * Creates a new LayoutTextBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutTextBlock instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock; + + /** + * Encodes the specified LayoutTextBlock message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutTextBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]|null); + + /** LayoutTableBlock bodyRows */ + bodyRows?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]|null); + + /** LayoutTableBlock caption */ + caption?: (string|null); + + /** LayoutTableBlock annotations */ + annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); + } + + /** Represents a LayoutTableBlock. */ + class LayoutTableBlock implements ILayoutTableBlock { + + /** + * Constructs a new LayoutTableBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock); + + /** LayoutTableBlock headerRows. */ + public headerRows: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]; + + /** LayoutTableBlock bodyRows. */ + public bodyRows: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]; + + /** LayoutTableBlock caption. */ + public caption: string; + + /** LayoutTableBlock annotations. */ + public annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); + + /** + * Creates a new LayoutTableBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutTableBlock instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock; + + /** + * Encodes the specified LayoutTableBlock message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutTableBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow); + + /** LayoutTableRow cells. */ + public cells: google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow; + + /** + * Encodes the specified LayoutTableRow message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutTableRow message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell); + + /** LayoutTableCell blocks. */ + public blocks: google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell; + + /** + * Encodes the specified LayoutTableCell message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutTableCell message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock); + + /** LayoutListBlock listEntries. */ + public listEntries: google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock; + + /** + * Encodes the specified LayoutListBlock message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutListBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry); + + /** LayoutListEntry blocks. */ + public blocks: google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry; + + /** + * Encodes the specified LayoutListEntry message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutListEntry message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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 LayoutImageBlock. */ + interface ILayoutImageBlock { + + /** LayoutImageBlock blobAssetId */ + blobAssetId?: (string|null); + + /** LayoutImageBlock gcsUri */ + gcsUri?: (string|null); + + /** LayoutImageBlock dataUri */ + dataUri?: (string|null); + + /** LayoutImageBlock mimeType */ + mimeType?: (string|null); + + /** LayoutImageBlock imageText */ + imageText?: (string|null); + + /** LayoutImageBlock annotations */ + annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); + } + + /** Represents a LayoutImageBlock. */ + class LayoutImageBlock implements ILayoutImageBlock { + + /** + * Constructs a new LayoutImageBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock); + + /** LayoutImageBlock blobAssetId. */ + public blobAssetId?: (string|null); + + /** LayoutImageBlock gcsUri. */ + public gcsUri?: (string|null); + + /** LayoutImageBlock dataUri. */ + public dataUri?: (string|null); + + /** LayoutImageBlock mimeType. */ + public mimeType: string; + + /** LayoutImageBlock imageText. */ + public imageText: string; + + /** LayoutImageBlock annotations. */ + public annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); + + /** LayoutImageBlock imageSource. */ + public imageSource?: ("blobAssetId"|"gcsUri"|"dataUri"); + + /** + * Creates a new LayoutImageBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutImageBlock instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock; + + /** + * Encodes the specified LayoutImageBlock message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.verify|verify} messages. + * @param message LayoutImageBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutImageBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.verify|verify} messages. + * @param message LayoutImageBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LayoutImageBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LayoutImageBlock + * @throws {Error} If the payload is not a 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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock; + + /** + * Decodes a LayoutImageBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LayoutImageBlock + * @throws {Error} If the payload is 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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock; + + /** + * Verifies a LayoutImageBlock message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LayoutImageBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LayoutImageBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock; + + /** + * Creates a plain object from a LayoutImageBlock message. Also converts values to other types if specified. + * @param message LayoutImageBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LayoutImageBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LayoutImageBlock + * @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.v1beta3.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.v1beta3.Document.IChunkedDocument); + + /** ChunkedDocument chunks. */ + public chunks: google.cloud.documentai.v1beta3.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.v1beta3.Document.IChunkedDocument): google.cloud.documentai.v1beta3.Document.ChunkedDocument; + + /** + * Encodes the specified ChunkedDocument message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IChunkedDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkedDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); + + /** Chunk pageHeaders */ + pageHeaders?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageHeader[]|null); + + /** Chunk pageFooters */ + pageFooters?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageFooter[]|null); + + /** Chunk chunkFields */ + chunkFields?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField[]|null); + } + + /** Represents a Chunk. */ + class Chunk implements IChunk { + + /** + * Constructs a new Chunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); + + /** Chunk pageHeaders. */ + public pageHeaders: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageHeader[]; + + /** Chunk pageFooters. */ + public pageFooters: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageFooter[]; + + /** Chunk chunkFields. */ + public chunkFields: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField[]; + + /** + * Creates a new Chunk instance using the specified properties. + * @param [properties] Properties to set + * @returns Chunk instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.IChunk): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk; + + /** + * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan; + + /** + * Encodes the specified ChunkPageSpan message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkPageSpan message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageHeader); + + /** ChunkPageHeader text. */ + public text: string; + + /** ChunkPageHeader pageSpan. */ + public pageSpan?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageHeader): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader; + + /** + * Encodes the specified ChunkPageHeader message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkPageHeader message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageFooter); + + /** ChunkPageFooter text. */ + public text: string; + + /** ChunkPageFooter pageSpan. */ + public pageSpan?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageFooter): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter; + + /** + * Encodes the specified ChunkPageFooter message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageFooter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkPageFooter message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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 ImageChunkField. */ + interface IImageChunkField { + + /** ImageChunkField blobAssetId */ + blobAssetId?: (string|null); + + /** ImageChunkField gcsUri */ + gcsUri?: (string|null); + + /** ImageChunkField dataUri */ + dataUri?: (string|null); + + /** ImageChunkField annotations */ + annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); + } + + /** Represents an ImageChunkField. */ + class ImageChunkField implements IImageChunkField { + + /** + * Constructs a new ImageChunkField. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField); + + /** ImageChunkField blobAssetId. */ + public blobAssetId?: (string|null); + + /** ImageChunkField gcsUri. */ + public gcsUri?: (string|null); + + /** ImageChunkField dataUri. */ + public dataUri?: (string|null); + + /** ImageChunkField annotations. */ + public annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); + + /** ImageChunkField imageSource. */ + public imageSource?: ("blobAssetId"|"gcsUri"|"dataUri"); + + /** + * Creates a new ImageChunkField instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageChunkField instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField; + + /** + * Encodes the specified ImageChunkField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.verify|verify} messages. + * @param message ImageChunkField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageChunkField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.verify|verify} messages. + * @param message ImageChunkField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageChunkField message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageChunkField + * @throws {Error} If the payload is not a 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.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField; + + /** + * Decodes an ImageChunkField message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageChunkField + * @throws {Error} If the payload is 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.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField; + + /** + * Verifies an ImageChunkField message. + * @param message Plain 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 ImageChunkField message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageChunkField + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField; + + /** + * Creates a plain object from an ImageChunkField message. Also converts values to other types if specified. + * @param message ImageChunkField + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageChunkField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageChunkField + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableChunkField. */ + interface ITableChunkField { + + /** TableChunkField annotations */ + annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); + } + + /** Represents a TableChunkField. */ + class TableChunkField implements ITableChunkField { + + /** + * Constructs a new TableChunkField. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField); + + /** TableChunkField annotations. */ + public annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); + + /** + * Creates a new TableChunkField instance using the specified properties. + * @param [properties] Properties to set + * @returns TableChunkField instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField; + + /** + * Encodes the specified TableChunkField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.verify|verify} messages. + * @param message TableChunkField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableChunkField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.verify|verify} messages. + * @param message TableChunkField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableChunkField message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableChunkField + * @throws {Error} If the payload is not a 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.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField; + + /** + * Decodes a TableChunkField message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableChunkField + * @throws {Error} If the payload is 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.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField; + + /** + * Verifies a TableChunkField message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TableChunkField message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableChunkField + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField; + + /** + * Creates a plain object from a TableChunkField message. Also converts values to other types if specified. + * @param message TableChunkField + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableChunkField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableChunkField + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChunkField. */ + interface IChunkField { + + /** ChunkField imageChunkField */ + imageChunkField?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField|null); + + /** ChunkField tableChunkField */ + tableChunkField?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField|null); + } + + /** Represents a ChunkField. */ + class ChunkField implements IChunkField { + + /** + * Constructs a new ChunkField. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField); + + /** ChunkField imageChunkField. */ + public imageChunkField?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField|null); + + /** ChunkField tableChunkField. */ + public tableChunkField?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField|null); + + /** ChunkField fieldType. */ + public fieldType?: ("imageChunkField"|"tableChunkField"); + + /** + * Creates a new ChunkField instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkField instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField; + + /** + * Encodes the specified ChunkField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.verify|verify} messages. + * @param message ChunkField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.verify|verify} messages. + * @param message ChunkField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkField message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkField + * @throws {Error} If the payload is not a 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.v1beta3.Document.ChunkedDocument.Chunk.ChunkField; + + /** + * Decodes a ChunkField message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkField + * @throws {Error} If the payload is 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.v1beta3.Document.ChunkedDocument.Chunk.ChunkField; + + /** + * Verifies a ChunkField message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChunkField message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkField + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField; + + /** + * Creates a plain object from a ChunkField message. Also converts values to other types if specified. + * @param message ChunkField + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkField + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a BlobAsset. */ + interface IBlobAsset { + + /** BlobAsset assetId */ + assetId?: (string|null); + + /** BlobAsset content */ + content?: (Uint8Array|Buffer|string|null); + + /** BlobAsset mimeType */ + mimeType?: (string|null); + } + + /** Represents a BlobAsset. */ + class BlobAsset implements IBlobAsset { + + /** + * Constructs a new BlobAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.IBlobAsset); + + /** BlobAsset assetId. */ + public assetId: string; + + /** BlobAsset content. */ + public content: (Uint8Array|Buffer|string); + + /** BlobAsset mimeType. */ + public mimeType: string; + + /** + * Creates a new BlobAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns BlobAsset instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Document.IBlobAsset): google.cloud.documentai.v1beta3.Document.BlobAsset; + + /** + * Encodes the specified BlobAsset message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.BlobAsset.verify|verify} messages. + * @param message BlobAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Document.IBlobAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BlobAsset message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.BlobAsset.verify|verify} messages. + * @param message BlobAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.IBlobAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BlobAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BlobAsset + * @throws {Error} If the payload is not a 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.v1beta3.Document.BlobAsset; + + /** + * Decodes a BlobAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BlobAsset + * @throws {Error} If the payload is 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.v1beta3.Document.BlobAsset; + + /** + * Verifies a BlobAsset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BlobAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BlobAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.BlobAsset; + + /** + * Creates a plain object from a BlobAsset message. Also converts values to other types if specified. + * @param message BlobAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Document.BlobAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BlobAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BlobAsset + * @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.v1beta3.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.v1beta3.Document.IEntityValidationOutput); + + /** EntityValidationOutput validationResults. */ + public validationResults: google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntityValidationOutput): google.cloud.documentai.v1beta3.Document.EntityValidationOutput; + + /** + * Encodes the specified EntityValidationOutput message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntityValidationOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityValidationOutput message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult.ValidationResultType|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.IValidationResult); + + /** ValidationResult ruleName. */ + public ruleName: string; + + /** ValidationResult ruleDescription. */ + public ruleDescription: string; + + /** ValidationResult validationResultType. */ + public validationResultType: (google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult.ValidationResultType|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.IValidationResult): google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult; + + /** + * Encodes the specified ValidationResult message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.IValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidationResult message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IEntity[]|null); + + /** EntitiesRevision entityValidationOutput */ + entityValidationOutput?: (google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null); + + /** EntitiesRevision provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + } + + /** Represents an EntitiesRevision. */ + class EntitiesRevision implements IEntitiesRevision { + + /** + * Constructs a new EntitiesRevision. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Document.IEntitiesRevision); + + /** EntitiesRevision revisionId. */ + public revisionId: string; + + /** EntitiesRevision entities. */ + public entities: google.cloud.documentai.v1beta3.Document.IEntity[]; + + /** EntitiesRevision entityValidationOutput. */ + public entityValidationOutput?: (google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null); + + /** EntitiesRevision provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|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.v1beta3.Document.IEntitiesRevision): google.cloud.documentai.v1beta3.Document.EntitiesRevision; + + /** + * Encodes the specified EntitiesRevision message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntitiesRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntitiesRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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 RevisionRef. */ + interface IRevisionRef { + + /** RevisionRef revisionCase */ + revisionCase?: (google.cloud.documentai.v1beta3.RevisionRef.RevisionCase|keyof typeof google.cloud.documentai.v1beta3.RevisionRef.RevisionCase|null); + + /** RevisionRef revisionId */ + revisionId?: (string|null); + + /** RevisionRef latestProcessorVersion */ + latestProcessorVersion?: (string|null); + } + + /** Represents a RevisionRef. */ + class RevisionRef implements IRevisionRef { + + /** + * Constructs a new RevisionRef. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IRevisionRef); + + /** RevisionRef revisionCase. */ + public revisionCase?: (google.cloud.documentai.v1beta3.RevisionRef.RevisionCase|keyof typeof google.cloud.documentai.v1beta3.RevisionRef.RevisionCase|null); + + /** RevisionRef revisionId. */ + public revisionId?: (string|null); + + /** RevisionRef latestProcessorVersion. */ + public latestProcessorVersion?: (string|null); + + /** RevisionRef source. */ + public source?: ("revisionCase"|"revisionId"|"latestProcessorVersion"); + + /** + * Creates a new RevisionRef instance using the specified properties. + * @param [properties] Properties to set + * @returns RevisionRef instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IRevisionRef): google.cloud.documentai.v1beta3.RevisionRef; + + /** + * Encodes the specified RevisionRef message. Does not implicitly {@link google.cloud.documentai.v1beta3.RevisionRef.verify|verify} messages. + * @param message RevisionRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IRevisionRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RevisionRef message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RevisionRef.verify|verify} messages. + * @param message RevisionRef message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IRevisionRef, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RevisionRef message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RevisionRef + * @throws {Error} If the payload is not a 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.v1beta3.RevisionRef; + + /** + * Decodes a RevisionRef message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RevisionRef + * @throws {Error} If the payload is 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.v1beta3.RevisionRef; + + /** + * Verifies a RevisionRef message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RevisionRef message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RevisionRef + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.RevisionRef; + + /** + * Creates a plain object from a RevisionRef message. Also converts values to other types if specified. + * @param message RevisionRef + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.RevisionRef, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RevisionRef to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RevisionRef + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RevisionRef { + + /** RevisionCase enum. */ + enum RevisionCase { + REVISION_CASE_UNSPECIFIED = 0, + LATEST_HUMAN_REVIEW = 1, + LATEST_TIMESTAMP = 2, + BASE_OCR_REVISION = 3 + } + } + + /** 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.v1beta3.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.v1beta3.IVertex): google.cloud.documentai.v1beta3.Vertex; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.INormalizedVertex): google.cloud.documentai.v1beta3.NormalizedVertex; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.IVertex[]|null); + + /** BoundingPoly normalizedVertices */ + normalizedVertices?: (google.cloud.documentai.v1beta3.INormalizedVertex[]|null); + } + + /** Represents a BoundingPoly. */ + class BoundingPoly implements IBoundingPoly { + + /** + * Constructs a new BoundingPoly. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IBoundingPoly); + + /** BoundingPoly vertices. */ + public vertices: google.cloud.documentai.v1beta3.IVertex[]; + + /** BoundingPoly normalizedVertices. */ + public normalizedVertices: google.cloud.documentai.v1beta3.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.v1beta3.IBoundingPoly): google.cloud.documentai.v1beta3.BoundingPoly; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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; + } + + /** Properties of a Documents. */ + interface IDocuments { + + /** Documents documents */ + documents?: (google.cloud.documentai.v1beta3.IDocument[]|null); + } + + /** Represents a Documents. */ + class Documents implements IDocuments { + + /** + * Constructs a new Documents. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDocuments); + + /** Documents documents. */ + public documents: google.cloud.documentai.v1beta3.IDocument[]; + + /** + * Creates a new Documents instance using the specified properties. + * @param [properties] Properties to set + * @returns Documents instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDocuments): google.cloud.documentai.v1beta3.Documents; + + /** + * Encodes the specified Documents message. Does not implicitly {@link google.cloud.documentai.v1beta3.Documents.verify|verify} messages. + * @param message Documents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Documents message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Documents.verify|verify} messages. + * @param message Documents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Documents message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Documents + * @throws {Error} If the payload is not a 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.v1beta3.Documents; + + /** + * Decodes a Documents message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Documents + * @throws {Error} If the payload is 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.v1beta3.Documents; + + /** + * Verifies a Documents message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Documents message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Documents + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Documents; + + /** + * Creates a plain object from a Documents message. Also converts values to other types if specified. + * @param message Documents + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Documents, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Documents to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Documents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RawDocument. */ + interface IRawDocument { + + /** RawDocument content */ + content?: (Uint8Array|Buffer|string|null); + + /** RawDocument mimeType */ + mimeType?: (string|null); + + /** RawDocument displayName */ + displayName?: (string|null); + } + + /** Represents a RawDocument. */ + class RawDocument implements IRawDocument { + + /** + * Constructs a new RawDocument. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IRawDocument); + + /** RawDocument content. */ + public content: (Uint8Array|Buffer|string); + + /** RawDocument mimeType. */ + public mimeType: string; + + /** RawDocument displayName. */ + public displayName: string; + + /** + * Creates a new RawDocument instance using the specified properties. + * @param [properties] Properties to set + * @returns RawDocument instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IRawDocument): google.cloud.documentai.v1beta3.RawDocument; + + /** + * Encodes the specified RawDocument message. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocument.verify|verify} messages. + * @param message RawDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IRawDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RawDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocument.verify|verify} messages. + * @param message RawDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IRawDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RawDocument message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RawDocument + * @throws {Error} If the payload is not a 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.v1beta3.RawDocument; + + /** + * Decodes a RawDocument message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RawDocument + * @throws {Error} If the payload is 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.v1beta3.RawDocument; + + /** + * Verifies a RawDocument message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RawDocument message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RawDocument + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.RawDocument; + + /** + * Creates a plain object from a RawDocument message. Also converts values to other types if specified. + * @param message RawDocument + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.RawDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RawDocument to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RawDocument + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDocument. */ + interface IGcsDocument { + + /** GcsDocument gcsUri */ + gcsUri?: (string|null); + + /** GcsDocument mimeType */ + mimeType?: (string|null); + } + + /** Represents a GcsDocument. */ + class GcsDocument implements IGcsDocument { + + /** + * Constructs a new GcsDocument. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGcsDocument); + + /** GcsDocument gcsUri. */ + public gcsUri: string; + + /** GcsDocument mimeType. */ + public mimeType: string; + + /** + * Creates a new GcsDocument instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDocument instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IGcsDocument): google.cloud.documentai.v1beta3.GcsDocument; + + /** + * Encodes the specified GcsDocument message. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocument.verify|verify} messages. + * @param message GcsDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IGcsDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocument.verify|verify} messages. + * @param message GcsDocument message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGcsDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDocument message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDocument + * @throws {Error} If the payload is not a 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.v1beta3.GcsDocument; + + /** + * Decodes a GcsDocument message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDocument + * @throws {Error} If the payload is 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.v1beta3.GcsDocument; + + /** + * Verifies a GcsDocument message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDocument message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDocument + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GcsDocument; + + /** + * Creates a plain object from a GcsDocument message. Also converts values to other types if specified. + * @param message GcsDocument + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.GcsDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDocument to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDocument + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDocuments. */ + interface IGcsDocuments { + + /** GcsDocuments documents */ + documents?: (google.cloud.documentai.v1beta3.IGcsDocument[]|null); + } + + /** Represents a GcsDocuments. */ + class GcsDocuments implements IGcsDocuments { + + /** + * Constructs a new GcsDocuments. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGcsDocuments); + + /** GcsDocuments documents. */ + public documents: google.cloud.documentai.v1beta3.IGcsDocument[]; + + /** + * Creates a new GcsDocuments instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDocuments instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IGcsDocuments): google.cloud.documentai.v1beta3.GcsDocuments; + + /** + * Encodes the specified GcsDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocuments.verify|verify} messages. + * @param message GcsDocuments message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IGcsDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocuments.verify|verify} messages. + * @param message GcsDocuments message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGcsDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsDocuments message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsDocuments + * @throws {Error} If the payload is not a 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.v1beta3.GcsDocuments; + + /** + * Decodes a GcsDocuments message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsDocuments + * @throws {Error} If the payload is 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.v1beta3.GcsDocuments; + + /** + * Verifies a GcsDocuments message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsDocuments message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsDocuments + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GcsDocuments; + + /** + * Creates a plain object from a GcsDocuments message. Also converts values to other types if specified. + * @param message GcsDocuments + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.GcsDocuments, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDocuments to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDocuments + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsPrefix. */ + interface IGcsPrefix { + + /** GcsPrefix gcsUriPrefix */ + gcsUriPrefix?: (string|null); + } + + /** Represents a GcsPrefix. */ + class GcsPrefix implements IGcsPrefix { + + /** + * Constructs a new GcsPrefix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGcsPrefix); + + /** GcsPrefix gcsUriPrefix. */ + public gcsUriPrefix: string; + + /** + * Creates a new GcsPrefix instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsPrefix instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IGcsPrefix): google.cloud.documentai.v1beta3.GcsPrefix; + + /** + * Encodes the specified GcsPrefix message. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsPrefix.verify|verify} messages. + * @param message GcsPrefix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IGcsPrefix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsPrefix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsPrefix.verify|verify} messages. + * @param message GcsPrefix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGcsPrefix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsPrefix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsPrefix + * @throws {Error} If the payload is not a 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.v1beta3.GcsPrefix; + + /** + * Decodes a GcsPrefix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsPrefix + * @throws {Error} If the payload is 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.v1beta3.GcsPrefix; + + /** + * Verifies a GcsPrefix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsPrefix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsPrefix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GcsPrefix; + + /** + * Creates a plain object from a GcsPrefix message. Also converts values to other types if specified. + * @param message GcsPrefix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.GcsPrefix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsPrefix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsPrefix + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RawDocuments. */ + interface IRawDocuments { + + /** RawDocuments documents */ + documents?: (google.cloud.documentai.v1beta3.IRawDocument[]|null); + } + + /** Represents a RawDocuments. */ + class RawDocuments implements IRawDocuments { + + /** + * Constructs a new RawDocuments. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IRawDocuments); + + /** RawDocuments documents. */ + public documents: google.cloud.documentai.v1beta3.IRawDocument[]; + + /** + * Creates a new RawDocuments instance using the specified properties. + * @param [properties] Properties to set + * @returns RawDocuments instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IRawDocuments): google.cloud.documentai.v1beta3.RawDocuments; + + /** + * Encodes the specified RawDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocuments.verify|verify} messages. + * @param message RawDocuments message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IRawDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RawDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocuments.verify|verify} messages. + * @param message RawDocuments message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IRawDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RawDocuments message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RawDocuments + * @throws {Error} If the payload is not a 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.v1beta3.RawDocuments; + + /** + * Decodes a RawDocuments message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RawDocuments + * @throws {Error} If the payload is 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.v1beta3.RawDocuments; + + /** + * Verifies a RawDocuments message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RawDocuments message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RawDocuments + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.RawDocuments; + + /** + * Creates a plain object from a RawDocuments message. Also converts values to other types if specified. + * @param message RawDocuments + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.RawDocuments, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RawDocuments to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RawDocuments + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDocumentsInputConfig. */ + interface IBatchDocumentsInputConfig { + + /** BatchDocumentsInputConfig gcsPrefix */ + gcsPrefix?: (google.cloud.documentai.v1beta3.IGcsPrefix|null); + + /** BatchDocumentsInputConfig gcsDocuments */ + gcsDocuments?: (google.cloud.documentai.v1beta3.IGcsDocuments|null); + } + + /** Represents a BatchDocumentsInputConfig. */ + class BatchDocumentsInputConfig implements IBatchDocumentsInputConfig { + + /** + * Constructs a new BatchDocumentsInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig); + + /** BatchDocumentsInputConfig gcsPrefix. */ + public gcsPrefix?: (google.cloud.documentai.v1beta3.IGcsPrefix|null); + + /** BatchDocumentsInputConfig gcsDocuments. */ + public gcsDocuments?: (google.cloud.documentai.v1beta3.IGcsDocuments|null); + + /** BatchDocumentsInputConfig source. */ + public source?: ("gcsPrefix"|"gcsDocuments"); + + /** + * Creates a new BatchDocumentsInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDocumentsInputConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig): google.cloud.documentai.v1beta3.BatchDocumentsInputConfig; + + /** + * Encodes the specified BatchDocumentsInputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify|verify} messages. + * @param message BatchDocumentsInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDocumentsInputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify|verify} messages. + * @param message BatchDocumentsInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDocumentsInputConfig + * @throws {Error} If the payload is not a 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.v1beta3.BatchDocumentsInputConfig; + + /** + * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDocumentsInputConfig + * @throws {Error} If the payload is 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.v1beta3.BatchDocumentsInputConfig; + + /** + * Verifies a BatchDocumentsInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDocumentsInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDocumentsInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDocumentsInputConfig; + + /** + * Creates a plain object from a BatchDocumentsInputConfig message. Also converts values to other types if specified. + * @param message BatchDocumentsInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchDocumentsInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDocumentsInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDocumentsInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentOutputConfig. */ + interface IDocumentOutputConfig { + + /** DocumentOutputConfig gcsOutputConfig */ + gcsOutputConfig?: (google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null); + } + + /** Represents a DocumentOutputConfig. */ + class DocumentOutputConfig implements IDocumentOutputConfig { + + /** + * Constructs a new DocumentOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDocumentOutputConfig); + + /** DocumentOutputConfig gcsOutputConfig. */ + public gcsOutputConfig?: (google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null); + + /** DocumentOutputConfig destination. */ + public destination?: "gcsOutputConfig"; + + /** + * Creates a new DocumentOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentOutputConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDocumentOutputConfig): google.cloud.documentai.v1beta3.DocumentOutputConfig; + + /** + * Encodes the specified DocumentOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.verify|verify} messages. + * @param message DocumentOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.verify|verify} messages. + * @param message DocumentOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentOutputConfig + * @throws {Error} If the payload is not a 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.v1beta3.DocumentOutputConfig; + + /** + * Decodes a DocumentOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentOutputConfig + * @throws {Error} If the payload is 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.v1beta3.DocumentOutputConfig; + + /** + * Verifies a DocumentOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentOutputConfig; + + /** + * Creates a plain object from a DocumentOutputConfig message. Also converts values to other types if specified. + * @param message DocumentOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DocumentOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DocumentOutputConfig { + + /** Properties of a GcsOutputConfig. */ + interface IGcsOutputConfig { + + /** GcsOutputConfig gcsUri */ + gcsUri?: (string|null); + + /** GcsOutputConfig fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** GcsOutputConfig shardingConfig */ + shardingConfig?: (google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null); + } + + /** Represents a GcsOutputConfig. */ + class GcsOutputConfig implements IGcsOutputConfig { + + /** + * Constructs a new GcsOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig); + + /** GcsOutputConfig gcsUri. */ + public gcsUri: string; + + /** GcsOutputConfig fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** GcsOutputConfig shardingConfig. */ + public shardingConfig?: (google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null); + + /** + * Creates a new GcsOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsOutputConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig; + + /** + * Encodes the specified GcsOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. + * @param message GcsOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. + * @param message GcsOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsOutputConfig + * @throws {Error} If the payload is not a 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.v1beta3.DocumentOutputConfig.GcsOutputConfig; + + /** + * Decodes a GcsOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsOutputConfig + * @throws {Error} If the payload is 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.v1beta3.DocumentOutputConfig.GcsOutputConfig; + + /** + * Verifies a GcsOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig; + + /** + * Creates a plain object from a GcsOutputConfig message. Also converts values to other types if specified. + * @param message GcsOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GcsOutputConfig { + + /** Properties of a ShardingConfig. */ + interface IShardingConfig { + + /** ShardingConfig pagesPerShard */ + pagesPerShard?: (number|null); + + /** ShardingConfig pagesOverlap */ + pagesOverlap?: (number|null); + } + + /** Represents a ShardingConfig. */ + class ShardingConfig implements IShardingConfig { + + /** + * Constructs a new ShardingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig); + + /** ShardingConfig pagesPerShard. */ + public pagesPerShard: number; + + /** ShardingConfig pagesOverlap. */ + public pagesOverlap: number; + + /** + * Creates a new ShardingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardingConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; + + /** + * Encodes the specified ShardingConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. + * @param message ShardingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShardingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. + * @param message ShardingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShardingConfig + * @throws {Error} If the payload is not a 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.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; + + /** + * Decodes a ShardingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShardingConfig + * @throws {Error} If the payload is 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.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; + + /** + * Verifies a ShardingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShardingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShardingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; + + /** + * Creates a plain object from a ShardingConfig message. Also converts values to other types if specified. + * @param message ShardingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShardingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShardingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an OcrConfig. */ + interface IOcrConfig { + + /** OcrConfig hints */ + hints?: (google.cloud.documentai.v1beta3.OcrConfig.IHints|null); + + /** OcrConfig enableNativePdfParsing */ + enableNativePdfParsing?: (boolean|null); + + /** OcrConfig enableImageQualityScores */ + enableImageQualityScores?: (boolean|null); + + /** OcrConfig advancedOcrOptions */ + advancedOcrOptions?: (string[]|null); + + /** OcrConfig enableSymbol */ + enableSymbol?: (boolean|null); + + /** OcrConfig computeStyleInfo */ + computeStyleInfo?: (boolean|null); + + /** OcrConfig disableCharacterBoxesDetection */ + disableCharacterBoxesDetection?: (boolean|null); + + /** OcrConfig premiumFeatures */ + premiumFeatures?: (google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures|null); + } + + /** Represents an OcrConfig. */ + class OcrConfig implements IOcrConfig { + + /** + * Constructs a new OcrConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IOcrConfig); + + /** OcrConfig hints. */ + public hints?: (google.cloud.documentai.v1beta3.OcrConfig.IHints|null); + + /** OcrConfig enableNativePdfParsing. */ + public enableNativePdfParsing: boolean; + + /** OcrConfig enableImageQualityScores. */ + public enableImageQualityScores: boolean; + + /** OcrConfig advancedOcrOptions. */ + public advancedOcrOptions: string[]; + + /** OcrConfig enableSymbol. */ + public enableSymbol: boolean; + + /** OcrConfig computeStyleInfo. */ + public computeStyleInfo: boolean; + + /** OcrConfig disableCharacterBoxesDetection. */ + public disableCharacterBoxesDetection: boolean; + + /** OcrConfig premiumFeatures. */ + public premiumFeatures?: (google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures|null); + + /** + * Creates a new OcrConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OcrConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IOcrConfig): google.cloud.documentai.v1beta3.OcrConfig; + + /** + * Encodes the specified OcrConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. + * @param message OcrConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IOcrConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OcrConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. + * @param message OcrConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IOcrConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OcrConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OcrConfig + * @throws {Error} If the payload is not a 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.v1beta3.OcrConfig; + + /** + * Decodes an OcrConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OcrConfig + * @throws {Error} If the payload is 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.v1beta3.OcrConfig; + + /** + * Verifies an OcrConfig message. + * @param message Plain 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 OcrConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OcrConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.OcrConfig; + + /** + * Creates a plain object from an OcrConfig message. Also converts values to other types if specified. + * @param message OcrConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.OcrConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OcrConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OcrConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OcrConfig { + + /** Properties of a Hints. */ + interface IHints { + + /** Hints languageHints */ + languageHints?: (string[]|null); + } + + /** Represents a Hints. */ + class Hints implements IHints { + + /** + * Constructs a new Hints. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.OcrConfig.IHints); + + /** Hints languageHints. */ + public languageHints: string[]; + + /** + * Creates a new Hints instance using the specified properties. + * @param [properties] Properties to set + * @returns Hints instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.OcrConfig.IHints): google.cloud.documentai.v1beta3.OcrConfig.Hints; + + /** + * Encodes the specified Hints message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.Hints.verify|verify} messages. + * @param message Hints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.OcrConfig.IHints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Hints message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.Hints.verify|verify} messages. + * @param message Hints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.OcrConfig.IHints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Hints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Hints + * @throws {Error} If the payload is not a 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.v1beta3.OcrConfig.Hints; + + /** + * Decodes a Hints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Hints + * @throws {Error} If the payload is 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.v1beta3.OcrConfig.Hints; + + /** + * Verifies a Hints message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Hints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Hints + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.OcrConfig.Hints; + + /** + * Creates a plain object from a Hints message. Also converts values to other types if specified. + * @param message Hints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.OcrConfig.Hints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Hints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Hints + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PremiumFeatures. */ + interface IPremiumFeatures { + + /** PremiumFeatures enableSelectionMarkDetection */ + enableSelectionMarkDetection?: (boolean|null); + + /** PremiumFeatures computeStyleInfo */ + computeStyleInfo?: (boolean|null); + + /** PremiumFeatures enableMathOcr */ + enableMathOcr?: (boolean|null); + } + + /** Represents a PremiumFeatures. */ + class PremiumFeatures implements IPremiumFeatures { + + /** + * Constructs a new PremiumFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures); + + /** PremiumFeatures enableSelectionMarkDetection. */ + public enableSelectionMarkDetection: boolean; + + /** PremiumFeatures computeStyleInfo. */ + public computeStyleInfo: boolean; + + /** PremiumFeatures enableMathOcr. */ + public enableMathOcr: boolean; + + /** + * Creates a new PremiumFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns PremiumFeatures instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures): google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures; + + /** + * Encodes the specified PremiumFeatures message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify|verify} messages. + * @param message PremiumFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PremiumFeatures message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify|verify} messages. + * @param message PremiumFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PremiumFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PremiumFeatures + * @throws {Error} If the payload is not a 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.v1beta3.OcrConfig.PremiumFeatures; + + /** + * Decodes a PremiumFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PremiumFeatures + * @throws {Error} If the payload is 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.v1beta3.OcrConfig.PremiumFeatures; + + /** + * Verifies a PremiumFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PremiumFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PremiumFeatures + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures; + + /** + * Creates a plain object from a PremiumFeatures message. Also converts values to other types if specified. + * @param message PremiumFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PremiumFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PremiumFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SummaryOptions. */ + interface ISummaryOptions { + + /** SummaryOptions length */ + length?: (google.cloud.documentai.v1beta3.SummaryOptions.Length|keyof typeof google.cloud.documentai.v1beta3.SummaryOptions.Length|null); + + /** SummaryOptions format */ + format?: (google.cloud.documentai.v1beta3.SummaryOptions.Format|keyof typeof google.cloud.documentai.v1beta3.SummaryOptions.Format|null); + } + + /** Represents a SummaryOptions. */ + class SummaryOptions implements ISummaryOptions { + + /** + * Constructs a new SummaryOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ISummaryOptions); + + /** SummaryOptions length. */ + public length: (google.cloud.documentai.v1beta3.SummaryOptions.Length|keyof typeof google.cloud.documentai.v1beta3.SummaryOptions.Length); + + /** SummaryOptions format. */ + public format: (google.cloud.documentai.v1beta3.SummaryOptions.Format|keyof typeof google.cloud.documentai.v1beta3.SummaryOptions.Format); + + /** + * Creates a new SummaryOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns SummaryOptions instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ISummaryOptions): google.cloud.documentai.v1beta3.SummaryOptions; + + /** + * Encodes the specified SummaryOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.SummaryOptions.verify|verify} messages. + * @param message SummaryOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ISummaryOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SummaryOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SummaryOptions.verify|verify} messages. + * @param message SummaryOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ISummaryOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SummaryOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SummaryOptions + * @throws {Error} If the payload is not a 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.v1beta3.SummaryOptions; + + /** + * Decodes a SummaryOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SummaryOptions + * @throws {Error} If the payload is 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.v1beta3.SummaryOptions; + + /** + * Verifies a SummaryOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SummaryOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SummaryOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.SummaryOptions; + + /** + * Creates a plain object from a SummaryOptions message. Also converts values to other types if specified. + * @param message SummaryOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.SummaryOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SummaryOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SummaryOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SummaryOptions { + + /** Length enum. */ + enum Length { + LENGTH_UNSPECIFIED = 0, + BRIEF = 1, + MODERATE = 2, + COMPREHENSIVE = 3 + } + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + PARAGRAPH = 1, + BULLETS = 2 + } + } + + /** Properties of a FieldExtractionMetadata. */ + interface IFieldExtractionMetadata { + + /** FieldExtractionMetadata summaryOptions */ + summaryOptions?: (google.cloud.documentai.v1beta3.ISummaryOptions|null); + } + + /** Represents a FieldExtractionMetadata. */ + class FieldExtractionMetadata implements IFieldExtractionMetadata { + + /** + * Constructs a new FieldExtractionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IFieldExtractionMetadata); + + /** FieldExtractionMetadata summaryOptions. */ + public summaryOptions?: (google.cloud.documentai.v1beta3.ISummaryOptions|null); + + /** + * Creates a new FieldExtractionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldExtractionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IFieldExtractionMetadata): google.cloud.documentai.v1beta3.FieldExtractionMetadata; + + /** + * Encodes the specified FieldExtractionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.FieldExtractionMetadata.verify|verify} messages. + * @param message FieldExtractionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IFieldExtractionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldExtractionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.FieldExtractionMetadata.verify|verify} messages. + * @param message FieldExtractionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IFieldExtractionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldExtractionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldExtractionMetadata + * @throws {Error} If the payload is not a 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.v1beta3.FieldExtractionMetadata; + + /** + * Decodes a FieldExtractionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldExtractionMetadata + * @throws {Error} If the payload is 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.v1beta3.FieldExtractionMetadata; + + /** + * Verifies a FieldExtractionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldExtractionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldExtractionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.FieldExtractionMetadata; + + /** + * Creates a plain object from a FieldExtractionMetadata message. Also converts values to other types if specified. + * @param message FieldExtractionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.FieldExtractionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldExtractionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldExtractionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PropertyMetadata. */ + interface IPropertyMetadata { + + /** PropertyMetadata inactive */ + inactive?: (boolean|null); + + /** PropertyMetadata fieldExtractionMetadata */ + fieldExtractionMetadata?: (google.cloud.documentai.v1beta3.IFieldExtractionMetadata|null); + } + + /** Represents a PropertyMetadata. */ + class PropertyMetadata implements IPropertyMetadata { + + /** + * Constructs a new PropertyMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IPropertyMetadata); + + /** PropertyMetadata inactive. */ + public inactive: boolean; + + /** PropertyMetadata fieldExtractionMetadata. */ + public fieldExtractionMetadata?: (google.cloud.documentai.v1beta3.IFieldExtractionMetadata|null); + + /** + * Creates a new PropertyMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns PropertyMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IPropertyMetadata): google.cloud.documentai.v1beta3.PropertyMetadata; + + /** + * Encodes the specified PropertyMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.PropertyMetadata.verify|verify} messages. + * @param message PropertyMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IPropertyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PropertyMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.PropertyMetadata.verify|verify} messages. + * @param message PropertyMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IPropertyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PropertyMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PropertyMetadata + * @throws {Error} If the payload is not a 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.v1beta3.PropertyMetadata; + + /** + * Decodes a PropertyMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PropertyMetadata + * @throws {Error} If the payload is 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.v1beta3.PropertyMetadata; + + /** + * Verifies a PropertyMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PropertyMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PropertyMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.PropertyMetadata; + + /** + * Creates a plain object from a PropertyMetadata message. Also converts values to other types if specified. + * @param message PropertyMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.PropertyMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PropertyMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PropertyMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EntityTypeMetadata. */ + interface IEntityTypeMetadata { + + /** EntityTypeMetadata inactive */ + inactive?: (boolean|null); + } + + /** Represents an EntityTypeMetadata. */ + class EntityTypeMetadata implements IEntityTypeMetadata { + + /** + * Constructs a new EntityTypeMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IEntityTypeMetadata); + + /** EntityTypeMetadata inactive. */ + public inactive: boolean; + + /** + * Creates a new EntityTypeMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityTypeMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IEntityTypeMetadata): google.cloud.documentai.v1beta3.EntityTypeMetadata; + + /** + * Encodes the specified EntityTypeMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.EntityTypeMetadata.verify|verify} messages. + * @param message EntityTypeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IEntityTypeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityTypeMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EntityTypeMetadata.verify|verify} messages. + * @param message EntityTypeMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEntityTypeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityTypeMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityTypeMetadata + * @throws {Error} If the payload is not a 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.v1beta3.EntityTypeMetadata; + + /** + * Decodes an EntityTypeMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityTypeMetadata + * @throws {Error} If the payload is 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.v1beta3.EntityTypeMetadata; + + /** + * Verifies an EntityTypeMetadata message. + * @param message Plain 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 EntityTypeMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityTypeMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EntityTypeMetadata; + + /** + * Creates a plain object from an EntityTypeMetadata message. Also converts values to other types if specified. + * @param message EntityTypeMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.EntityTypeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityTypeMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityTypeMetadata + * @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 displayName */ + displayName?: (string|null); + + /** DocumentSchema description */ + description?: (string|null); + + /** DocumentSchema entityTypes */ + entityTypes?: (google.cloud.documentai.v1beta3.DocumentSchema.IEntityType[]|null); + + /** DocumentSchema metadata */ + metadata?: (google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null); + + /** DocumentSchema documentPrompt */ + documentPrompt?: (string|null); + } + + /** Represents a DocumentSchema. */ + class DocumentSchema implements IDocumentSchema { + + /** + * Constructs a new DocumentSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDocumentSchema); + + /** DocumentSchema displayName. */ + public displayName: string; + + /** DocumentSchema description. */ + public description: string; + + /** DocumentSchema entityTypes. */ + public entityTypes: google.cloud.documentai.v1beta3.DocumentSchema.IEntityType[]; + + /** DocumentSchema metadata. */ + public metadata?: (google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null); + + /** DocumentSchema documentPrompt. */ + public documentPrompt: string; + + /** + * Creates a new DocumentSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentSchema instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDocumentSchema): google.cloud.documentai.v1beta3.DocumentSchema; + + /** + * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.documentai.v1beta3.IDocumentSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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; + } + + namespace DocumentSchema { + + /** Properties of an EntityType. */ + interface IEntityType { + + /** EntityType enumValues */ + enumValues?: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues|null); + + /** EntityType displayName */ + displayName?: (string|null); + + /** EntityType name */ + name?: (string|null); + + /** EntityType description */ + description?: (string|null); + + /** EntityType baseTypes */ + baseTypes?: (string[]|null); + + /** EntityType properties */ + properties?: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty[]|null); + + /** EntityType entityTypeMetadata */ + entityTypeMetadata?: (google.cloud.documentai.v1beta3.IEntityTypeMetadata|null); + } + + /** Represents an EntityType. */ + class EntityType implements IEntityType { + + /** + * Constructs a new EntityType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.DocumentSchema.IEntityType); + + /** EntityType enumValues. */ + public enumValues?: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues|null); + + /** EntityType displayName. */ + public displayName: string; + + /** EntityType name. */ + public name: string; + + /** EntityType description. */ + public description: string; + + /** EntityType baseTypes. */ + public baseTypes: string[]; + + /** EntityType properties. */ + public properties: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty[]; + + /** EntityType entityTypeMetadata. */ + public entityTypeMetadata?: (google.cloud.documentai.v1beta3.IEntityTypeMetadata|null); + + /** EntityType valueSource. */ + public valueSource?: "enumValues"; + + /** + * Creates a new EntityType instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityType instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.DocumentSchema.IEntityType): google.cloud.documentai.v1beta3.DocumentSchema.EntityType; + + /** + * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.verify|verify} messages. + * @param message EntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.DocumentSchema.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.verify|verify} messages. + * @param message EntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentSchema.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EntityType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityType + * @throws {Error} If the payload is not a 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.v1beta3.DocumentSchema.EntityType; + + /** + * Decodes an EntityType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityType + * @throws {Error} If the payload is 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.v1beta3.DocumentSchema.EntityType; + + /** + * Verifies an EntityType message. + * @param message Plain 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 EntityType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentSchema.EntityType; + + /** + * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * @param message EntityType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EntityType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EntityType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EntityType { + + /** Properties of an EnumValues. */ + interface IEnumValues { + + /** EnumValues values */ + values?: (string[]|null); + } + + /** Represents an EnumValues. */ + class EnumValues implements IEnumValues { + + /** + * Constructs a new EnumValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues); + + /** EnumValues values. */ + public values: string[]; + + /** + * Creates a new EnumValues instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValues instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues; + + /** + * Encodes the specified EnumValues message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.verify|verify} messages. + * @param message EnumValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValues message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.verify|verify} messages. + * @param message EnumValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValues + * @throws {Error} If the payload is not a 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.v1beta3.DocumentSchema.EntityType.EnumValues; + + /** + * Decodes an EnumValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValues + * @throws {Error} If the payload is 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.v1beta3.DocumentSchema.EntityType.EnumValues; + + /** + * Verifies an EnumValues message. + * @param message Plain 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 EnumValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues; + + /** + * Creates a plain object from an EnumValues message. Also converts values to other types if specified. + * @param message EnumValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValues + * @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 description */ + description?: (string|null); + + /** Property displayName */ + displayName?: (string|null); + + /** Property valueType */ + valueType?: (string|null); + + /** Property occurrenceType */ + occurrenceType?: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|keyof typeof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|null); + + /** Property method */ + method?: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method|keyof typeof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method|null); + + /** Property propertyMetadata */ + propertyMetadata?: (google.cloud.documentai.v1beta3.IPropertyMetadata|null); + } + + /** Represents a Property. */ + class Property implements IProperty { + + /** + * Constructs a new Property. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty); + + /** Property name. */ + public name: string; + + /** Property description. */ + public description: string; + + /** Property displayName. */ + public displayName: string; + + /** Property valueType. */ + public valueType: string; + + /** Property occurrenceType. */ + public occurrenceType: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|keyof typeof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType); + + /** Property method. */ + public method: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method|keyof typeof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method); + + /** Property propertyMetadata. */ + public propertyMetadata?: (google.cloud.documentai.v1beta3.IPropertyMetadata|null); + + /** + * Creates a new Property instance using the specified properties. + * @param [properties] Properties to set + * @returns Property instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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; + } + + namespace Property { + + /** OccurrenceType enum. */ + enum OccurrenceType { + OCCURRENCE_TYPE_UNSPECIFIED = 0, + OPTIONAL_ONCE = 1, + OPTIONAL_MULTIPLE = 2, + REQUIRED_ONCE = 3, + REQUIRED_MULTIPLE = 4 + } + + /** Method enum. */ + enum Method { + METHOD_UNSPECIFIED = 0, + EXTRACT = 1, + DERIVE = 2 + } + } + } + + /** Properties of a Metadata. */ + interface IMetadata { + + /** Metadata documentSplitter */ + documentSplitter?: (boolean|null); + + /** Metadata documentAllowMultipleLabels */ + documentAllowMultipleLabels?: (boolean|null); + + /** Metadata prefixedNamingOnProperties */ + prefixedNamingOnProperties?: (boolean|null); + + /** Metadata skipNamingValidation */ + skipNamingValidation?: (boolean|null); + } + + /** Represents a Metadata. */ + class Metadata implements IMetadata { + + /** + * Constructs a new Metadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.DocumentSchema.IMetadata); + + /** Metadata documentSplitter. */ + public documentSplitter: boolean; + + /** Metadata documentAllowMultipleLabels. */ + public documentAllowMultipleLabels: boolean; + + /** Metadata prefixedNamingOnProperties. */ + public prefixedNamingOnProperties: boolean; + + /** Metadata skipNamingValidation. */ + public skipNamingValidation: boolean; + + /** + * Creates a new Metadata instance using the specified properties. + * @param [properties] Properties to set + * @returns Metadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.DocumentSchema.IMetadata): google.cloud.documentai.v1beta3.DocumentSchema.Metadata; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.DocumentSchema.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentSchema.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metadata + * @throws {Error} If the payload is not a 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.v1beta3.DocumentSchema.Metadata; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metadata + * @throws {Error} If the payload is 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.v1beta3.DocumentSchema.Metadata; + + /** + * Verifies a Metadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentSchema.Metadata; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @param message Metadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DocumentSchema.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Represents a DocumentProcessorService */ + class DocumentProcessorService extends $protobuf.rpc.Service { + + /** + * Constructs a new DocumentProcessorService 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 DocumentProcessorService 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): DocumentProcessorService; + + /** + * Calls ProcessDocument. + * @param request ProcessRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProcessResponse + */ + public processDocument(request: google.cloud.documentai.v1beta3.IProcessRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocumentCallback): void; + + /** + * Calls ProcessDocument. + * @param request ProcessRequest message or plain object + * @returns Promise + */ + public processDocument(request: google.cloud.documentai.v1beta3.IProcessRequest): Promise; + + /** + * Calls BatchProcessDocuments. + * @param request BatchProcessRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchProcessDocuments(request: google.cloud.documentai.v1beta3.IBatchProcessRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocumentsCallback): void; + + /** + * Calls BatchProcessDocuments. + * @param request BatchProcessRequest message or plain object + * @returns Promise + */ + public batchProcessDocuments(request: google.cloud.documentai.v1beta3.IBatchProcessRequest): Promise; + + /** + * Calls FetchProcessorTypes. + * @param request FetchProcessorTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchProcessorTypesResponse + */ + public fetchProcessorTypes(request: google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypesCallback): void; + + /** + * Calls FetchProcessorTypes. + * @param request FetchProcessorTypesRequest message or plain object + * @returns Promise + */ + public fetchProcessorTypes(request: google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest): Promise; + + /** + * Calls ListProcessorTypes. + * @param request ListProcessorTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProcessorTypesResponse + */ + public listProcessorTypes(request: google.cloud.documentai.v1beta3.IListProcessorTypesRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypesCallback): void; + + /** + * Calls ListProcessorTypes. + * @param request ListProcessorTypesRequest message or plain object + * @returns Promise + */ + public listProcessorTypes(request: google.cloud.documentai.v1beta3.IListProcessorTypesRequest): Promise; + + /** + * Calls GetProcessorType. + * @param request GetProcessorTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProcessorType + */ + public getProcessorType(request: google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorTypeCallback): void; + + /** + * Calls GetProcessorType. + * @param request GetProcessorTypeRequest message or plain object + * @returns Promise + */ + public getProcessorType(request: google.cloud.documentai.v1beta3.IGetProcessorTypeRequest): Promise; + + /** + * Calls ListProcessors. + * @param request ListProcessorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProcessorsResponse + */ + public listProcessors(request: google.cloud.documentai.v1beta3.IListProcessorsRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorsCallback): void; + + /** + * Calls ListProcessors. + * @param request ListProcessorsRequest message or plain object + * @returns Promise + */ + public listProcessors(request: google.cloud.documentai.v1beta3.IListProcessorsRequest): Promise; + + /** + * Calls GetProcessor. + * @param request GetProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Processor + */ + public getProcessor(request: google.cloud.documentai.v1beta3.IGetProcessorRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorCallback): void; + + /** + * Calls GetProcessor. + * @param request GetProcessorRequest message or plain object + * @returns Promise + */ + public getProcessor(request: google.cloud.documentai.v1beta3.IGetProcessorRequest): Promise; + + /** + * Calls TrainProcessorVersion. + * @param request TrainProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public trainProcessorVersion(request: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersionCallback): void; + + /** + * Calls TrainProcessorVersion. + * @param request TrainProcessorVersionRequest message or plain object + * @returns Promise + */ + public trainProcessorVersion(request: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest): Promise; + + /** + * Calls GetProcessorVersion. + * @param request GetProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProcessorVersion + */ + public getProcessorVersion(request: google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersionCallback): void; + + /** + * Calls GetProcessorVersion. + * @param request GetProcessorVersionRequest message or plain object + * @returns Promise + */ + public getProcessorVersion(request: google.cloud.documentai.v1beta3.IGetProcessorVersionRequest): Promise; + + /** + * Calls ListProcessorVersions. + * @param request ListProcessorVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListProcessorVersionsResponse + */ + public listProcessorVersions(request: google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersionsCallback): void; + + /** + * Calls ListProcessorVersions. + * @param request ListProcessorVersionsRequest message or plain object + * @returns Promise + */ + public listProcessorVersions(request: google.cloud.documentai.v1beta3.IListProcessorVersionsRequest): Promise; + + /** + * Calls DeleteProcessorVersion. + * @param request DeleteProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteProcessorVersion(request: google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersionCallback): void; + + /** + * Calls DeleteProcessorVersion. + * @param request DeleteProcessorVersionRequest message or plain object + * @returns Promise + */ + public deleteProcessorVersion(request: google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest): Promise; + + /** + * Calls DeployProcessorVersion. + * @param request DeployProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deployProcessorVersion(request: google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersionCallback): void; + + /** + * Calls DeployProcessorVersion. + * @param request DeployProcessorVersionRequest message or plain object + * @returns Promise + */ + public deployProcessorVersion(request: google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest): Promise; + + /** + * Calls UndeployProcessorVersion. + * @param request UndeployProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeployProcessorVersion(request: google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersionCallback): void; + + /** + * Calls UndeployProcessorVersion. + * @param request UndeployProcessorVersionRequest message or plain object + * @returns Promise + */ + public undeployProcessorVersion(request: google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest): Promise; + + /** + * Calls CreateProcessor. + * @param request CreateProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Processor + */ + public createProcessor(request: google.cloud.documentai.v1beta3.ICreateProcessorRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessorCallback): void; + + /** + * Calls CreateProcessor. + * @param request CreateProcessorRequest message or plain object + * @returns Promise + */ + public createProcessor(request: google.cloud.documentai.v1beta3.ICreateProcessorRequest): Promise; + + /** + * Calls DeleteProcessor. + * @param request DeleteProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteProcessor(request: google.cloud.documentai.v1beta3.IDeleteProcessorRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorCallback): void; + + /** + * Calls DeleteProcessor. + * @param request DeleteProcessorRequest message or plain object + * @returns Promise + */ + public deleteProcessor(request: google.cloud.documentai.v1beta3.IDeleteProcessorRequest): Promise; + + /** + * Calls EnableProcessor. + * @param request EnableProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public enableProcessor(request: google.cloud.documentai.v1beta3.IEnableProcessorRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessorCallback): void; + + /** + * Calls EnableProcessor. + * @param request EnableProcessorRequest message or plain object + * @returns Promise + */ + public enableProcessor(request: google.cloud.documentai.v1beta3.IEnableProcessorRequest): Promise; + + /** + * Calls DisableProcessor. + * @param request DisableProcessorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public disableProcessor(request: google.cloud.documentai.v1beta3.IDisableProcessorRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessorCallback): void; + + /** + * Calls DisableProcessor. + * @param request DisableProcessorRequest message or plain object + * @returns Promise + */ + public disableProcessor(request: google.cloud.documentai.v1beta3.IDisableProcessorRequest): Promise; + + /** + * Calls SetDefaultProcessorVersion. + * @param request SetDefaultProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setDefaultProcessorVersion(request: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersionCallback): void; + + /** + * Calls SetDefaultProcessorVersion. + * @param request SetDefaultProcessorVersionRequest message or plain object + * @returns Promise + */ + public setDefaultProcessorVersion(request: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest): Promise; + + /** + * Calls ReviewDocument. + * @param request ReviewDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public reviewDocument(request: google.cloud.documentai.v1beta3.IReviewDocumentRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocumentCallback): void; + + /** + * Calls ReviewDocument. + * @param request ReviewDocumentRequest message or plain object + * @returns Promise + */ + public reviewDocument(request: google.cloud.documentai.v1beta3.IReviewDocumentRequest): Promise; + + /** + * Calls EvaluateProcessorVersion. + * @param request EvaluateProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public evaluateProcessorVersion(request: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersionCallback): void; + + /** + * Calls EvaluateProcessorVersion. + * @param request EvaluateProcessorVersionRequest message or plain object + * @returns Promise + */ + public evaluateProcessorVersion(request: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest): Promise; + + /** + * Calls GetEvaluation. + * @param request GetEvaluationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Evaluation + */ + public getEvaluation(request: google.cloud.documentai.v1beta3.IGetEvaluationRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluationCallback): void; + + /** + * Calls GetEvaluation. + * @param request GetEvaluationRequest message or plain object + * @returns Promise + */ + public getEvaluation(request: google.cloud.documentai.v1beta3.IGetEvaluationRequest): Promise; + + /** + * Calls ListEvaluations. + * @param request ListEvaluationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEvaluationsResponse + */ + public listEvaluations(request: google.cloud.documentai.v1beta3.IListEvaluationsRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluationsCallback): void; + + /** + * Calls ListEvaluations. + * @param request ListEvaluationsRequest message or plain object + * @returns Promise + */ + public listEvaluations(request: google.cloud.documentai.v1beta3.IListEvaluationsRequest): Promise; + + /** + * Calls ImportProcessorVersion. + * @param request ImportProcessorVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importProcessorVersion(request: google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersionCallback): void; + + /** + * Calls ImportProcessorVersion. + * @param request ImportProcessorVersionRequest message or plain object + * @returns Promise + */ + public importProcessorVersion(request: google.cloud.documentai.v1beta3.IImportProcessorVersionRequest): Promise; + } + + namespace DocumentProcessorService { + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|processDocument}. + * @param error Error, if any + * @param [response] ProcessResponse + */ + type ProcessDocumentCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ProcessResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|batchProcessDocuments}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchProcessDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|fetchProcessorTypes}. + * @param error Error, if any + * @param [response] FetchProcessorTypesResponse + */ + type FetchProcessorTypesCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.FetchProcessorTypesResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listProcessorTypes}. + * @param error Error, if any + * @param [response] ListProcessorTypesResponse + */ + type ListProcessorTypesCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ListProcessorTypesResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getProcessorType}. + * @param error Error, if any + * @param [response] ProcessorType + */ + type GetProcessorTypeCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ProcessorType) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listProcessors}. + * @param error Error, if any + * @param [response] ListProcessorsResponse + */ + type ListProcessorsCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ListProcessorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getProcessor}. + * @param error Error, if any + * @param [response] Processor + */ + type GetProcessorCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.Processor) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|trainProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type TrainProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getProcessorVersion}. + * @param error Error, if any + * @param [response] ProcessorVersion + */ + type GetProcessorVersionCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ProcessorVersion) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listProcessorVersions}. + * @param error Error, if any + * @param [response] ListProcessorVersionsResponse + */ + type ListProcessorVersionsCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|deleteProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|deployProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type DeployProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|undeployProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeployProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|createProcessor}. + * @param error Error, if any + * @param [response] Processor + */ + type CreateProcessorCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.Processor) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|deleteProcessor}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|enableProcessor}. + * @param error Error, if any + * @param [response] Operation + */ + type EnableProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|disableProcessor}. + * @param error Error, if any + * @param [response] Operation + */ + type DisableProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|setDefaultProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type SetDefaultProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|reviewDocument}. + * @param error Error, if any + * @param [response] Operation + */ + type ReviewDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|evaluateProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type EvaluateProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getEvaluation}. + * @param error Error, if any + * @param [response] Evaluation + */ + type GetEvaluationCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.Evaluation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listEvaluations}. + * @param error Error, if any + * @param [response] ListEvaluationsResponse + */ + type ListEvaluationsCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ListEvaluationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|importProcessorVersion}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ProcessOptions. */ + interface IProcessOptions { + + /** ProcessOptions individualPageSelector */ + individualPageSelector?: (google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector|null); + + /** ProcessOptions fromStart */ + fromStart?: (number|null); + + /** ProcessOptions fromEnd */ + fromEnd?: (number|null); + + /** ProcessOptions ocrConfig */ + ocrConfig?: (google.cloud.documentai.v1beta3.IOcrConfig|null); + + /** ProcessOptions layoutConfig */ + layoutConfig?: (google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig|null); + + /** ProcessOptions schemaOverride */ + schemaOverride?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); + } + + /** Represents a ProcessOptions. */ + class ProcessOptions implements IProcessOptions { + + /** + * Constructs a new ProcessOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IProcessOptions); + + /** ProcessOptions individualPageSelector. */ + public individualPageSelector?: (google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector|null); + + /** ProcessOptions fromStart. */ + public fromStart?: (number|null); + + /** ProcessOptions fromEnd. */ + public fromEnd?: (number|null); + + /** ProcessOptions ocrConfig. */ + public ocrConfig?: (google.cloud.documentai.v1beta3.IOcrConfig|null); + + /** ProcessOptions layoutConfig. */ + public layoutConfig?: (google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig|null); + + /** ProcessOptions schemaOverride. */ + public schemaOverride?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); + + /** ProcessOptions pageRange. */ + public pageRange?: ("individualPageSelector"|"fromStart"|"fromEnd"); + + /** + * Creates a new ProcessOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessOptions instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IProcessOptions): google.cloud.documentai.v1beta3.ProcessOptions; + + /** + * Encodes the specified ProcessOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.verify|verify} messages. + * @param message ProcessOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IProcessOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.verify|verify} messages. + * @param message ProcessOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessOptions + * @throws {Error} If the payload is not a 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.v1beta3.ProcessOptions; + + /** + * Decodes a ProcessOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessOptions + * @throws {Error} If the payload is 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.v1beta3.ProcessOptions; + + /** + * Verifies a ProcessOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessOptions; + + /** + * Creates a plain object from a ProcessOptions message. Also converts values to other types if specified. + * @param message ProcessOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ProcessOptions { + + /** Properties of a LayoutConfig. */ + interface ILayoutConfig { + + /** LayoutConfig chunkingConfig */ + chunkingConfig?: (google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig|null); + + /** LayoutConfig returnImages */ + returnImages?: (boolean|null); + + /** LayoutConfig returnBoundingBoxes */ + returnBoundingBoxes?: (boolean|null); + + /** LayoutConfig enableImageAnnotation */ + enableImageAnnotation?: (boolean|null); + + /** LayoutConfig enableImageExtraction */ + enableImageExtraction?: (boolean|null); + + /** LayoutConfig enableLlmLayoutParsing */ + enableLlmLayoutParsing?: (boolean|null); + + /** LayoutConfig enableTableAnnotation */ + enableTableAnnotation?: (boolean|null); + + /** LayoutConfig enableTableSplit */ + enableTableSplit?: (boolean|null); + } + + /** Represents a LayoutConfig. */ + class LayoutConfig implements ILayoutConfig { + + /** + * Constructs a new LayoutConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig); + + /** LayoutConfig chunkingConfig. */ + public chunkingConfig?: (google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig|null); + + /** LayoutConfig returnImages. */ + public returnImages: boolean; + + /** LayoutConfig returnBoundingBoxes. */ + public returnBoundingBoxes: boolean; + + /** LayoutConfig enableImageAnnotation. */ + public enableImageAnnotation: boolean; + + /** LayoutConfig enableImageExtraction. */ + public enableImageExtraction: boolean; + + /** LayoutConfig enableLlmLayoutParsing. */ + public enableLlmLayoutParsing: boolean; + + /** LayoutConfig enableTableAnnotation. */ + public enableTableAnnotation: boolean; + + /** LayoutConfig enableTableSplit. */ + public enableTableSplit: boolean; + + /** + * Creates a new LayoutConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig): google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig; + + /** + * Encodes the specified LayoutConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.verify|verify} messages. + * @param message LayoutConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.verify|verify} messages. + * @param message LayoutConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LayoutConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LayoutConfig + * @throws {Error} If the payload is not a 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.v1beta3.ProcessOptions.LayoutConfig; + + /** + * Decodes a LayoutConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LayoutConfig + * @throws {Error} If the payload is 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.v1beta3.ProcessOptions.LayoutConfig; + + /** + * Verifies a LayoutConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LayoutConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LayoutConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig; + + /** + * Creates a plain object from a LayoutConfig message. Also converts values to other types if specified. + * @param message LayoutConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LayoutConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LayoutConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LayoutConfig { + + /** Properties of a ChunkingConfig. */ + interface IChunkingConfig { + + /** ChunkingConfig chunkSize */ + chunkSize?: (number|null); + + /** ChunkingConfig includeAncestorHeadings */ + includeAncestorHeadings?: (boolean|null); + + /** ChunkingConfig semanticChunkingGroupSize */ + semanticChunkingGroupSize?: (boolean|null); + + /** ChunkingConfig breakpointPercentileThreshold */ + breakpointPercentileThreshold?: (number|null); + } + + /** Represents a ChunkingConfig. */ + class ChunkingConfig implements IChunkingConfig { + + /** + * Constructs a new ChunkingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig); + + /** ChunkingConfig chunkSize. */ + public chunkSize: number; + + /** ChunkingConfig includeAncestorHeadings. */ + public includeAncestorHeadings: boolean; + + /** ChunkingConfig semanticChunkingGroupSize. */ + public semanticChunkingGroupSize: boolean; + + /** ChunkingConfig breakpointPercentileThreshold. */ + public breakpointPercentileThreshold: number; + + /** + * Creates a new ChunkingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkingConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig): google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig; + + /** + * Encodes the specified ChunkingConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. + * @param message ChunkingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. + * @param message ChunkingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkingConfig + * @throws {Error} If the payload is not a 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.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig; + + /** + * Decodes a ChunkingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkingConfig + * @throws {Error} If the payload is 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.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig; + + /** + * Verifies a ChunkingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChunkingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig; + + /** + * Creates a plain object from a ChunkingConfig message. Also converts values to other types if specified. + * @param message ChunkingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an IndividualPageSelector. */ + interface IIndividualPageSelector { + + /** IndividualPageSelector pages */ + pages?: (number[]|null); + } + + /** Represents an IndividualPageSelector. */ + class IndividualPageSelector implements IIndividualPageSelector { + + /** + * Constructs a new IndividualPageSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector); + + /** IndividualPageSelector pages. */ + public pages: number[]; + + /** + * Creates a new IndividualPageSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns IndividualPageSelector instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector): google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector; + + /** + * Encodes the specified IndividualPageSelector message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify|verify} messages. + * @param message IndividualPageSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndividualPageSelector message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify|verify} messages. + * @param message IndividualPageSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndividualPageSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndividualPageSelector + * @throws {Error} If the payload is not a 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.v1beta3.ProcessOptions.IndividualPageSelector; + + /** + * Decodes an IndividualPageSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndividualPageSelector + * @throws {Error} If the payload is 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.v1beta3.ProcessOptions.IndividualPageSelector; + + /** + * Verifies an IndividualPageSelector message. + * @param message Plain 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 IndividualPageSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndividualPageSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector; + + /** + * Creates a plain object from an IndividualPageSelector message. Also converts values to other types if specified. + * @param message IndividualPageSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndividualPageSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndividualPageSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ProcessRequest. */ + interface IProcessRequest { + + /** ProcessRequest inlineDocument */ + inlineDocument?: (google.cloud.documentai.v1beta3.IDocument|null); + + /** ProcessRequest rawDocument */ + rawDocument?: (google.cloud.documentai.v1beta3.IRawDocument|null); + + /** ProcessRequest gcsDocument */ + gcsDocument?: (google.cloud.documentai.v1beta3.IGcsDocument|null); + + /** ProcessRequest name */ + name?: (string|null); + + /** ProcessRequest document */ + document?: (google.cloud.documentai.v1beta3.IDocument|null); + + /** ProcessRequest skipHumanReview */ + skipHumanReview?: (boolean|null); + + /** ProcessRequest fieldMask */ + fieldMask?: (google.protobuf.IFieldMask|null); + + /** ProcessRequest processOptions */ + processOptions?: (google.cloud.documentai.v1beta3.IProcessOptions|null); + + /** ProcessRequest labels */ + labels?: ({ [k: string]: string }|null); + + /** ProcessRequest imagelessMode */ + imagelessMode?: (boolean|null); + } + + /** Represents a ProcessRequest. */ + class ProcessRequest implements IProcessRequest { + + /** + * Constructs a new ProcessRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IProcessRequest); + + /** ProcessRequest inlineDocument. */ + public inlineDocument?: (google.cloud.documentai.v1beta3.IDocument|null); + + /** ProcessRequest rawDocument. */ + public rawDocument?: (google.cloud.documentai.v1beta3.IRawDocument|null); + + /** ProcessRequest gcsDocument. */ + public gcsDocument?: (google.cloud.documentai.v1beta3.IGcsDocument|null); + + /** ProcessRequest name. */ + public name: string; + + /** ProcessRequest document. */ + public document?: (google.cloud.documentai.v1beta3.IDocument|null); + + /** ProcessRequest skipHumanReview. */ + public skipHumanReview: boolean; + + /** ProcessRequest fieldMask. */ + public fieldMask?: (google.protobuf.IFieldMask|null); + + /** ProcessRequest processOptions. */ + public processOptions?: (google.cloud.documentai.v1beta3.IProcessOptions|null); + + /** ProcessRequest labels. */ + public labels: { [k: string]: string }; + + /** ProcessRequest imagelessMode. */ + public imagelessMode: boolean; + + /** ProcessRequest source. */ + public source?: ("inlineDocument"|"rawDocument"|"gcsDocument"); + + /** + * Creates a new ProcessRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IProcessRequest): google.cloud.documentai.v1beta3.ProcessRequest; + + /** + * Encodes the specified ProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessRequest.verify|verify} messages. + * @param message ProcessRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessRequest.verify|verify} messages. + * @param message ProcessRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessRequest + * @throws {Error} If the payload is not a 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.v1beta3.ProcessRequest; + + /** + * Decodes a ProcessRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessRequest + * @throws {Error} If the payload is 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.v1beta3.ProcessRequest; + + /** + * Verifies a ProcessRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessRequest; + + /** + * Creates a plain object from a ProcessRequest message. Also converts values to other types if specified. + * @param message ProcessRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HumanReviewStatus. */ + interface IHumanReviewStatus { + + /** HumanReviewStatus state */ + state?: (google.cloud.documentai.v1beta3.HumanReviewStatus.State|keyof typeof google.cloud.documentai.v1beta3.HumanReviewStatus.State|null); + + /** HumanReviewStatus stateMessage */ + stateMessage?: (string|null); + + /** HumanReviewStatus humanReviewOperation */ + humanReviewOperation?: (string|null); + } + + /** Represents a HumanReviewStatus. */ + class HumanReviewStatus implements IHumanReviewStatus { + + /** + * Constructs a new HumanReviewStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IHumanReviewStatus); + + /** HumanReviewStatus state. */ + public state: (google.cloud.documentai.v1beta3.HumanReviewStatus.State|keyof typeof google.cloud.documentai.v1beta3.HumanReviewStatus.State); + + /** HumanReviewStatus stateMessage. */ + public stateMessage: string; + + /** HumanReviewStatus humanReviewOperation. */ + public humanReviewOperation: string; + + /** + * Creates a new HumanReviewStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns HumanReviewStatus instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IHumanReviewStatus): google.cloud.documentai.v1beta3.HumanReviewStatus; + + /** + * Encodes the specified HumanReviewStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.HumanReviewStatus.verify|verify} messages. + * @param message HumanReviewStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IHumanReviewStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HumanReviewStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.HumanReviewStatus.verify|verify} messages. + * @param message HumanReviewStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IHumanReviewStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HumanReviewStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HumanReviewStatus + * @throws {Error} If the payload is not a 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.v1beta3.HumanReviewStatus; + + /** + * Decodes a HumanReviewStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HumanReviewStatus + * @throws {Error} If the payload is 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.v1beta3.HumanReviewStatus; + + /** + * Verifies a HumanReviewStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HumanReviewStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HumanReviewStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.HumanReviewStatus; + + /** + * Creates a plain object from a HumanReviewStatus message. Also converts values to other types if specified. + * @param message HumanReviewStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.HumanReviewStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HumanReviewStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HumanReviewStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace HumanReviewStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + SKIPPED = 1, + VALIDATION_PASSED = 2, + IN_PROGRESS = 3, + ERROR = 4 + } + } + + /** Properties of a ProcessResponse. */ + interface IProcessResponse { + + /** ProcessResponse document */ + document?: (google.cloud.documentai.v1beta3.IDocument|null); + + /** ProcessResponse humanReviewOperation */ + humanReviewOperation?: (string|null); + + /** ProcessResponse humanReviewStatus */ + humanReviewStatus?: (google.cloud.documentai.v1beta3.IHumanReviewStatus|null); + } + + /** Represents a ProcessResponse. */ + class ProcessResponse implements IProcessResponse { + + /** + * Constructs a new ProcessResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IProcessResponse); + + /** ProcessResponse document. */ + public document?: (google.cloud.documentai.v1beta3.IDocument|null); + + /** ProcessResponse humanReviewOperation. */ + public humanReviewOperation: string; + + /** ProcessResponse humanReviewStatus. */ + public humanReviewStatus?: (google.cloud.documentai.v1beta3.IHumanReviewStatus|null); + + /** + * Creates a new ProcessResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IProcessResponse): google.cloud.documentai.v1beta3.ProcessResponse; + + /** + * Encodes the specified ProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessResponse.verify|verify} messages. + * @param message ProcessResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessResponse.verify|verify} messages. + * @param message ProcessResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessResponse + * @throws {Error} If the payload is not a 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.v1beta3.ProcessResponse; + + /** + * Decodes a ProcessResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessResponse + * @throws {Error} If the payload is 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.v1beta3.ProcessResponse; + + /** + * Verifies a ProcessResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessResponse; + + /** + * Creates a plain object from a ProcessResponse message. Also converts values to other types if specified. + * @param message ProcessResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchProcessRequest. */ + interface IBatchProcessRequest { + + /** BatchProcessRequest name */ + name?: (string|null); + + /** BatchProcessRequest inputConfigs */ + inputConfigs?: (google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig[]|null); + + /** BatchProcessRequest outputConfig */ + outputConfig?: (google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig|null); + + /** BatchProcessRequest inputDocuments */ + inputDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); + + /** BatchProcessRequest documentOutputConfig */ + documentOutputConfig?: (google.cloud.documentai.v1beta3.IDocumentOutputConfig|null); + + /** BatchProcessRequest skipHumanReview */ + skipHumanReview?: (boolean|null); + + /** BatchProcessRequest processOptions */ + processOptions?: (google.cloud.documentai.v1beta3.IProcessOptions|null); + + /** BatchProcessRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a BatchProcessRequest. */ + class BatchProcessRequest implements IBatchProcessRequest { + + /** + * Constructs a new BatchProcessRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IBatchProcessRequest); + + /** BatchProcessRequest name. */ + public name: string; + + /** BatchProcessRequest inputConfigs. */ + public inputConfigs: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig[]; + + /** BatchProcessRequest outputConfig. */ + public outputConfig?: (google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig|null); + + /** BatchProcessRequest inputDocuments. */ + public inputDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); + + /** BatchProcessRequest documentOutputConfig. */ + public documentOutputConfig?: (google.cloud.documentai.v1beta3.IDocumentOutputConfig|null); + + /** BatchProcessRequest skipHumanReview. */ + public skipHumanReview: boolean; + + /** BatchProcessRequest processOptions. */ + public processOptions?: (google.cloud.documentai.v1beta3.IProcessOptions|null); + + /** BatchProcessRequest labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new BatchProcessRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchProcessRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IBatchProcessRequest): google.cloud.documentai.v1beta3.BatchProcessRequest; + + /** + * Encodes the specified BatchProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.verify|verify} messages. + * @param message BatchProcessRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IBatchProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.verify|verify} messages. + * @param message BatchProcessRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchProcessRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchProcessRequest + * @throws {Error} If the payload is not a 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.v1beta3.BatchProcessRequest; + + /** + * Decodes a BatchProcessRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchProcessRequest + * @throws {Error} If the payload is 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.v1beta3.BatchProcessRequest; + + /** + * Verifies a BatchProcessRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchProcessRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchProcessRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchProcessRequest; + + /** + * Creates a plain object from a BatchProcessRequest message. Also converts values to other types if specified. + * @param message BatchProcessRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchProcessRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchProcessRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchProcessRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchProcessRequest { + + /** Properties of a BatchInputConfig. */ + interface IBatchInputConfig { + + /** BatchInputConfig gcsSource */ + gcsSource?: (string|null); + + /** BatchInputConfig mimeType */ + mimeType?: (string|null); + } + + /** Represents a BatchInputConfig. */ + class BatchInputConfig implements IBatchInputConfig { + + /** + * Constructs a new BatchInputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig); + + /** BatchInputConfig gcsSource. */ + public gcsSource: string; + + /** BatchInputConfig mimeType. */ + public mimeType: string; + + /** + * Creates a new BatchInputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchInputConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig): google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig; + + /** + * Encodes the specified BatchInputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.verify|verify} messages. + * @param message BatchInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchInputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.verify|verify} messages. + * @param message BatchInputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchInputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchInputConfig + * @throws {Error} If the payload is not a 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.v1beta3.BatchProcessRequest.BatchInputConfig; + + /** + * Decodes a BatchInputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchInputConfig + * @throws {Error} If the payload is 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.v1beta3.BatchProcessRequest.BatchInputConfig; + + /** + * Verifies a BatchInputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchInputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchInputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig; + + /** + * Creates a plain object from a BatchInputConfig message. Also converts values to other types if specified. + * @param message BatchInputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchInputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchInputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchOutputConfig. */ + interface IBatchOutputConfig { + + /** BatchOutputConfig gcsDestination */ + gcsDestination?: (string|null); + } + + /** Represents a BatchOutputConfig. */ + class BatchOutputConfig implements IBatchOutputConfig { + + /** + * Constructs a new BatchOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig); + + /** BatchOutputConfig gcsDestination. */ + public gcsDestination: string; + + /** + * Creates a new BatchOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchOutputConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig): google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig; + + /** + * Encodes the specified BatchOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.verify|verify} messages. + * @param message BatchOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.verify|verify} messages. + * @param message BatchOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchOutputConfig + * @throws {Error} If the payload is not a 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.v1beta3.BatchProcessRequest.BatchOutputConfig; + + /** + * Decodes a BatchOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchOutputConfig + * @throws {Error} If the payload is 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.v1beta3.BatchProcessRequest.BatchOutputConfig; + + /** + * Verifies a BatchOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig; + + /** + * Creates a plain object from a BatchOutputConfig message. Also converts values to other types if specified. + * @param message BatchOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a BatchProcessResponse. */ + interface IBatchProcessResponse { + } + + /** Represents a BatchProcessResponse. */ + class BatchProcessResponse implements IBatchProcessResponse { + + /** + * Constructs a new BatchProcessResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IBatchProcessResponse); + + /** + * Creates a new BatchProcessResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchProcessResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IBatchProcessResponse): google.cloud.documentai.v1beta3.BatchProcessResponse; + + /** + * Encodes the specified BatchProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessResponse.verify|verify} messages. + * @param message BatchProcessResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IBatchProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessResponse.verify|verify} messages. + * @param message BatchProcessResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchProcessResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchProcessResponse + * @throws {Error} If the payload is not a 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.v1beta3.BatchProcessResponse; + + /** + * Decodes a BatchProcessResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchProcessResponse + * @throws {Error} If the payload is 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.v1beta3.BatchProcessResponse; + + /** + * Verifies a BatchProcessResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchProcessResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchProcessResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchProcessResponse; + + /** + * Creates a plain object from a BatchProcessResponse message. Also converts values to other types if specified. + * @param message BatchProcessResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchProcessResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchProcessResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchProcessResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchProcessMetadata. */ + interface IBatchProcessMetadata { + + /** BatchProcessMetadata state */ + state?: (google.cloud.documentai.v1beta3.BatchProcessMetadata.State|keyof typeof google.cloud.documentai.v1beta3.BatchProcessMetadata.State|null); + + /** BatchProcessMetadata stateMessage */ + stateMessage?: (string|null); + + /** BatchProcessMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BatchProcessMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BatchProcessMetadata individualProcessStatuses */ + individualProcessStatuses?: (google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus[]|null); + } + + /** Represents a BatchProcessMetadata. */ + class BatchProcessMetadata implements IBatchProcessMetadata { + + /** + * Constructs a new BatchProcessMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IBatchProcessMetadata); + + /** BatchProcessMetadata state. */ + public state: (google.cloud.documentai.v1beta3.BatchProcessMetadata.State|keyof typeof google.cloud.documentai.v1beta3.BatchProcessMetadata.State); + + /** BatchProcessMetadata stateMessage. */ + public stateMessage: string; + + /** BatchProcessMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BatchProcessMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BatchProcessMetadata individualProcessStatuses. */ + public individualProcessStatuses: google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus[]; + + /** + * Creates a new BatchProcessMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchProcessMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IBatchProcessMetadata): google.cloud.documentai.v1beta3.BatchProcessMetadata; + + /** + * Encodes the specified BatchProcessMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.verify|verify} messages. + * @param message BatchProcessMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IBatchProcessMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchProcessMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.verify|verify} messages. + * @param message BatchProcessMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchProcessMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchProcessMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchProcessMetadata + * @throws {Error} If the payload is not a 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.v1beta3.BatchProcessMetadata; + + /** + * Decodes a BatchProcessMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchProcessMetadata + * @throws {Error} If the payload is 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.v1beta3.BatchProcessMetadata; + + /** + * Verifies a BatchProcessMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchProcessMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchProcessMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchProcessMetadata; + + /** + * Creates a plain object from a BatchProcessMetadata message. Also converts values to other types if specified. + * @param message BatchProcessMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchProcessMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchProcessMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchProcessMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchProcessMetadata { + + /** Properties of an IndividualProcessStatus. */ + interface IIndividualProcessStatus { + + /** IndividualProcessStatus inputGcsSource */ + inputGcsSource?: (string|null); + + /** IndividualProcessStatus status */ + status?: (google.rpc.IStatus|null); + + /** IndividualProcessStatus outputGcsDestination */ + outputGcsDestination?: (string|null); + + /** IndividualProcessStatus humanReviewOperation */ + humanReviewOperation?: (string|null); + + /** IndividualProcessStatus humanReviewStatus */ + humanReviewStatus?: (google.cloud.documentai.v1beta3.IHumanReviewStatus|null); + } + + /** Represents an IndividualProcessStatus. */ + class IndividualProcessStatus implements IIndividualProcessStatus { + + /** + * Constructs a new IndividualProcessStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus); + + /** IndividualProcessStatus inputGcsSource. */ + public inputGcsSource: string; + + /** IndividualProcessStatus status. */ + public status?: (google.rpc.IStatus|null); + + /** IndividualProcessStatus outputGcsDestination. */ + public outputGcsDestination: string; + + /** IndividualProcessStatus humanReviewOperation. */ + public humanReviewOperation: string; + + /** IndividualProcessStatus humanReviewStatus. */ + public humanReviewStatus?: (google.cloud.documentai.v1beta3.IHumanReviewStatus|null); + + /** + * Creates a new IndividualProcessStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns IndividualProcessStatus instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus): google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus; + + /** + * Encodes the specified IndividualProcessStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. + * @param message IndividualProcessStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndividualProcessStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. + * @param message IndividualProcessStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndividualProcessStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndividualProcessStatus + * @throws {Error} If the payload is not a 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.v1beta3.BatchProcessMetadata.IndividualProcessStatus; + + /** + * Decodes an IndividualProcessStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndividualProcessStatus + * @throws {Error} If the payload is 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.v1beta3.BatchProcessMetadata.IndividualProcessStatus; + + /** + * Verifies an IndividualProcessStatus message. + * @param message Plain 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 IndividualProcessStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndividualProcessStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus; + + /** + * Creates a plain object from an IndividualProcessStatus message. Also converts values to other types if specified. + * @param message IndividualProcessStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndividualProcessStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndividualProcessStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + WAITING = 1, + RUNNING = 2, + SUCCEEDED = 3, + CANCELLING = 4, + CANCELLED = 5, + FAILED = 6 + } + } + + /** Properties of a FetchProcessorTypesRequest. */ + interface IFetchProcessorTypesRequest { + + /** FetchProcessorTypesRequest parent */ + parent?: (string|null); + } + + /** Represents a FetchProcessorTypesRequest. */ + class FetchProcessorTypesRequest implements IFetchProcessorTypesRequest { + + /** + * Constructs a new FetchProcessorTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest); + + /** FetchProcessorTypesRequest parent. */ + public parent: string; + + /** + * Creates a new FetchProcessorTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchProcessorTypesRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest): google.cloud.documentai.v1beta3.FetchProcessorTypesRequest; + + /** + * Encodes the specified FetchProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.verify|verify} messages. + * @param message FetchProcessorTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.verify|verify} messages. + * @param message FetchProcessorTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchProcessorTypesRequest + * @throws {Error} If the payload is not a 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.v1beta3.FetchProcessorTypesRequest; + + /** + * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchProcessorTypesRequest + * @throws {Error} If the payload is 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.v1beta3.FetchProcessorTypesRequest; + + /** + * Verifies a FetchProcessorTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchProcessorTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.FetchProcessorTypesRequest; + + /** + * Creates a plain object from a FetchProcessorTypesRequest message. Also converts values to other types if specified. + * @param message FetchProcessorTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.FetchProcessorTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchProcessorTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchProcessorTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchProcessorTypesResponse. */ + interface IFetchProcessorTypesResponse { + + /** FetchProcessorTypesResponse processorTypes */ + processorTypes?: (google.cloud.documentai.v1beta3.IProcessorType[]|null); + } + + /** Represents a FetchProcessorTypesResponse. */ + class FetchProcessorTypesResponse implements IFetchProcessorTypesResponse { + + /** + * Constructs a new FetchProcessorTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse); + + /** FetchProcessorTypesResponse processorTypes. */ + public processorTypes: google.cloud.documentai.v1beta3.IProcessorType[]; + + /** + * Creates a new FetchProcessorTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchProcessorTypesResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse): google.cloud.documentai.v1beta3.FetchProcessorTypesResponse; + + /** + * Encodes the specified FetchProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.verify|verify} messages. + * @param message FetchProcessorTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.verify|verify} messages. + * @param message FetchProcessorTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchProcessorTypesResponse + * @throws {Error} If the payload is not a 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.v1beta3.FetchProcessorTypesResponse; + + /** + * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchProcessorTypesResponse + * @throws {Error} If the payload is 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.v1beta3.FetchProcessorTypesResponse; + + /** + * Verifies a FetchProcessorTypesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchProcessorTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.FetchProcessorTypesResponse; + + /** + * Creates a plain object from a FetchProcessorTypesResponse message. Also converts values to other types if specified. + * @param message FetchProcessorTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.FetchProcessorTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchProcessorTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchProcessorTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorTypesRequest. */ + interface IListProcessorTypesRequest { + + /** ListProcessorTypesRequest parent */ + parent?: (string|null); + + /** ListProcessorTypesRequest pageSize */ + pageSize?: (number|null); + + /** ListProcessorTypesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProcessorTypesRequest. */ + class ListProcessorTypesRequest implements IListProcessorTypesRequest { + + /** + * Constructs a new ListProcessorTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IListProcessorTypesRequest); + + /** ListProcessorTypesRequest parent. */ + public parent: string; + + /** ListProcessorTypesRequest pageSize. */ + public pageSize: number; + + /** ListProcessorTypesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProcessorTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorTypesRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IListProcessorTypesRequest): google.cloud.documentai.v1beta3.ListProcessorTypesRequest; + + /** + * Encodes the specified ListProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesRequest.verify|verify} messages. + * @param message ListProcessorTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IListProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesRequest.verify|verify} messages. + * @param message ListProcessorTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorTypesRequest + * @throws {Error} If the payload is not a 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.v1beta3.ListProcessorTypesRequest; + + /** + * Decodes a ListProcessorTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorTypesRequest + * @throws {Error} If the payload is 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.v1beta3.ListProcessorTypesRequest; + + /** + * Verifies a ListProcessorTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListProcessorTypesRequest; + + /** + * Creates a plain object from a ListProcessorTypesRequest message. Also converts values to other types if specified. + * @param message ListProcessorTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ListProcessorTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorTypesResponse. */ + interface IListProcessorTypesResponse { + + /** ListProcessorTypesResponse processorTypes */ + processorTypes?: (google.cloud.documentai.v1beta3.IProcessorType[]|null); + + /** ListProcessorTypesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProcessorTypesResponse. */ + class ListProcessorTypesResponse implements IListProcessorTypesResponse { + + /** + * Constructs a new ListProcessorTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IListProcessorTypesResponse); + + /** ListProcessorTypesResponse processorTypes. */ + public processorTypes: google.cloud.documentai.v1beta3.IProcessorType[]; + + /** ListProcessorTypesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProcessorTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorTypesResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IListProcessorTypesResponse): google.cloud.documentai.v1beta3.ListProcessorTypesResponse; + + /** + * Encodes the specified ListProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesResponse.verify|verify} messages. + * @param message ListProcessorTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IListProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesResponse.verify|verify} messages. + * @param message ListProcessorTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorTypesResponse + * @throws {Error} If the payload is not a 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.v1beta3.ListProcessorTypesResponse; + + /** + * Decodes a ListProcessorTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorTypesResponse + * @throws {Error} If the payload is 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.v1beta3.ListProcessorTypesResponse; + + /** + * Verifies a ListProcessorTypesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListProcessorTypesResponse; + + /** + * Creates a plain object from a ListProcessorTypesResponse message. Also converts values to other types if specified. + * @param message ListProcessorTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ListProcessorTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorsRequest. */ + interface IListProcessorsRequest { + + /** ListProcessorsRequest parent */ + parent?: (string|null); + + /** ListProcessorsRequest pageSize */ + pageSize?: (number|null); + + /** ListProcessorsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProcessorsRequest. */ + class ListProcessorsRequest implements IListProcessorsRequest { + + /** + * Constructs a new ListProcessorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IListProcessorsRequest); + + /** ListProcessorsRequest parent. */ + public parent: string; + + /** ListProcessorsRequest pageSize. */ + public pageSize: number; + + /** ListProcessorsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProcessorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorsRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IListProcessorsRequest): google.cloud.documentai.v1beta3.ListProcessorsRequest; + + /** + * Encodes the specified ListProcessorsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsRequest.verify|verify} messages. + * @param message ListProcessorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IListProcessorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsRequest.verify|verify} messages. + * @param message ListProcessorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListProcessorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorsRequest + * @throws {Error} If the payload is not a 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.v1beta3.ListProcessorsRequest; + + /** + * Decodes a ListProcessorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorsRequest + * @throws {Error} If the payload is 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.v1beta3.ListProcessorsRequest; + + /** + * Verifies a ListProcessorsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListProcessorsRequest; + + /** + * Creates a plain object from a ListProcessorsRequest message. Also converts values to other types if specified. + * @param message ListProcessorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ListProcessorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorsResponse. */ + interface IListProcessorsResponse { + + /** ListProcessorsResponse processors */ + processors?: (google.cloud.documentai.v1beta3.IProcessor[]|null); + + /** ListProcessorsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProcessorsResponse. */ + class ListProcessorsResponse implements IListProcessorsResponse { + + /** + * Constructs a new ListProcessorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IListProcessorsResponse); + + /** ListProcessorsResponse processors. */ + public processors: google.cloud.documentai.v1beta3.IProcessor[]; + + /** ListProcessorsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProcessorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorsResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IListProcessorsResponse): google.cloud.documentai.v1beta3.ListProcessorsResponse; + + /** + * Encodes the specified ListProcessorsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsResponse.verify|verify} messages. + * @param message ListProcessorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IListProcessorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsResponse.verify|verify} messages. + * @param message ListProcessorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListProcessorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorsResponse + * @throws {Error} If the payload is not a 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.v1beta3.ListProcessorsResponse; + + /** + * Decodes a ListProcessorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorsResponse + * @throws {Error} If the payload is 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.v1beta3.ListProcessorsResponse; + + /** + * Verifies a ListProcessorsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListProcessorsResponse; + + /** + * Creates a plain object from a ListProcessorsResponse message. Also converts values to other types if specified. + * @param message ListProcessorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ListProcessorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetProcessorTypeRequest. */ + interface IGetProcessorTypeRequest { + + /** GetProcessorTypeRequest name */ + name?: (string|null); + } + + /** Represents a GetProcessorTypeRequest. */ + class GetProcessorTypeRequest implements IGetProcessorTypeRequest { + + /** + * Constructs a new GetProcessorTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGetProcessorTypeRequest); + + /** GetProcessorTypeRequest name. */ + public name: string; + + /** + * Creates a new GetProcessorTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProcessorTypeRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IGetProcessorTypeRequest): google.cloud.documentai.v1beta3.GetProcessorTypeRequest; + + /** + * Encodes the specified GetProcessorTypeRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorTypeRequest.verify|verify} messages. + * @param message GetProcessorTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProcessorTypeRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorTypeRequest.verify|verify} messages. + * @param message GetProcessorTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProcessorTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProcessorTypeRequest + * @throws {Error} If the payload is not a 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.v1beta3.GetProcessorTypeRequest; + + /** + * Decodes a GetProcessorTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProcessorTypeRequest + * @throws {Error} If the payload is 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.v1beta3.GetProcessorTypeRequest; + + /** + * Verifies a GetProcessorTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProcessorTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProcessorTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GetProcessorTypeRequest; + + /** + * Creates a plain object from a GetProcessorTypeRequest message. Also converts values to other types if specified. + * @param message GetProcessorTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.GetProcessorTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProcessorTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetProcessorTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetProcessorRequest. */ + interface IGetProcessorRequest { + + /** GetProcessorRequest name */ + name?: (string|null); + } + + /** Represents a GetProcessorRequest. */ + class GetProcessorRequest implements IGetProcessorRequest { + + /** + * Constructs a new GetProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGetProcessorRequest); + + /** GetProcessorRequest name. */ + public name: string; + + /** + * Creates a new GetProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProcessorRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IGetProcessorRequest): google.cloud.documentai.v1beta3.GetProcessorRequest; + + /** + * Encodes the specified GetProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorRequest.verify|verify} messages. + * @param message GetProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IGetProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorRequest.verify|verify} messages. + * @param message GetProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGetProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProcessorRequest + * @throws {Error} If the payload is not a 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.v1beta3.GetProcessorRequest; + + /** + * Decodes a GetProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProcessorRequest + * @throws {Error} If the payload is 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.v1beta3.GetProcessorRequest; + + /** + * Verifies a GetProcessorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GetProcessorRequest; + + /** + * Creates a plain object from a GetProcessorRequest message. Also converts values to other types if specified. + * @param message GetProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.GetProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetProcessorVersionRequest. */ + interface IGetProcessorVersionRequest { + + /** GetProcessorVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetProcessorVersionRequest. */ + class GetProcessorVersionRequest implements IGetProcessorVersionRequest { + + /** + * Constructs a new GetProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGetProcessorVersionRequest); + + /** GetProcessorVersionRequest name. */ + public name: string; + + /** + * Creates a new GetProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IGetProcessorVersionRequest): google.cloud.documentai.v1beta3.GetProcessorVersionRequest; + + /** + * Encodes the specified GetProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorVersionRequest.verify|verify} messages. + * @param message GetProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorVersionRequest.verify|verify} messages. + * @param message GetProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetProcessorVersionRequest + * @throws {Error} If the payload is not a 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.v1beta3.GetProcessorVersionRequest; + + /** + * Decodes a GetProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetProcessorVersionRequest + * @throws {Error} If the payload is 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.v1beta3.GetProcessorVersionRequest; + + /** + * Verifies a GetProcessorVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GetProcessorVersionRequest; + + /** + * Creates a plain object from a GetProcessorVersionRequest message. Also converts values to other types if specified. + * @param message GetProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.GetProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorVersionsRequest. */ + interface IListProcessorVersionsRequest { + + /** ListProcessorVersionsRequest parent */ + parent?: (string|null); + + /** ListProcessorVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListProcessorVersionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListProcessorVersionsRequest. */ + class ListProcessorVersionsRequest implements IListProcessorVersionsRequest { + + /** + * Constructs a new ListProcessorVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IListProcessorVersionsRequest); + + /** ListProcessorVersionsRequest parent. */ + public parent: string; + + /** ListProcessorVersionsRequest pageSize. */ + public pageSize: number; + + /** ListProcessorVersionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListProcessorVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorVersionsRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IListProcessorVersionsRequest): google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; + + /** + * Encodes the specified ListProcessorVersionsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.verify|verify} messages. + * @param message ListProcessorVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.verify|verify} messages. + * @param message ListProcessorVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorVersionsRequest + * @throws {Error} If the payload is not a 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.v1beta3.ListProcessorVersionsRequest; + + /** + * Decodes a ListProcessorVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorVersionsRequest + * @throws {Error} If the payload is 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.v1beta3.ListProcessorVersionsRequest; + + /** + * Verifies a ListProcessorVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; + + /** + * Creates a plain object from a ListProcessorVersionsRequest message. Also converts values to other types if specified. + * @param message ListProcessorVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ListProcessorVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListProcessorVersionsResponse. */ + interface IListProcessorVersionsResponse { + + /** ListProcessorVersionsResponse processorVersions */ + processorVersions?: (google.cloud.documentai.v1beta3.IProcessorVersion[]|null); + + /** ListProcessorVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListProcessorVersionsResponse. */ + class ListProcessorVersionsResponse implements IListProcessorVersionsResponse { + + /** + * Constructs a new ListProcessorVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IListProcessorVersionsResponse); + + /** ListProcessorVersionsResponse processorVersions. */ + public processorVersions: google.cloud.documentai.v1beta3.IProcessorVersion[]; + + /** ListProcessorVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListProcessorVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListProcessorVersionsResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IListProcessorVersionsResponse): google.cloud.documentai.v1beta3.ListProcessorVersionsResponse; + + /** + * Encodes the specified ListProcessorVersionsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.verify|verify} messages. + * @param message ListProcessorVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IListProcessorVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListProcessorVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.verify|verify} messages. + * @param message ListProcessorVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListProcessorVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListProcessorVersionsResponse + * @throws {Error} If the payload is not a 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.v1beta3.ListProcessorVersionsResponse; + + /** + * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListProcessorVersionsResponse + * @throws {Error} If the payload is 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.v1beta3.ListProcessorVersionsResponse; + + /** + * Verifies a ListProcessorVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListProcessorVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListProcessorVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListProcessorVersionsResponse; + + /** + * Creates a plain object from a ListProcessorVersionsResponse message. Also converts values to other types if specified. + * @param message ListProcessorVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ListProcessorVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListProcessorVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListProcessorVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteProcessorVersionRequest. */ + interface IDeleteProcessorVersionRequest { + + /** DeleteProcessorVersionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteProcessorVersionRequest. */ + class DeleteProcessorVersionRequest implements IDeleteProcessorVersionRequest { + + /** + * Constructs a new DeleteProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest); + + /** DeleteProcessorVersionRequest name. */ + public name: string; + + /** + * Creates a new DeleteProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest): google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; + + /** + * Encodes the specified DeleteProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.verify|verify} messages. + * @param message DeleteProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.verify|verify} messages. + * @param message DeleteProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProcessorVersionRequest + * @throws {Error} If the payload is not a 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.v1beta3.DeleteProcessorVersionRequest; + + /** + * Decodes a DeleteProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProcessorVersionRequest + * @throws {Error} If the payload is 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.v1beta3.DeleteProcessorVersionRequest; + + /** + * Verifies a DeleteProcessorVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; + + /** + * Creates a plain object from a DeleteProcessorVersionRequest message. Also converts values to other types if specified. + * @param message DeleteProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteProcessorVersionMetadata. */ + interface IDeleteProcessorVersionMetadata { + + /** DeleteProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + } + + /** Represents a DeleteProcessorVersionMetadata. */ + class DeleteProcessorVersionMetadata implements IDeleteProcessorVersionMetadata { + + /** + * Constructs a new DeleteProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata); + + /** DeleteProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** + * Creates a new DeleteProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata): google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata; + + /** + * Encodes the specified DeleteProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.verify|verify} messages. + * @param message DeleteProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.verify|verify} messages. + * @param message DeleteProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.v1beta3.DeleteProcessorVersionMetadata; + + /** + * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProcessorVersionMetadata + * @throws {Error} If the payload is 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.v1beta3.DeleteProcessorVersionMetadata; + + /** + * Verifies a DeleteProcessorVersionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata; + + /** + * Creates a plain object from a DeleteProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message DeleteProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployProcessorVersionRequest. */ + interface IDeployProcessorVersionRequest { + + /** DeployProcessorVersionRequest name */ + name?: (string|null); + } + + /** Represents a DeployProcessorVersionRequest. */ + class DeployProcessorVersionRequest implements IDeployProcessorVersionRequest { + + /** + * Constructs a new DeployProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest); + + /** DeployProcessorVersionRequest name. */ + public name: string; + + /** + * Creates a new DeployProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest): google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; + + /** + * Encodes the specified DeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.verify|verify} messages. + * @param message DeployProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.verify|verify} messages. + * @param message DeployProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployProcessorVersionRequest + * @throws {Error} If the payload is not a 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.v1beta3.DeployProcessorVersionRequest; + + /** + * Decodes a DeployProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployProcessorVersionRequest + * @throws {Error} If the payload is 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.v1beta3.DeployProcessorVersionRequest; + + /** + * Verifies a DeployProcessorVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; + + /** + * Creates a plain object from a DeployProcessorVersionRequest message. Also converts values to other types if specified. + * @param message DeployProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DeployProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployProcessorVersionResponse. */ + interface IDeployProcessorVersionResponse { + } + + /** Represents a DeployProcessorVersionResponse. */ + class DeployProcessorVersionResponse implements IDeployProcessorVersionResponse { + + /** + * Constructs a new DeployProcessorVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse); + + /** + * Creates a new DeployProcessorVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployProcessorVersionResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse): google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; + + /** + * Encodes the specified DeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.verify|verify} messages. + * @param message DeployProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.verify|verify} messages. + * @param message DeployProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployProcessorVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployProcessorVersionResponse + * @throws {Error} If the payload is not a 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.v1beta3.DeployProcessorVersionResponse; + + /** + * Decodes a DeployProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployProcessorVersionResponse + * @throws {Error} If the payload is 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.v1beta3.DeployProcessorVersionResponse; + + /** + * Verifies a DeployProcessorVersionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployProcessorVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; + + /** + * Creates a plain object from a DeployProcessorVersionResponse message. Also converts values to other types if specified. + * @param message DeployProcessorVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DeployProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployProcessorVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployProcessorVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployProcessorVersionMetadata. */ + interface IDeployProcessorVersionMetadata { + + /** DeployProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + } + + /** Represents a DeployProcessorVersionMetadata. */ + class DeployProcessorVersionMetadata implements IDeployProcessorVersionMetadata { + + /** + * Constructs a new DeployProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata); + + /** DeployProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** + * Creates a new DeployProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata): google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata; + + /** + * Encodes the specified DeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.verify|verify} messages. + * @param message DeployProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.verify|verify} messages. + * @param message DeployProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.v1beta3.DeployProcessorVersionMetadata; + + /** + * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployProcessorVersionMetadata + * @throws {Error} If the payload is 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.v1beta3.DeployProcessorVersionMetadata; + + /** + * Verifies a DeployProcessorVersionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata; + + /** + * Creates a plain object from a DeployProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message DeployProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployProcessorVersionRequest. */ + interface IUndeployProcessorVersionRequest { + + /** UndeployProcessorVersionRequest name */ + name?: (string|null); + } + + /** Represents an UndeployProcessorVersionRequest. */ + class UndeployProcessorVersionRequest implements IUndeployProcessorVersionRequest { + + /** + * Constructs a new UndeployProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest); + + /** UndeployProcessorVersionRequest name. */ + public name: string; + + /** + * Creates a new UndeployProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest): google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; + + /** + * Encodes the specified UndeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.verify|verify} messages. + * @param message UndeployProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.verify|verify} messages. + * @param message UndeployProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployProcessorVersionRequest + * @throws {Error} If the payload is not a 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.v1beta3.UndeployProcessorVersionRequest; + + /** + * Decodes an UndeployProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployProcessorVersionRequest + * @throws {Error} If the payload is 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.v1beta3.UndeployProcessorVersionRequest; + + /** + * Verifies an UndeployProcessorVersionRequest message. + * @param message Plain 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 UndeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; + + /** + * Creates a plain object from an UndeployProcessorVersionRequest message. Also converts values to other types if specified. + * @param message UndeployProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployProcessorVersionResponse. */ + interface IUndeployProcessorVersionResponse { + } + + /** Represents an UndeployProcessorVersionResponse. */ + class UndeployProcessorVersionResponse implements IUndeployProcessorVersionResponse { + + /** + * Constructs a new UndeployProcessorVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse); + + /** + * Creates a new UndeployProcessorVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployProcessorVersionResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse): google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; + + /** + * Encodes the specified UndeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.verify|verify} messages. + * @param message UndeployProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.verify|verify} messages. + * @param message UndeployProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployProcessorVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployProcessorVersionResponse + * @throws {Error} If the payload is not a 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.v1beta3.UndeployProcessorVersionResponse; + + /** + * Decodes an UndeployProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployProcessorVersionResponse + * @throws {Error} If the payload is 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.v1beta3.UndeployProcessorVersionResponse; + + /** + * Verifies an UndeployProcessorVersionResponse message. + * @param message Plain 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 UndeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployProcessorVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; + + /** + * Creates a plain object from an UndeployProcessorVersionResponse message. Also converts values to other types if specified. + * @param message UndeployProcessorVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployProcessorVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployProcessorVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeployProcessorVersionMetadata. */ + interface IUndeployProcessorVersionMetadata { + + /** UndeployProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + } + + /** Represents an UndeployProcessorVersionMetadata. */ + class UndeployProcessorVersionMetadata implements IUndeployProcessorVersionMetadata { + + /** + * Constructs a new UndeployProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata); + + /** UndeployProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** + * Creates a new UndeployProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeployProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata): google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata; + + /** + * Encodes the specified UndeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.verify|verify} messages. + * @param message UndeployProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.verify|verify} messages. + * @param message UndeployProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeployProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.v1beta3.UndeployProcessorVersionMetadata; + + /** + * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeployProcessorVersionMetadata + * @throws {Error} If the payload is 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.v1beta3.UndeployProcessorVersionMetadata; + + /** + * Verifies an UndeployProcessorVersionMetadata message. + * @param message Plain 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 UndeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeployProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata; + + /** + * Creates a plain object from an UndeployProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message UndeployProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeployProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeployProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateProcessorRequest. */ + interface ICreateProcessorRequest { + + /** CreateProcessorRequest parent */ + parent?: (string|null); + + /** CreateProcessorRequest processor */ + processor?: (google.cloud.documentai.v1beta3.IProcessor|null); + } + + /** Represents a CreateProcessorRequest. */ + class CreateProcessorRequest implements ICreateProcessorRequest { + + /** + * Constructs a new CreateProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ICreateProcessorRequest); + + /** CreateProcessorRequest parent. */ + public parent: string; + + /** CreateProcessorRequest processor. */ + public processor?: (google.cloud.documentai.v1beta3.IProcessor|null); + + /** + * Creates a new CreateProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateProcessorRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ICreateProcessorRequest): google.cloud.documentai.v1beta3.CreateProcessorRequest; + + /** + * Encodes the specified CreateProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.CreateProcessorRequest.verify|verify} messages. + * @param message CreateProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ICreateProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.CreateProcessorRequest.verify|verify} messages. + * @param message CreateProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ICreateProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateProcessorRequest + * @throws {Error} If the payload is not a 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.v1beta3.CreateProcessorRequest; + + /** + * Decodes a CreateProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateProcessorRequest + * @throws {Error} If the payload is 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.v1beta3.CreateProcessorRequest; + + /** + * Verifies a CreateProcessorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.CreateProcessorRequest; + + /** + * Creates a plain object from a CreateProcessorRequest message. Also converts values to other types if specified. + * @param message CreateProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.CreateProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteProcessorRequest. */ + interface IDeleteProcessorRequest { + + /** DeleteProcessorRequest name */ + name?: (string|null); + } + + /** Represents a DeleteProcessorRequest. */ + class DeleteProcessorRequest implements IDeleteProcessorRequest { + + /** + * Constructs a new DeleteProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorRequest); + + /** DeleteProcessorRequest name. */ + public name: string; + + /** + * Creates a new DeleteProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProcessorRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorRequest): google.cloud.documentai.v1beta3.DeleteProcessorRequest; + + /** + * Encodes the specified DeleteProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorRequest.verify|verify} messages. + * @param message DeleteProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDeleteProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorRequest.verify|verify} messages. + * @param message DeleteProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeleteProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProcessorRequest + * @throws {Error} If the payload is not a 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.v1beta3.DeleteProcessorRequest; + + /** + * Decodes a DeleteProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProcessorRequest + * @throws {Error} If the payload is 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.v1beta3.DeleteProcessorRequest; + + /** + * Verifies a DeleteProcessorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeleteProcessorRequest; + + /** + * Creates a plain object from a DeleteProcessorRequest message. Also converts values to other types if specified. + * @param message DeleteProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DeleteProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteProcessorMetadata. */ + interface IDeleteProcessorMetadata { + + /** DeleteProcessorMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + } + + /** Represents a DeleteProcessorMetadata. */ + class DeleteProcessorMetadata implements IDeleteProcessorMetadata { + + /** + * Constructs a new DeleteProcessorMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorMetadata); + + /** DeleteProcessorMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** + * Creates a new DeleteProcessorMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteProcessorMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorMetadata): google.cloud.documentai.v1beta3.DeleteProcessorMetadata; + + /** + * Encodes the specified DeleteProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorMetadata.verify|verify} messages. + * @param message DeleteProcessorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDeleteProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorMetadata.verify|verify} messages. + * @param message DeleteProcessorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeleteProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteProcessorMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteProcessorMetadata + * @throws {Error} If the payload is not a 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.v1beta3.DeleteProcessorMetadata; + + /** + * Decodes a DeleteProcessorMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteProcessorMetadata + * @throws {Error} If the payload is 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.v1beta3.DeleteProcessorMetadata; + + /** + * Verifies a DeleteProcessorMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteProcessorMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteProcessorMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeleteProcessorMetadata; + + /** + * Creates a plain object from a DeleteProcessorMetadata message. Also converts values to other types if specified. + * @param message DeleteProcessorMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DeleteProcessorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteProcessorMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteProcessorMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnableProcessorRequest. */ + interface IEnableProcessorRequest { + + /** EnableProcessorRequest name */ + name?: (string|null); + } + + /** Represents an EnableProcessorRequest. */ + class EnableProcessorRequest implements IEnableProcessorRequest { + + /** + * Constructs a new EnableProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IEnableProcessorRequest); + + /** EnableProcessorRequest name. */ + public name: string; + + /** + * Creates a new EnableProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EnableProcessorRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IEnableProcessorRequest): google.cloud.documentai.v1beta3.EnableProcessorRequest; + + /** + * Encodes the specified EnableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorRequest.verify|verify} messages. + * @param message EnableProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IEnableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorRequest.verify|verify} messages. + * @param message EnableProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEnableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnableProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnableProcessorRequest + * @throws {Error} If the payload is not a 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.v1beta3.EnableProcessorRequest; + + /** + * Decodes an EnableProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnableProcessorRequest + * @throws {Error} If the payload is 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.v1beta3.EnableProcessorRequest; + + /** + * Verifies an EnableProcessorRequest message. + * @param message Plain 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 EnableProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnableProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EnableProcessorRequest; + + /** + * Creates a plain object from an EnableProcessorRequest message. Also converts values to other types if specified. + * @param message EnableProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.EnableProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnableProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnableProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnableProcessorResponse. */ + interface IEnableProcessorResponse { + } + + /** Represents an EnableProcessorResponse. */ + class EnableProcessorResponse implements IEnableProcessorResponse { + + /** + * Constructs a new EnableProcessorResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IEnableProcessorResponse); + + /** + * Creates a new EnableProcessorResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns EnableProcessorResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IEnableProcessorResponse): google.cloud.documentai.v1beta3.EnableProcessorResponse; + + /** + * Encodes the specified EnableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorResponse.verify|verify} messages. + * @param message EnableProcessorResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IEnableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorResponse.verify|verify} messages. + * @param message EnableProcessorResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEnableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnableProcessorResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnableProcessorResponse + * @throws {Error} If the payload is not a 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.v1beta3.EnableProcessorResponse; + + /** + * Decodes an EnableProcessorResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnableProcessorResponse + * @throws {Error} If the payload is 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.v1beta3.EnableProcessorResponse; + + /** + * Verifies an EnableProcessorResponse message. + * @param message Plain 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 EnableProcessorResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnableProcessorResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EnableProcessorResponse; + + /** + * Creates a plain object from an EnableProcessorResponse message. Also converts values to other types if specified. + * @param message EnableProcessorResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.EnableProcessorResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnableProcessorResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnableProcessorResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnableProcessorMetadata. */ + interface IEnableProcessorMetadata { + + /** EnableProcessorMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + } + + /** Represents an EnableProcessorMetadata. */ + class EnableProcessorMetadata implements IEnableProcessorMetadata { + + /** + * Constructs a new EnableProcessorMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IEnableProcessorMetadata); + + /** EnableProcessorMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** + * Creates a new EnableProcessorMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns EnableProcessorMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IEnableProcessorMetadata): google.cloud.documentai.v1beta3.EnableProcessorMetadata; + + /** + * Encodes the specified EnableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorMetadata.verify|verify} messages. + * @param message EnableProcessorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IEnableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorMetadata.verify|verify} messages. + * @param message EnableProcessorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEnableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnableProcessorMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnableProcessorMetadata + * @throws {Error} If the payload is not a 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.v1beta3.EnableProcessorMetadata; + + /** + * Decodes an EnableProcessorMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnableProcessorMetadata + * @throws {Error} If the payload is 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.v1beta3.EnableProcessorMetadata; + + /** + * Verifies an EnableProcessorMetadata message. + * @param message Plain 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 EnableProcessorMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnableProcessorMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EnableProcessorMetadata; + + /** + * Creates a plain object from an EnableProcessorMetadata message. Also converts values to other types if specified. + * @param message EnableProcessorMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.EnableProcessorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnableProcessorMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnableProcessorMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisableProcessorRequest. */ + interface IDisableProcessorRequest { + + /** DisableProcessorRequest name */ + name?: (string|null); + } + + /** Represents a DisableProcessorRequest. */ + class DisableProcessorRequest implements IDisableProcessorRequest { + + /** + * Constructs a new DisableProcessorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDisableProcessorRequest); + + /** DisableProcessorRequest name. */ + public name: string; + + /** + * Creates a new DisableProcessorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableProcessorRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDisableProcessorRequest): google.cloud.documentai.v1beta3.DisableProcessorRequest; + + /** + * Encodes the specified DisableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorRequest.verify|verify} messages. + * @param message DisableProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDisableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorRequest.verify|verify} messages. + * @param message DisableProcessorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDisableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableProcessorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableProcessorRequest + * @throws {Error} If the payload is not a 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.v1beta3.DisableProcessorRequest; + + /** + * Decodes a DisableProcessorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableProcessorRequest + * @throws {Error} If the payload is 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.v1beta3.DisableProcessorRequest; + + /** + * Verifies a DisableProcessorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisableProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableProcessorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DisableProcessorRequest; + + /** + * Creates a plain object from a DisableProcessorRequest message. Also converts values to other types if specified. + * @param message DisableProcessorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DisableProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableProcessorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisableProcessorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisableProcessorResponse. */ + interface IDisableProcessorResponse { + } + + /** Represents a DisableProcessorResponse. */ + class DisableProcessorResponse implements IDisableProcessorResponse { + + /** + * Constructs a new DisableProcessorResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDisableProcessorResponse); + + /** + * Creates a new DisableProcessorResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableProcessorResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDisableProcessorResponse): google.cloud.documentai.v1beta3.DisableProcessorResponse; + + /** + * Encodes the specified DisableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorResponse.verify|verify} messages. + * @param message DisableProcessorResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDisableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorResponse.verify|verify} messages. + * @param message DisableProcessorResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDisableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableProcessorResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableProcessorResponse + * @throws {Error} If the payload is not a 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.v1beta3.DisableProcessorResponse; + + /** + * Decodes a DisableProcessorResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableProcessorResponse + * @throws {Error} If the payload is 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.v1beta3.DisableProcessorResponse; + + /** + * Verifies a DisableProcessorResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisableProcessorResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableProcessorResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DisableProcessorResponse; + + /** + * Creates a plain object from a DisableProcessorResponse message. Also converts values to other types if specified. + * @param message DisableProcessorResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DisableProcessorResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableProcessorResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisableProcessorResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisableProcessorMetadata. */ + interface IDisableProcessorMetadata { + + /** DisableProcessorMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + } + + /** Represents a DisableProcessorMetadata. */ + class DisableProcessorMetadata implements IDisableProcessorMetadata { + + /** + * Constructs a new DisableProcessorMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDisableProcessorMetadata); + + /** DisableProcessorMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** + * Creates a new DisableProcessorMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableProcessorMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDisableProcessorMetadata): google.cloud.documentai.v1beta3.DisableProcessorMetadata; + + /** + * Encodes the specified DisableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorMetadata.verify|verify} messages. + * @param message DisableProcessorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDisableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorMetadata.verify|verify} messages. + * @param message DisableProcessorMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDisableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableProcessorMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableProcessorMetadata + * @throws {Error} If the payload is not a 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.v1beta3.DisableProcessorMetadata; + + /** + * Decodes a DisableProcessorMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableProcessorMetadata + * @throws {Error} If the payload is 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.v1beta3.DisableProcessorMetadata; + + /** + * Verifies a DisableProcessorMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisableProcessorMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableProcessorMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DisableProcessorMetadata; + + /** + * Creates a plain object from a DisableProcessorMetadata message. Also converts values to other types if specified. + * @param message DisableProcessorMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DisableProcessorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableProcessorMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisableProcessorMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SetDefaultProcessorVersionRequest. */ + interface ISetDefaultProcessorVersionRequest { + + /** SetDefaultProcessorVersionRequest processor */ + processor?: (string|null); + + /** SetDefaultProcessorVersionRequest defaultProcessorVersion */ + defaultProcessorVersion?: (string|null); + } + + /** Represents a SetDefaultProcessorVersionRequest. */ + class SetDefaultProcessorVersionRequest implements ISetDefaultProcessorVersionRequest { + + /** + * Constructs a new SetDefaultProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest); + + /** SetDefaultProcessorVersionRequest processor. */ + public processor: string; + + /** SetDefaultProcessorVersionRequest defaultProcessorVersion. */ + public defaultProcessorVersion: string; + + /** + * Creates a new SetDefaultProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetDefaultProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest): google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; + + /** + * Encodes the specified SetDefaultProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.verify|verify} messages. + * @param message SetDefaultProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetDefaultProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.verify|verify} messages. + * @param message SetDefaultProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetDefaultProcessorVersionRequest + * @throws {Error} If the payload is not a 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.v1beta3.SetDefaultProcessorVersionRequest; + + /** + * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetDefaultProcessorVersionRequest + * @throws {Error} If the payload is 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.v1beta3.SetDefaultProcessorVersionRequest; + + /** + * Verifies a SetDefaultProcessorVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetDefaultProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetDefaultProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; + + /** + * Creates a plain object from a SetDefaultProcessorVersionRequest message. Also converts values to other types if specified. + * @param message SetDefaultProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetDefaultProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetDefaultProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SetDefaultProcessorVersionResponse. */ + interface ISetDefaultProcessorVersionResponse { + } + + /** Represents a SetDefaultProcessorVersionResponse. */ + class SetDefaultProcessorVersionResponse implements ISetDefaultProcessorVersionResponse { + + /** + * Constructs a new SetDefaultProcessorVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse); + + /** + * Creates a new SetDefaultProcessorVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SetDefaultProcessorVersionResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse): google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse; + + /** + * Encodes the specified SetDefaultProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.verify|verify} messages. + * @param message SetDefaultProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetDefaultProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.verify|verify} messages. + * @param message SetDefaultProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetDefaultProcessorVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetDefaultProcessorVersionResponse + * @throws {Error} If the payload is not a 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.v1beta3.SetDefaultProcessorVersionResponse; + + /** + * Decodes a SetDefaultProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetDefaultProcessorVersionResponse + * @throws {Error} If the payload is 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.v1beta3.SetDefaultProcessorVersionResponse; + + /** + * Verifies a SetDefaultProcessorVersionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetDefaultProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetDefaultProcessorVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse; + + /** + * Creates a plain object from a SetDefaultProcessorVersionResponse message. Also converts values to other types if specified. + * @param message SetDefaultProcessorVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetDefaultProcessorVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetDefaultProcessorVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SetDefaultProcessorVersionMetadata. */ + interface ISetDefaultProcessorVersionMetadata { + + /** SetDefaultProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + } + + /** Represents a SetDefaultProcessorVersionMetadata. */ + class SetDefaultProcessorVersionMetadata implements ISetDefaultProcessorVersionMetadata { + + /** + * Constructs a new SetDefaultProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata); + + /** SetDefaultProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** + * Creates a new SetDefaultProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns SetDefaultProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata): google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata; + + /** + * Encodes the specified SetDefaultProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.verify|verify} messages. + * @param message SetDefaultProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetDefaultProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.verify|verify} messages. + * @param message SetDefaultProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetDefaultProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.v1beta3.SetDefaultProcessorVersionMetadata; + + /** + * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetDefaultProcessorVersionMetadata + * @throws {Error} If the payload is 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.v1beta3.SetDefaultProcessorVersionMetadata; + + /** + * Verifies a SetDefaultProcessorVersionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetDefaultProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetDefaultProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata; + + /** + * Creates a plain object from a SetDefaultProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message SetDefaultProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetDefaultProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SetDefaultProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrainProcessorVersionRequest. */ + interface ITrainProcessorVersionRequest { + + /** TrainProcessorVersionRequest customDocumentExtractionOptions */ + customDocumentExtractionOptions?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null); + + /** TrainProcessorVersionRequest foundationModelTuningOptions */ + foundationModelTuningOptions?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null); + + /** TrainProcessorVersionRequest parent */ + parent?: (string|null); + + /** TrainProcessorVersionRequest processorVersion */ + processorVersion?: (google.cloud.documentai.v1beta3.IProcessorVersion|null); + + /** TrainProcessorVersionRequest documentSchema */ + documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); + + /** TrainProcessorVersionRequest inputData */ + inputData?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData|null); + + /** TrainProcessorVersionRequest baseProcessorVersion */ + baseProcessorVersion?: (string|null); + } + + /** Represents a TrainProcessorVersionRequest. */ + class TrainProcessorVersionRequest implements ITrainProcessorVersionRequest { + + /** + * Constructs a new TrainProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest); + + /** TrainProcessorVersionRequest customDocumentExtractionOptions. */ + public customDocumentExtractionOptions?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null); + + /** TrainProcessorVersionRequest foundationModelTuningOptions. */ + public foundationModelTuningOptions?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null); + + /** TrainProcessorVersionRequest parent. */ + public parent: string; + + /** TrainProcessorVersionRequest processorVersion. */ + public processorVersion?: (google.cloud.documentai.v1beta3.IProcessorVersion|null); + + /** TrainProcessorVersionRequest documentSchema. */ + public documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); + + /** TrainProcessorVersionRequest inputData. */ + public inputData?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData|null); + + /** TrainProcessorVersionRequest baseProcessorVersion. */ + public baseProcessorVersion: string; + + /** TrainProcessorVersionRequest processorFlags. */ + public processorFlags?: ("customDocumentExtractionOptions"|"foundationModelTuningOptions"); + + /** + * Creates a new TrainProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest; + + /** + * Encodes the specified TrainProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.verify|verify} messages. + * @param message TrainProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.verify|verify} messages. + * @param message TrainProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainProcessorVersionRequest + * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionRequest; + + /** + * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainProcessorVersionRequest + * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionRequest; + + /** + * Verifies a TrainProcessorVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrainProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest; + + /** + * Creates a plain object from a TrainProcessorVersionRequest message. Also converts values to other types if specified. + * @param message TrainProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrainProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TrainProcessorVersionRequest { + + /** Properties of an InputData. */ + interface IInputData { + + /** InputData trainingDocuments */ + trainingDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); + + /** InputData testDocuments */ + testDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); + } + + /** Represents an InputData. */ + class InputData implements IInputData { + + /** + * Constructs a new InputData. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData); + + /** InputData trainingDocuments. */ + public trainingDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); + + /** InputData testDocuments. */ + public testDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); + + /** + * Creates a new InputData instance using the specified properties. + * @param [properties] Properties to set + * @returns InputData instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData; + + /** + * Encodes the specified InputData message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.verify|verify} messages. + * @param message InputData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputData message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.verify|verify} messages. + * @param message InputData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputData + * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionRequest.InputData; + + /** + * Decodes an InputData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputData + * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionRequest.InputData; + + /** + * Verifies an InputData message. + * @param message Plain 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 InputData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputData + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData; + + /** + * Creates a plain object from an InputData message. Also converts values to other types if specified. + * @param message InputData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomDocumentExtractionOptions. */ + interface ICustomDocumentExtractionOptions { + + /** CustomDocumentExtractionOptions trainingMethod */ + trainingMethod?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|keyof typeof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|null); + } + + /** Represents a CustomDocumentExtractionOptions. */ + class CustomDocumentExtractionOptions implements ICustomDocumentExtractionOptions { + + /** + * Constructs a new CustomDocumentExtractionOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions); + + /** CustomDocumentExtractionOptions trainingMethod. */ + public trainingMethod: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|keyof typeof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod); + + /** + * Creates a new CustomDocumentExtractionOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomDocumentExtractionOptions instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; + + /** + * Encodes the specified CustomDocumentExtractionOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. + * @param message CustomDocumentExtractionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomDocumentExtractionOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. + * @param message CustomDocumentExtractionOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomDocumentExtractionOptions + * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; + + /** + * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomDocumentExtractionOptions + * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; + + /** + * Verifies a CustomDocumentExtractionOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomDocumentExtractionOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomDocumentExtractionOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; + + /** + * Creates a plain object from a CustomDocumentExtractionOptions message. Also converts values to other types if specified. + * @param message CustomDocumentExtractionOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomDocumentExtractionOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomDocumentExtractionOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomDocumentExtractionOptions { + + /** TrainingMethod enum. */ + enum TrainingMethod { + TRAINING_METHOD_UNSPECIFIED = 0, + MODEL_BASED = 1, + TEMPLATE_BASED = 2 + } + } + + /** Properties of a FoundationModelTuningOptions. */ + interface IFoundationModelTuningOptions { + + /** FoundationModelTuningOptions trainSteps */ + trainSteps?: (number|null); + + /** FoundationModelTuningOptions learningRateMultiplier */ + learningRateMultiplier?: (number|null); + } + + /** Represents a FoundationModelTuningOptions. */ + class FoundationModelTuningOptions implements IFoundationModelTuningOptions { + + /** + * Constructs a new FoundationModelTuningOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions); + + /** FoundationModelTuningOptions trainSteps. */ + public trainSteps: number; + + /** FoundationModelTuningOptions learningRateMultiplier. */ + public learningRateMultiplier: number; + + /** + * Creates a new FoundationModelTuningOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FoundationModelTuningOptions instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions; + + /** + * Encodes the specified FoundationModelTuningOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. + * @param message FoundationModelTuningOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FoundationModelTuningOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. + * @param message FoundationModelTuningOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FoundationModelTuningOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FoundationModelTuningOptions + * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions; + + /** + * Decodes a FoundationModelTuningOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FoundationModelTuningOptions + * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions; + + /** + * Verifies a FoundationModelTuningOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FoundationModelTuningOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FoundationModelTuningOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions; + + /** + * Creates a plain object from a FoundationModelTuningOptions message. Also converts values to other types if specified. + * @param message FoundationModelTuningOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FoundationModelTuningOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FoundationModelTuningOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TrainProcessorVersionResponse. */ + interface ITrainProcessorVersionResponse { + + /** TrainProcessorVersionResponse processorVersion */ + processorVersion?: (string|null); + } + + /** Represents a TrainProcessorVersionResponse. */ + class TrainProcessorVersionResponse implements ITrainProcessorVersionResponse { + + /** + * Constructs a new TrainProcessorVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse); + + /** TrainProcessorVersionResponse processorVersion. */ + public processorVersion: string; + + /** + * Creates a new TrainProcessorVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainProcessorVersionResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse): google.cloud.documentai.v1beta3.TrainProcessorVersionResponse; + + /** + * Encodes the specified TrainProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionResponse.verify|verify} messages. + * @param message TrainProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionResponse.verify|verify} messages. + * @param message TrainProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainProcessorVersionResponse + * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionResponse; + + /** + * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainProcessorVersionResponse + * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionResponse; + + /** + * Verifies a TrainProcessorVersionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrainProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainProcessorVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionResponse; + + /** + * Creates a plain object from a TrainProcessorVersionResponse message. Also converts values to other types if specified. + * @param message TrainProcessorVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainProcessorVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrainProcessorVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrainProcessorVersionMetadata. */ + interface ITrainProcessorVersionMetadata { + + /** TrainProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** TrainProcessorVersionMetadata trainingDatasetValidation */ + trainingDatasetValidation?: (google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null); + + /** TrainProcessorVersionMetadata testDatasetValidation */ + testDatasetValidation?: (google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null); + } + + /** Represents a TrainProcessorVersionMetadata. */ + class TrainProcessorVersionMetadata implements ITrainProcessorVersionMetadata { + + /** + * Constructs a new TrainProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata); + + /** TrainProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** TrainProcessorVersionMetadata trainingDatasetValidation. */ + public trainingDatasetValidation?: (google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null); + + /** TrainProcessorVersionMetadata testDatasetValidation. */ + public testDatasetValidation?: (google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null); + + /** + * Creates a new TrainProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata): google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata; + + /** + * Encodes the specified TrainProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.verify|verify} messages. + * @param message TrainProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.verify|verify} messages. + * @param message TrainProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionMetadata; + + /** + * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainProcessorVersionMetadata + * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionMetadata; + + /** + * Verifies a TrainProcessorVersionMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrainProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata; + + /** + * Creates a plain object from a TrainProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message TrainProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrainProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TrainProcessorVersionMetadata { + + /** Properties of a DatasetValidation. */ + interface IDatasetValidation { + + /** DatasetValidation documentErrorCount */ + documentErrorCount?: (number|null); + + /** DatasetValidation datasetErrorCount */ + datasetErrorCount?: (number|null); + + /** DatasetValidation documentErrors */ + documentErrors?: (google.rpc.IStatus[]|null); + + /** DatasetValidation datasetErrors */ + datasetErrors?: (google.rpc.IStatus[]|null); + } + + /** Represents a DatasetValidation. */ + class DatasetValidation implements IDatasetValidation { + + /** + * Constructs a new DatasetValidation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation); + + /** DatasetValidation documentErrorCount. */ + public documentErrorCount: number; + + /** DatasetValidation datasetErrorCount. */ + public datasetErrorCount: number; + + /** DatasetValidation documentErrors. */ + public documentErrors: google.rpc.IStatus[]; + + /** DatasetValidation datasetErrors. */ + public datasetErrors: google.rpc.IStatus[]; + + /** + * Creates a new DatasetValidation instance using the specified properties. + * @param [properties] Properties to set + * @returns DatasetValidation instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation): google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation; + + /** + * Encodes the specified DatasetValidation message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. + * @param message DatasetValidation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DatasetValidation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. + * @param message DatasetValidation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DatasetValidation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatasetValidation + * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionMetadata.DatasetValidation; + + /** + * Decodes a DatasetValidation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatasetValidation + * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionMetadata.DatasetValidation; + + /** + * Verifies a DatasetValidation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DatasetValidation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatasetValidation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation; + + /** + * Creates a plain object from a DatasetValidation message. Also converts values to other types if specified. + * @param message DatasetValidation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DatasetValidation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DatasetValidation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ReviewDocumentRequest. */ + interface IReviewDocumentRequest { + + /** ReviewDocumentRequest inlineDocument */ + inlineDocument?: (google.cloud.documentai.v1beta3.IDocument|null); + + /** ReviewDocumentRequest humanReviewConfig */ + humanReviewConfig?: (string|null); + + /** ReviewDocumentRequest document */ + document?: (google.cloud.documentai.v1beta3.IDocument|null); + + /** ReviewDocumentRequest enableSchemaValidation */ + enableSchemaValidation?: (boolean|null); + + /** ReviewDocumentRequest priority */ + priority?: (google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority|keyof typeof google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority|null); + + /** ReviewDocumentRequest documentSchema */ + documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); + } + + /** Represents a ReviewDocumentRequest. */ + class ReviewDocumentRequest implements IReviewDocumentRequest { + + /** + * Constructs a new ReviewDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IReviewDocumentRequest); + + /** ReviewDocumentRequest inlineDocument. */ + public inlineDocument?: (google.cloud.documentai.v1beta3.IDocument|null); + + /** ReviewDocumentRequest humanReviewConfig. */ + public humanReviewConfig: string; + + /** ReviewDocumentRequest document. */ + public document?: (google.cloud.documentai.v1beta3.IDocument|null); + + /** ReviewDocumentRequest enableSchemaValidation. */ + public enableSchemaValidation: boolean; + + /** ReviewDocumentRequest priority. */ + public priority: (google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority|keyof typeof google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority); + + /** ReviewDocumentRequest documentSchema. */ + public documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); + + /** ReviewDocumentRequest source. */ + public source?: "inlineDocument"; + + /** + * Creates a new ReviewDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReviewDocumentRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IReviewDocumentRequest): google.cloud.documentai.v1beta3.ReviewDocumentRequest; + + /** + * Encodes the specified ReviewDocumentRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentRequest.verify|verify} messages. + * @param message ReviewDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IReviewDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReviewDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentRequest.verify|verify} messages. + * @param message ReviewDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IReviewDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReviewDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReviewDocumentRequest + * @throws {Error} If the payload is not a 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.v1beta3.ReviewDocumentRequest; + + /** + * Decodes a ReviewDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReviewDocumentRequest + * @throws {Error} If the payload is 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.v1beta3.ReviewDocumentRequest; + + /** + * Verifies a ReviewDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReviewDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReviewDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ReviewDocumentRequest; + + /** + * Creates a plain object from a ReviewDocumentRequest message. Also converts values to other types if specified. + * @param message ReviewDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ReviewDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReviewDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReviewDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReviewDocumentRequest { + + /** Priority enum. */ + enum Priority { + DEFAULT = 0, + URGENT = 1 + } + } + + /** Properties of a ReviewDocumentResponse. */ + interface IReviewDocumentResponse { + + /** ReviewDocumentResponse gcsDestination */ + gcsDestination?: (string|null); + + /** ReviewDocumentResponse state */ + state?: (google.cloud.documentai.v1beta3.ReviewDocumentResponse.State|keyof typeof google.cloud.documentai.v1beta3.ReviewDocumentResponse.State|null); + + /** ReviewDocumentResponse rejectionReason */ + rejectionReason?: (string|null); + } + + /** Represents a ReviewDocumentResponse. */ + class ReviewDocumentResponse implements IReviewDocumentResponse { + + /** + * Constructs a new ReviewDocumentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IReviewDocumentResponse); + + /** ReviewDocumentResponse gcsDestination. */ + public gcsDestination: string; + + /** ReviewDocumentResponse state. */ + public state: (google.cloud.documentai.v1beta3.ReviewDocumentResponse.State|keyof typeof google.cloud.documentai.v1beta3.ReviewDocumentResponse.State); + + /** ReviewDocumentResponse rejectionReason. */ + public rejectionReason: string; + + /** + * Creates a new ReviewDocumentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReviewDocumentResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IReviewDocumentResponse): google.cloud.documentai.v1beta3.ReviewDocumentResponse; + + /** + * Encodes the specified ReviewDocumentResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentResponse.verify|verify} messages. + * @param message ReviewDocumentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IReviewDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReviewDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentResponse.verify|verify} messages. + * @param message ReviewDocumentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IReviewDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReviewDocumentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReviewDocumentResponse + * @throws {Error} If the payload is not a 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.v1beta3.ReviewDocumentResponse; + + /** + * Decodes a ReviewDocumentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReviewDocumentResponse + * @throws {Error} If the payload is 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.v1beta3.ReviewDocumentResponse; + + /** + * Verifies a ReviewDocumentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReviewDocumentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReviewDocumentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ReviewDocumentResponse; + + /** + * Creates a plain object from a ReviewDocumentResponse message. Also converts values to other types if specified. + * @param message ReviewDocumentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ReviewDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReviewDocumentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReviewDocumentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReviewDocumentResponse { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + REJECTED = 1, + SUCCEEDED = 2 + } + } + + /** Properties of a ReviewDocumentOperationMetadata. */ + interface IReviewDocumentOperationMetadata { + + /** ReviewDocumentOperationMetadata state */ + state?: (google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State|keyof typeof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State|null); + + /** ReviewDocumentOperationMetadata stateMessage */ + stateMessage?: (string|null); + + /** ReviewDocumentOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ReviewDocumentOperationMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ReviewDocumentOperationMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** ReviewDocumentOperationMetadata questionId */ + questionId?: (string|null); + } + + /** Represents a ReviewDocumentOperationMetadata. */ + class ReviewDocumentOperationMetadata implements IReviewDocumentOperationMetadata { + + /** + * Constructs a new ReviewDocumentOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata); + + /** ReviewDocumentOperationMetadata state. */ + public state: (google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State|keyof typeof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State); + + /** ReviewDocumentOperationMetadata stateMessage. */ + public stateMessage: string; + + /** ReviewDocumentOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ReviewDocumentOperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ReviewDocumentOperationMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** ReviewDocumentOperationMetadata questionId. */ + public questionId: string; + + /** + * Creates a new ReviewDocumentOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ReviewDocumentOperationMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata): google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata; + + /** + * Encodes the specified ReviewDocumentOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.verify|verify} messages. + * @param message ReviewDocumentOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReviewDocumentOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.verify|verify} messages. + * @param message ReviewDocumentOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReviewDocumentOperationMetadata + * @throws {Error} If the payload is not a 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.v1beta3.ReviewDocumentOperationMetadata; + + /** + * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReviewDocumentOperationMetadata + * @throws {Error} If the payload is 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.v1beta3.ReviewDocumentOperationMetadata; + + /** + * Verifies a ReviewDocumentOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReviewDocumentOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReviewDocumentOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata; + + /** + * Creates a plain object from a ReviewDocumentOperationMetadata message. Also converts values to other types if specified. + * @param message ReviewDocumentOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReviewDocumentOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReviewDocumentOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReviewDocumentOperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + CANCELLING = 2, + SUCCEEDED = 3, + FAILED = 4, + CANCELLED = 5 + } + } + + /** Properties of an EvaluateProcessorVersionRequest. */ + interface IEvaluateProcessorVersionRequest { + + /** EvaluateProcessorVersionRequest processorVersion */ + processorVersion?: (string|null); + + /** EvaluateProcessorVersionRequest evaluationDocuments */ + evaluationDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); + } + + /** Represents an EvaluateProcessorVersionRequest. */ + class EvaluateProcessorVersionRequest implements IEvaluateProcessorVersionRequest { + + /** + * Constructs a new EvaluateProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest); + + /** EvaluateProcessorVersionRequest processorVersion. */ + public processorVersion: string; + + /** EvaluateProcessorVersionRequest evaluationDocuments. */ + public evaluationDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); + + /** + * Creates a new EvaluateProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluateProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest): google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest; + + /** + * Encodes the specified EvaluateProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest.verify|verify} messages. + * @param message EvaluateProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluateProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest.verify|verify} messages. + * @param message EvaluateProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluateProcessorVersionRequest + * @throws {Error} If the payload is not a 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.v1beta3.EvaluateProcessorVersionRequest; + + /** + * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluateProcessorVersionRequest + * @throws {Error} If the payload is 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.v1beta3.EvaluateProcessorVersionRequest; + + /** + * Verifies an EvaluateProcessorVersionRequest message. + * @param message Plain 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 EvaluateProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluateProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest; + + /** + * Creates a plain object from an EvaluateProcessorVersionRequest message. Also converts values to other types if specified. + * @param message EvaluateProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluateProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluateProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluateProcessorVersionMetadata. */ + interface IEvaluateProcessorVersionMetadata { + + /** EvaluateProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + } + + /** Represents an EvaluateProcessorVersionMetadata. */ + class EvaluateProcessorVersionMetadata implements IEvaluateProcessorVersionMetadata { + + /** + * Constructs a new EvaluateProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata); + + /** EvaluateProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** + * Creates a new EvaluateProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluateProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata): google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata; + + /** + * Encodes the specified EvaluateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata.verify|verify} messages. + * @param message EvaluateProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata.verify|verify} messages. + * @param message EvaluateProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluateProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.v1beta3.EvaluateProcessorVersionMetadata; + + /** + * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluateProcessorVersionMetadata + * @throws {Error} If the payload is 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.v1beta3.EvaluateProcessorVersionMetadata; + + /** + * Verifies an EvaluateProcessorVersionMetadata message. + * @param message Plain 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 EvaluateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluateProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata; + + /** + * Creates a plain object from an EvaluateProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message EvaluateProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluateProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluateProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluateProcessorVersionResponse. */ + interface IEvaluateProcessorVersionResponse { + + /** EvaluateProcessorVersionResponse evaluation */ + evaluation?: (string|null); + } + + /** Represents an EvaluateProcessorVersionResponse. */ + class EvaluateProcessorVersionResponse implements IEvaluateProcessorVersionResponse { + + /** + * Constructs a new EvaluateProcessorVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse); + + /** EvaluateProcessorVersionResponse evaluation. */ + public evaluation: string; + + /** + * Creates a new EvaluateProcessorVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluateProcessorVersionResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse): google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse; + + /** + * Encodes the specified EvaluateProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse.verify|verify} messages. + * @param message EvaluateProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluateProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse.verify|verify} messages. + * @param message EvaluateProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluateProcessorVersionResponse + * @throws {Error} If the payload is not a 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.v1beta3.EvaluateProcessorVersionResponse; + + /** + * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluateProcessorVersionResponse + * @throws {Error} If the payload is 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.v1beta3.EvaluateProcessorVersionResponse; + + /** + * Verifies an EvaluateProcessorVersionResponse message. + * @param message Plain 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 EvaluateProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluateProcessorVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse; + + /** + * Creates a plain object from an EvaluateProcessorVersionResponse message. Also converts values to other types if specified. + * @param message EvaluateProcessorVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluateProcessorVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluateProcessorVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetEvaluationRequest. */ + interface IGetEvaluationRequest { + + /** GetEvaluationRequest name */ + name?: (string|null); + } + + /** Represents a GetEvaluationRequest. */ + class GetEvaluationRequest implements IGetEvaluationRequest { + + /** + * Constructs a new GetEvaluationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGetEvaluationRequest); + + /** GetEvaluationRequest name. */ + public name: string; + + /** + * Creates a new GetEvaluationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEvaluationRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IGetEvaluationRequest): google.cloud.documentai.v1beta3.GetEvaluationRequest; + + /** + * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetEvaluationRequest.verify|verify} messages. + * @param message GetEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetEvaluationRequest.verify|verify} messages. + * @param message GetEvaluationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEvaluationRequest + * @throws {Error} If the payload is not a 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.v1beta3.GetEvaluationRequest; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEvaluationRequest + * @throws {Error} If the payload is 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.v1beta3.GetEvaluationRequest; + + /** + * Verifies a GetEvaluationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEvaluationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GetEvaluationRequest; + + /** + * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. + * @param message GetEvaluationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.GetEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEvaluationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetEvaluationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationsRequest. */ + interface IListEvaluationsRequest { + + /** ListEvaluationsRequest parent */ + parent?: (string|null); + + /** ListEvaluationsRequest pageSize */ + pageSize?: (number|null); + + /** ListEvaluationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEvaluationsRequest. */ + class ListEvaluationsRequest implements IListEvaluationsRequest { + + /** + * Constructs a new ListEvaluationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IListEvaluationsRequest); + + /** ListEvaluationsRequest parent. */ + public parent: string; + + /** ListEvaluationsRequest pageSize. */ + public pageSize: number; + + /** ListEvaluationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEvaluationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationsRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IListEvaluationsRequest): google.cloud.documentai.v1beta3.ListEvaluationsRequest; + + /** + * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsRequest.verify|verify} messages. + * @param message ListEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsRequest.verify|verify} messages. + * @param message ListEvaluationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationsRequest + * @throws {Error} If the payload is not a 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.v1beta3.ListEvaluationsRequest; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationsRequest + * @throws {Error} If the payload is 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.v1beta3.ListEvaluationsRequest; + + /** + * Verifies a ListEvaluationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListEvaluationsRequest; + + /** + * Creates a plain object from a ListEvaluationsRequest message. Also converts values to other types if specified. + * @param message ListEvaluationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ListEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListEvaluationsResponse. */ + interface IListEvaluationsResponse { + + /** ListEvaluationsResponse evaluations */ + evaluations?: (google.cloud.documentai.v1beta3.IEvaluation[]|null); + + /** ListEvaluationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEvaluationsResponse. */ + class ListEvaluationsResponse implements IListEvaluationsResponse { + + /** + * Constructs a new ListEvaluationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IListEvaluationsResponse); + + /** ListEvaluationsResponse evaluations. */ + public evaluations: google.cloud.documentai.v1beta3.IEvaluation[]; + + /** ListEvaluationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEvaluationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEvaluationsResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IListEvaluationsResponse): google.cloud.documentai.v1beta3.ListEvaluationsResponse; + + /** + * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsResponse.verify|verify} messages. + * @param message ListEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsResponse.verify|verify} messages. + * @param message ListEvaluationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEvaluationsResponse + * @throws {Error} If the payload is not a 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.v1beta3.ListEvaluationsResponse; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEvaluationsResponse + * @throws {Error} If the payload is 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.v1beta3.ListEvaluationsResponse; + + /** + * Verifies a ListEvaluationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEvaluationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListEvaluationsResponse; + + /** + * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. + * @param message ListEvaluationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ListEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEvaluationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListEvaluationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportProcessorVersionRequest. */ + interface IImportProcessorVersionRequest { + + /** ImportProcessorVersionRequest processorVersionSource */ + processorVersionSource?: (string|null); + + /** ImportProcessorVersionRequest externalProcessorVersionSource */ + externalProcessorVersionSource?: (google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource|null); + + /** ImportProcessorVersionRequest parent */ + parent?: (string|null); + } + + /** Represents an ImportProcessorVersionRequest. */ + class ImportProcessorVersionRequest implements IImportProcessorVersionRequest { + + /** + * Constructs a new ImportProcessorVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionRequest); + + /** ImportProcessorVersionRequest processorVersionSource. */ + public processorVersionSource?: (string|null); + + /** ImportProcessorVersionRequest externalProcessorVersionSource. */ + public externalProcessorVersionSource?: (google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource|null); + + /** ImportProcessorVersionRequest parent. */ + public parent: string; + + /** ImportProcessorVersionRequest source. */ + public source?: ("processorVersionSource"|"externalProcessorVersionSource"); + + /** + * Creates a new ImportProcessorVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProcessorVersionRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionRequest): google.cloud.documentai.v1beta3.ImportProcessorVersionRequest; + + /** + * Encodes the specified ImportProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.verify|verify} messages. + * @param message ImportProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.verify|verify} messages. + * @param message ImportProcessorVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProcessorVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProcessorVersionRequest + * @throws {Error} If the payload is not a 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.v1beta3.ImportProcessorVersionRequest; + + /** + * Decodes an ImportProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProcessorVersionRequest + * @throws {Error} If the payload is 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.v1beta3.ImportProcessorVersionRequest; + + /** + * Verifies an ImportProcessorVersionRequest message. + * @param message Plain 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 ImportProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProcessorVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportProcessorVersionRequest; + + /** + * Creates a plain object from an ImportProcessorVersionRequest message. Also converts values to other types if specified. + * @param message ImportProcessorVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ImportProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProcessorVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportProcessorVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportProcessorVersionRequest { + + /** Properties of an ExternalProcessorVersionSource. */ + interface IExternalProcessorVersionSource { + + /** ExternalProcessorVersionSource processorVersion */ + processorVersion?: (string|null); + + /** ExternalProcessorVersionSource serviceEndpoint */ + serviceEndpoint?: (string|null); + } + + /** Represents an ExternalProcessorVersionSource. */ + class ExternalProcessorVersionSource implements IExternalProcessorVersionSource { + + /** + * Constructs a new ExternalProcessorVersionSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource); + + /** ExternalProcessorVersionSource processorVersion. */ + public processorVersion: string; + + /** ExternalProcessorVersionSource serviceEndpoint. */ + public serviceEndpoint: string; + + /** + * Creates a new ExternalProcessorVersionSource instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalProcessorVersionSource instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource): google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource; + + /** + * Encodes the specified ExternalProcessorVersionSource message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.verify|verify} messages. + * @param message ExternalProcessorVersionSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalProcessorVersionSource message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.verify|verify} messages. + * @param message ExternalProcessorVersionSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalProcessorVersionSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalProcessorVersionSource + * @throws {Error} If the payload is not a 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.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource; + + /** + * Decodes an ExternalProcessorVersionSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalProcessorVersionSource + * @throws {Error} If the payload is 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.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource; + + /** + * Verifies an ExternalProcessorVersionSource message. + * @param message Plain 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 ExternalProcessorVersionSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalProcessorVersionSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource; + + /** + * Creates a plain object from an ExternalProcessorVersionSource message. Also converts values to other types if specified. + * @param message ExternalProcessorVersionSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalProcessorVersionSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExternalProcessorVersionSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ImportProcessorVersionResponse. */ + interface IImportProcessorVersionResponse { + + /** ImportProcessorVersionResponse processorVersion */ + processorVersion?: (string|null); + } + + /** Represents an ImportProcessorVersionResponse. */ + class ImportProcessorVersionResponse implements IImportProcessorVersionResponse { + + /** + * Constructs a new ImportProcessorVersionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionResponse); + + /** ImportProcessorVersionResponse processorVersion. */ + public processorVersion: string; + + /** + * Creates a new ImportProcessorVersionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProcessorVersionResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionResponse): google.cloud.documentai.v1beta3.ImportProcessorVersionResponse; + + /** + * Encodes the specified ImportProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionResponse.verify|verify} messages. + * @param message ImportProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IImportProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionResponse.verify|verify} messages. + * @param message ImportProcessorVersionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProcessorVersionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProcessorVersionResponse + * @throws {Error} If the payload is not a 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.v1beta3.ImportProcessorVersionResponse; + + /** + * Decodes an ImportProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProcessorVersionResponse + * @throws {Error} If the payload is 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.v1beta3.ImportProcessorVersionResponse; + + /** + * Verifies an ImportProcessorVersionResponse message. + * @param message Plain 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 ImportProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProcessorVersionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportProcessorVersionResponse; + + /** + * Creates a plain object from an ImportProcessorVersionResponse message. Also converts values to other types if specified. + * @param message ImportProcessorVersionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ImportProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProcessorVersionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportProcessorVersionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportProcessorVersionMetadata. */ + interface IImportProcessorVersionMetadata { + + /** ImportProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + } + + /** Represents an ImportProcessorVersionMetadata. */ + class ImportProcessorVersionMetadata implements IImportProcessorVersionMetadata { + + /** + * Constructs a new ImportProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata); + + /** ImportProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** + * Creates a new ImportProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata): google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata; + + /** + * Encodes the specified ImportProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata.verify|verify} messages. + * @param message ImportProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata.verify|verify} messages. + * @param message ImportProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.v1beta3.ImportProcessorVersionMetadata; + + /** + * Decodes an ImportProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportProcessorVersionMetadata + * @throws {Error} If the payload is 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.v1beta3.ImportProcessorVersionMetadata; + + /** + * Verifies an ImportProcessorVersionMetadata message. + * @param message Plain 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 ImportProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata; + + /** + * Creates a plain object from an ImportProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message ImportProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateProcessorVersionMetadata. */ + interface IUpdateProcessorVersionMetadata { + + /** UpdateProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + } + + /** Represents an UpdateProcessorVersionMetadata. */ + class UpdateProcessorVersionMetadata implements IUpdateProcessorVersionMetadata { + + /** + * Constructs a new UpdateProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata); + + /** UpdateProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** + * Creates a new UpdateProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata): google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata; + + /** + * Encodes the specified UpdateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.verify|verify} messages. + * @param message UpdateProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.verify|verify} messages. + * @param message UpdateProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.v1beta3.UpdateProcessorVersionMetadata; + + /** + * Decodes an UpdateProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProcessorVersionMetadata + * @throws {Error} If the payload is 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.v1beta3.UpdateProcessorVersionMetadata; + + /** + * Verifies an UpdateProcessorVersionMetadata message. + * @param message Plain 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 UpdateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata; + + /** + * Creates a plain object from an UpdateProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message UpdateProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluationReference. */ + interface IEvaluationReference { + + /** EvaluationReference operation */ + operation?: (string|null); + + /** EvaluationReference evaluation */ + evaluation?: (string|null); + + /** EvaluationReference aggregateMetrics */ + aggregateMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMetrics|null); + + /** EvaluationReference aggregateMetricsExact */ + aggregateMetricsExact?: (google.cloud.documentai.v1beta3.Evaluation.IMetrics|null); + } + + /** Represents an EvaluationReference. */ + class EvaluationReference implements IEvaluationReference { + + /** + * Constructs a new EvaluationReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IEvaluationReference); + + /** EvaluationReference operation. */ + public operation: string; + + /** EvaluationReference evaluation. */ + public evaluation: string; + + /** EvaluationReference aggregateMetrics. */ + public aggregateMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMetrics|null); + + /** EvaluationReference aggregateMetricsExact. */ + public aggregateMetricsExact?: (google.cloud.documentai.v1beta3.Evaluation.IMetrics|null); + + /** + * Creates a new EvaluationReference instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationReference instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IEvaluationReference): google.cloud.documentai.v1beta3.EvaluationReference; + + /** + * Encodes the specified EvaluationReference message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluationReference.verify|verify} messages. + * @param message EvaluationReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IEvaluationReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationReference message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluationReference.verify|verify} messages. + * @param message EvaluationReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEvaluationReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationReference + * @throws {Error} If the payload is not a 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.v1beta3.EvaluationReference; + + /** + * Decodes an EvaluationReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationReference + * @throws {Error} If the payload is 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.v1beta3.EvaluationReference; + + /** + * Verifies an EvaluationReference message. + * @param message Plain 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 EvaluationReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EvaluationReference; + + /** + * Creates a plain object from an EvaluationReference message. Also converts values to other types if specified. + * @param message EvaluationReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.EvaluationReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Evaluation. */ + interface IEvaluation { + + /** Evaluation name */ + name?: (string|null); + + /** Evaluation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation documentCounters */ + documentCounters?: (google.cloud.documentai.v1beta3.Evaluation.ICounters|null); + + /** Evaluation allEntitiesMetrics */ + allEntitiesMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null); + + /** Evaluation entityMetrics */ + entityMetrics?: ({ [k: string]: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics }|null); + + /** Evaluation kmsKeyName */ + kmsKeyName?: (string|null); + + /** Evaluation kmsKeyVersionName */ + kmsKeyVersionName?: (string|null); + + /** Evaluation revisions */ + revisions?: (google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision[]|null); + } + + /** Represents an Evaluation. */ + class Evaluation implements IEvaluation { + + /** + * Constructs a new Evaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IEvaluation); + + /** Evaluation name. */ + public name: string; + + /** Evaluation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Evaluation documentCounters. */ + public documentCounters?: (google.cloud.documentai.v1beta3.Evaluation.ICounters|null); + + /** Evaluation allEntitiesMetrics. */ + public allEntitiesMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null); + + /** Evaluation entityMetrics. */ + public entityMetrics: { [k: string]: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics }; + + /** Evaluation kmsKeyName. */ + public kmsKeyName: string; + + /** Evaluation kmsKeyVersionName. */ + public kmsKeyVersionName: string; + + /** Evaluation revisions. */ + public revisions: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision[]; + + /** + * Creates a new Evaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns Evaluation instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IEvaluation): google.cloud.documentai.v1beta3.Evaluation; + + /** + * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.verify|verify} messages. + * @param message Evaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.verify|verify} messages. + * @param message Evaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Evaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Evaluation + * @throws {Error} If the payload is not a 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.v1beta3.Evaluation; + + /** + * Decodes an Evaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Evaluation + * @throws {Error} If the payload is 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.v1beta3.Evaluation; + + /** + * Verifies an Evaluation message. + * @param message Plain 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 Evaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Evaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation; + + /** + * Creates a plain object from an Evaluation message. Also converts values to other types if specified. + * @param message Evaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Evaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Evaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Evaluation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Evaluation { + + /** Properties of a Counters. */ + interface ICounters { + + /** Counters inputDocumentsCount */ + inputDocumentsCount?: (number|null); + + /** Counters invalidDocumentsCount */ + invalidDocumentsCount?: (number|null); + + /** Counters failedDocumentsCount */ + failedDocumentsCount?: (number|null); + + /** Counters evaluatedDocumentsCount */ + evaluatedDocumentsCount?: (number|null); + } + + /** Represents a Counters. */ + class Counters implements ICounters { + + /** + * Constructs a new Counters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Evaluation.ICounters); + + /** Counters inputDocumentsCount. */ + public inputDocumentsCount: number; + + /** Counters invalidDocumentsCount. */ + public invalidDocumentsCount: number; + + /** Counters failedDocumentsCount. */ + public failedDocumentsCount: number; + + /** Counters evaluatedDocumentsCount. */ + public evaluatedDocumentsCount: number; + + /** + * Creates a new Counters instance using the specified properties. + * @param [properties] Properties to set + * @returns Counters instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Evaluation.ICounters): google.cloud.documentai.v1beta3.Evaluation.Counters; + + /** + * Encodes the specified Counters message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Counters.verify|verify} messages. + * @param message Counters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Evaluation.ICounters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Counters message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Counters.verify|verify} messages. + * @param message Counters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Evaluation.ICounters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Counters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Counters + * @throws {Error} If the payload is not a 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.v1beta3.Evaluation.Counters; + + /** + * Decodes a Counters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Counters + * @throws {Error} If the payload is 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.v1beta3.Evaluation.Counters; + + /** + * Verifies a Counters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Counters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Counters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation.Counters; + + /** + * Creates a plain object from a Counters message. Also converts values to other types if specified. + * @param message Counters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Evaluation.Counters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Counters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Counters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Metrics. */ + interface IMetrics { + + /** Metrics precision */ + precision?: (number|null); + + /** Metrics recall */ + recall?: (number|null); + + /** Metrics f1Score */ + f1Score?: (number|null); + + /** Metrics predictedOccurrencesCount */ + predictedOccurrencesCount?: (number|null); + + /** Metrics groundTruthOccurrencesCount */ + groundTruthOccurrencesCount?: (number|null); + + /** Metrics predictedDocumentCount */ + predictedDocumentCount?: (number|null); + + /** Metrics groundTruthDocumentCount */ + groundTruthDocumentCount?: (number|null); + + /** Metrics truePositivesCount */ + truePositivesCount?: (number|null); + + /** Metrics falsePositivesCount */ + falsePositivesCount?: (number|null); + + /** Metrics falseNegativesCount */ + falseNegativesCount?: (number|null); + + /** Metrics totalDocumentsCount */ + totalDocumentsCount?: (number|null); + } + + /** Represents a Metrics. */ + class Metrics implements IMetrics { + + /** + * Constructs a new Metrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Evaluation.IMetrics); + + /** Metrics precision. */ + public precision: number; + + /** Metrics recall. */ + public recall: number; + + /** Metrics f1Score. */ + public f1Score: number; + + /** Metrics predictedOccurrencesCount. */ + public predictedOccurrencesCount: number; + + /** Metrics groundTruthOccurrencesCount. */ + public groundTruthOccurrencesCount: number; + + /** Metrics predictedDocumentCount. */ + public predictedDocumentCount: number; + + /** Metrics groundTruthDocumentCount. */ + public groundTruthDocumentCount: number; + + /** Metrics truePositivesCount. */ + public truePositivesCount: number; + + /** Metrics falsePositivesCount. */ + public falsePositivesCount: number; + + /** Metrics falseNegativesCount. */ + public falseNegativesCount: number; + + /** Metrics totalDocumentsCount. */ + public totalDocumentsCount: number; + + /** + * Creates a new Metrics instance using the specified properties. + * @param [properties] Properties to set + * @returns Metrics instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Evaluation.IMetrics): google.cloud.documentai.v1beta3.Evaluation.Metrics; + + /** + * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Metrics.verify|verify} messages. + * @param message Metrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Evaluation.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Metrics.verify|verify} messages. + * @param message Metrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Evaluation.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metrics + * @throws {Error} If the payload is not a 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.v1beta3.Evaluation.Metrics; + + /** + * Decodes a Metrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metrics + * @throws {Error} If the payload is 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.v1beta3.Evaluation.Metrics; + + /** + * Verifies a Metrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation.Metrics; + + /** + * Creates a plain object from a Metrics message. Also converts values to other types if specified. + * @param message Metrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Evaluation.Metrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfidenceLevelMetrics. */ + interface IConfidenceLevelMetrics { + + /** ConfidenceLevelMetrics confidenceLevel */ + confidenceLevel?: (number|null); + + /** ConfidenceLevelMetrics metrics */ + metrics?: (google.cloud.documentai.v1beta3.Evaluation.IMetrics|null); + } + + /** Represents a ConfidenceLevelMetrics. */ + class ConfidenceLevelMetrics implements IConfidenceLevelMetrics { + + /** + * Constructs a new ConfidenceLevelMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics); + + /** ConfidenceLevelMetrics confidenceLevel. */ + public confidenceLevel: number; + + /** ConfidenceLevelMetrics metrics. */ + public metrics?: (google.cloud.documentai.v1beta3.Evaluation.IMetrics|null); + + /** + * Creates a new ConfidenceLevelMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidenceLevelMetrics instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics): google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics; + + /** + * Encodes the specified ConfidenceLevelMetrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. + * @param message ConfidenceLevelMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidenceLevelMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. + * @param message ConfidenceLevelMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidenceLevelMetrics + * @throws {Error} If the payload is not a 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.v1beta3.Evaluation.ConfidenceLevelMetrics; + + /** + * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidenceLevelMetrics + * @throws {Error} If the payload is 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.v1beta3.Evaluation.ConfidenceLevelMetrics; + + /** + * Verifies a ConfidenceLevelMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidenceLevelMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidenceLevelMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics; + + /** + * Creates a plain object from a ConfidenceLevelMetrics message. Also converts values to other types if specified. + * @param message ConfidenceLevelMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidenceLevelMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidenceLevelMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MultiConfidenceMetrics. */ + interface IMultiConfidenceMetrics { + + /** MultiConfidenceMetrics confidenceLevelMetrics */ + confidenceLevelMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics[]|null); + + /** MultiConfidenceMetrics confidenceLevelMetricsExact */ + confidenceLevelMetricsExact?: (google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics[]|null); + + /** MultiConfidenceMetrics auprc */ + auprc?: (number|null); + + /** MultiConfidenceMetrics estimatedCalibrationError */ + estimatedCalibrationError?: (number|null); + + /** MultiConfidenceMetrics auprcExact */ + auprcExact?: (number|null); + + /** MultiConfidenceMetrics estimatedCalibrationErrorExact */ + estimatedCalibrationErrorExact?: (number|null); + + /** MultiConfidenceMetrics metricsType */ + metricsType?: (google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType|keyof typeof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType|null); + } + + /** Represents a MultiConfidenceMetrics. */ + class MultiConfidenceMetrics implements IMultiConfidenceMetrics { + + /** + * Constructs a new MultiConfidenceMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics); + + /** MultiConfidenceMetrics confidenceLevelMetrics. */ + public confidenceLevelMetrics: google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics[]; + + /** MultiConfidenceMetrics confidenceLevelMetricsExact. */ + public confidenceLevelMetricsExact: google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics[]; + + /** MultiConfidenceMetrics auprc. */ + public auprc: number; + + /** MultiConfidenceMetrics estimatedCalibrationError. */ + public estimatedCalibrationError: number; + + /** MultiConfidenceMetrics auprcExact. */ + public auprcExact: number; + + /** MultiConfidenceMetrics estimatedCalibrationErrorExact. */ + public estimatedCalibrationErrorExact: number; + + /** MultiConfidenceMetrics metricsType. */ + public metricsType: (google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType|keyof typeof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType); + + /** + * Creates a new MultiConfidenceMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns MultiConfidenceMetrics instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics): google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics; + + /** + * Encodes the specified MultiConfidenceMetrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify|verify} messages. + * @param message MultiConfidenceMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MultiConfidenceMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify|verify} messages. + * @param message MultiConfidenceMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MultiConfidenceMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MultiConfidenceMetrics + * @throws {Error} If the payload is not a 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.v1beta3.Evaluation.MultiConfidenceMetrics; + + /** + * Decodes a MultiConfidenceMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MultiConfidenceMetrics + * @throws {Error} If the payload is 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.v1beta3.Evaluation.MultiConfidenceMetrics; + + /** + * Verifies a MultiConfidenceMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MultiConfidenceMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MultiConfidenceMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics; + + /** + * Creates a plain object from a MultiConfidenceMetrics message. Also converts values to other types if specified. + * @param message MultiConfidenceMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MultiConfidenceMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MultiConfidenceMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MultiConfidenceMetrics { + + /** MetricsType enum. */ + enum MetricsType { + METRICS_TYPE_UNSPECIFIED = 0, + AGGREGATE = 1 + } + } + + /** Properties of an EvaluationRevision. */ + interface IEvaluationRevision { + + /** EvaluationRevision revisionId */ + revisionId?: (string|null); + + /** EvaluationRevision documentCounters */ + documentCounters?: (google.cloud.documentai.v1beta3.Evaluation.ICounters|null); + + /** EvaluationRevision allEntitiesMetrics */ + allEntitiesMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null); + + /** EvaluationRevision entityMetrics */ + entityMetrics?: ({ [k: string]: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics }|null); + } + + /** Represents an EvaluationRevision. */ + class EvaluationRevision implements IEvaluationRevision { + + /** + * Constructs a new EvaluationRevision. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision); + + /** EvaluationRevision revisionId. */ + public revisionId: string; + + /** EvaluationRevision documentCounters. */ + public documentCounters?: (google.cloud.documentai.v1beta3.Evaluation.ICounters|null); + + /** EvaluationRevision allEntitiesMetrics. */ + public allEntitiesMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null); + + /** EvaluationRevision entityMetrics. */ + public entityMetrics: { [k: string]: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics }; + + /** + * Creates a new EvaluationRevision instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationRevision instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision): google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision; + + /** + * Encodes the specified EvaluationRevision message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.verify|verify} messages. + * @param message EvaluationRevision message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.verify|verify} messages. + * @param message EvaluationRevision message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationRevision message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationRevision + * @throws {Error} If the payload is not a 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.v1beta3.Evaluation.EvaluationRevision; + + /** + * Decodes an EvaluationRevision message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationRevision + * @throws {Error} If the payload is 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.v1beta3.Evaluation.EvaluationRevision; + + /** + * Verifies an EvaluationRevision message. + * @param message Plain 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 EvaluationRevision message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationRevision + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision; + + /** + * Creates a plain object from an EvaluationRevision message. Also converts values to other types if specified. + * @param message EvaluationRevision + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationRevision to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationRevision + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CommonOperationMetadata. */ + interface ICommonOperationMetadata { + + /** CommonOperationMetadata state */ + state?: (google.cloud.documentai.v1beta3.CommonOperationMetadata.State|keyof typeof google.cloud.documentai.v1beta3.CommonOperationMetadata.State|null); + + /** CommonOperationMetadata stateMessage */ + stateMessage?: (string|null); + + /** CommonOperationMetadata resource */ + resource?: (string|null); + + /** CommonOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CommonOperationMetadata updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CommonOperationMetadata. */ + class CommonOperationMetadata implements ICommonOperationMetadata { + + /** + * Constructs a new CommonOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ICommonOperationMetadata); + + /** CommonOperationMetadata state. */ + public state: (google.cloud.documentai.v1beta3.CommonOperationMetadata.State|keyof typeof google.cloud.documentai.v1beta3.CommonOperationMetadata.State); + + /** CommonOperationMetadata stateMessage. */ + public stateMessage: string; + + /** CommonOperationMetadata resource. */ + public resource: string; + + /** CommonOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CommonOperationMetadata updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CommonOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonOperationMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ICommonOperationMetadata): google.cloud.documentai.v1beta3.CommonOperationMetadata; + + /** + * Encodes the specified CommonOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.CommonOperationMetadata.verify|verify} messages. + * @param message CommonOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ICommonOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.CommonOperationMetadata.verify|verify} messages. + * @param message CommonOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ICommonOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonOperationMetadata + * @throws {Error} If the payload is not a 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.v1beta3.CommonOperationMetadata; + + /** + * Decodes a CommonOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonOperationMetadata + * @throws {Error} If the payload is 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.v1beta3.CommonOperationMetadata; + + /** + * Verifies a CommonOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.CommonOperationMetadata; + + /** + * Creates a plain object from a CommonOperationMetadata message. Also converts values to other types if specified. + * @param message CommonOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.CommonOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CommonOperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RUNNING = 1, + CANCELLING = 2, + SUCCEEDED = 3, + FAILED = 4, + CANCELLED = 5 + } + } + + /** Properties of a ProcessorVersion. */ + interface IProcessorVersion { + + /** ProcessorVersion name */ + name?: (string|null); + + /** ProcessorVersion displayName */ + displayName?: (string|null); + + /** ProcessorVersion documentSchema */ + documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); + + /** ProcessorVersion state */ + state?: (google.cloud.documentai.v1beta3.ProcessorVersion.State|keyof typeof google.cloud.documentai.v1beta3.ProcessorVersion.State|null); + + /** ProcessorVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ProcessorVersion latestEvaluation */ + latestEvaluation?: (google.cloud.documentai.v1beta3.IEvaluationReference|null); + + /** ProcessorVersion kmsKeyName */ + kmsKeyName?: (string|null); + + /** ProcessorVersion kmsKeyVersionName */ + kmsKeyVersionName?: (string|null); + + /** ProcessorVersion googleManaged */ + googleManaged?: (boolean|null); + + /** ProcessorVersion deprecationInfo */ + deprecationInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo|null); + + /** ProcessorVersion modelType */ + modelType?: (google.cloud.documentai.v1beta3.ProcessorVersion.ModelType|keyof typeof google.cloud.documentai.v1beta3.ProcessorVersion.ModelType|null); + + /** ProcessorVersion satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** ProcessorVersion satisfiesPzi */ + satisfiesPzi?: (boolean|null); + + /** ProcessorVersion genAiModelInfo */ + genAiModelInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo|null); + } + + /** Represents a ProcessorVersion. */ + class ProcessorVersion implements IProcessorVersion { + + /** + * Constructs a new ProcessorVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IProcessorVersion); + + /** ProcessorVersion name. */ + public name: string; + + /** ProcessorVersion displayName. */ + public displayName: string; + + /** ProcessorVersion documentSchema. */ + public documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); + + /** ProcessorVersion state. */ + public state: (google.cloud.documentai.v1beta3.ProcessorVersion.State|keyof typeof google.cloud.documentai.v1beta3.ProcessorVersion.State); + + /** ProcessorVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ProcessorVersion latestEvaluation. */ + public latestEvaluation?: (google.cloud.documentai.v1beta3.IEvaluationReference|null); + + /** ProcessorVersion kmsKeyName. */ + public kmsKeyName: string; + + /** ProcessorVersion kmsKeyVersionName. */ + public kmsKeyVersionName: string; + + /** ProcessorVersion googleManaged. */ + public googleManaged: boolean; + + /** ProcessorVersion deprecationInfo. */ + public deprecationInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo|null); + + /** ProcessorVersion modelType. */ + public modelType: (google.cloud.documentai.v1beta3.ProcessorVersion.ModelType|keyof typeof google.cloud.documentai.v1beta3.ProcessorVersion.ModelType); + + /** ProcessorVersion satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** ProcessorVersion satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** ProcessorVersion genAiModelInfo. */ + public genAiModelInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo|null); + + /** + * Creates a new ProcessorVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessorVersion instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IProcessorVersion): google.cloud.documentai.v1beta3.ProcessorVersion; + + /** + * Encodes the specified ProcessorVersion message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.verify|verify} messages. + * @param message ProcessorVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IProcessorVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessorVersion message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.verify|verify} messages. + * @param message ProcessorVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessorVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessorVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessorVersion + * @throws {Error} If the payload is not a 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.v1beta3.ProcessorVersion; + + /** + * Decodes a ProcessorVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessorVersion + * @throws {Error} If the payload is 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.v1beta3.ProcessorVersion; + + /** + * Verifies a ProcessorVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessorVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessorVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorVersion; + + /** + * Creates a plain object from a ProcessorVersion message. Also converts values to other types if specified. + * @param message ProcessorVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessorVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessorVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessorVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ProcessorVersion { + + /** Properties of a DeprecationInfo. */ + interface IDeprecationInfo { + + /** DeprecationInfo deprecationTime */ + deprecationTime?: (google.protobuf.ITimestamp|null); + + /** DeprecationInfo replacementProcessorVersion */ + replacementProcessorVersion?: (string|null); + } + + /** Represents a DeprecationInfo. */ + class DeprecationInfo implements IDeprecationInfo { + + /** + * Constructs a new DeprecationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo); + + /** DeprecationInfo deprecationTime. */ + public deprecationTime?: (google.protobuf.ITimestamp|null); + + /** DeprecationInfo replacementProcessorVersion. */ + public replacementProcessorVersion: string; + + /** + * Creates a new DeprecationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DeprecationInfo instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo): google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo; + + /** + * Encodes the specified DeprecationInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.verify|verify} messages. + * @param message DeprecationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeprecationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.verify|verify} messages. + * @param message DeprecationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeprecationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeprecationInfo + * @throws {Error} If the payload is not a 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.v1beta3.ProcessorVersion.DeprecationInfo; + + /** + * Decodes a DeprecationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeprecationInfo + * @throws {Error} If the payload is 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.v1beta3.ProcessorVersion.DeprecationInfo; + + /** + * Verifies a DeprecationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeprecationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeprecationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo; + + /** + * Creates a plain object from a DeprecationInfo message. Also converts values to other types if specified. + * @param message DeprecationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeprecationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeprecationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenAiModelInfo. */ + interface IGenAiModelInfo { + + /** GenAiModelInfo foundationGenAiModelInfo */ + foundationGenAiModelInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null); + + /** GenAiModelInfo customGenAiModelInfo */ + customGenAiModelInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null); + } + + /** Represents a GenAiModelInfo. */ + class GenAiModelInfo implements IGenAiModelInfo { + + /** + * Constructs a new GenAiModelInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo); + + /** GenAiModelInfo foundationGenAiModelInfo. */ + public foundationGenAiModelInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null); + + /** GenAiModelInfo customGenAiModelInfo. */ + public customGenAiModelInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null); + + /** GenAiModelInfo modelInfo. */ + public modelInfo?: ("foundationGenAiModelInfo"|"customGenAiModelInfo"); + + /** + * Creates a new GenAiModelInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GenAiModelInfo instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo): google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo; + + /** + * Encodes the specified GenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.verify|verify} messages. + * @param message GenAiModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.verify|verify} messages. + * @param message GenAiModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenAiModelInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenAiModelInfo + * @throws {Error} If the payload is not a 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.v1beta3.ProcessorVersion.GenAiModelInfo; + + /** + * Decodes a GenAiModelInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenAiModelInfo + * @throws {Error} If the payload is 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.v1beta3.ProcessorVersion.GenAiModelInfo; + + /** + * Verifies a GenAiModelInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenAiModelInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenAiModelInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo; + + /** + * Creates a plain object from a GenAiModelInfo message. Also converts values to other types if specified. + * @param message GenAiModelInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenAiModelInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenAiModelInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenAiModelInfo { + + /** Properties of a FoundationGenAiModelInfo. */ + interface IFoundationGenAiModelInfo { + + /** FoundationGenAiModelInfo finetuningAllowed */ + finetuningAllowed?: (boolean|null); + + /** FoundationGenAiModelInfo minTrainLabeledDocuments */ + minTrainLabeledDocuments?: (number|null); + } + + /** Represents a FoundationGenAiModelInfo. */ + class FoundationGenAiModelInfo implements IFoundationGenAiModelInfo { + + /** + * Constructs a new FoundationGenAiModelInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo); + + /** FoundationGenAiModelInfo finetuningAllowed. */ + public finetuningAllowed: boolean; + + /** FoundationGenAiModelInfo minTrainLabeledDocuments. */ + public minTrainLabeledDocuments: number; + + /** + * Creates a new FoundationGenAiModelInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FoundationGenAiModelInfo instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo): google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; + + /** + * Encodes the specified FoundationGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. + * @param message FoundationGenAiModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FoundationGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. + * @param message FoundationGenAiModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FoundationGenAiModelInfo + * @throws {Error} If the payload is not a 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.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; + + /** + * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FoundationGenAiModelInfo + * @throws {Error} If the payload is 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.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; + + /** + * Verifies a FoundationGenAiModelInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FoundationGenAiModelInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FoundationGenAiModelInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; + + /** + * Creates a plain object from a FoundationGenAiModelInfo message. Also converts values to other types if specified. + * @param message FoundationGenAiModelInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FoundationGenAiModelInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FoundationGenAiModelInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomGenAiModelInfo. */ + interface ICustomGenAiModelInfo { + + /** CustomGenAiModelInfo customModelType */ + customModelType?: (google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|keyof typeof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|null); + + /** CustomGenAiModelInfo baseProcessorVersionId */ + baseProcessorVersionId?: (string|null); + } + + /** Represents a CustomGenAiModelInfo. */ + class CustomGenAiModelInfo implements ICustomGenAiModelInfo { + + /** + * Constructs a new CustomGenAiModelInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo); + + /** CustomGenAiModelInfo customModelType. */ + public customModelType: (google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|keyof typeof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType); + + /** CustomGenAiModelInfo baseProcessorVersionId. */ + public baseProcessorVersionId: string; + + /** + * Creates a new CustomGenAiModelInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomGenAiModelInfo instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo): google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; + + /** + * Encodes the specified CustomGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. + * @param message CustomGenAiModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. + * @param message CustomGenAiModelInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomGenAiModelInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomGenAiModelInfo + * @throws {Error} If the payload is not a 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.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; + + /** + * Decodes a CustomGenAiModelInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomGenAiModelInfo + * @throws {Error} If the payload is 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.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; + + /** + * Verifies a CustomGenAiModelInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomGenAiModelInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomGenAiModelInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; + + /** + * Creates a plain object from a CustomGenAiModelInfo message. Also converts values to other types if specified. + * @param message CustomGenAiModelInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomGenAiModelInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomGenAiModelInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomGenAiModelInfo { + + /** CustomModelType enum. */ + enum CustomModelType { + CUSTOM_MODEL_TYPE_UNSPECIFIED = 0, + VERSIONED_FOUNDATION = 1, + FINE_TUNED = 2 + } + } + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + DEPLOYED = 1, + DEPLOYING = 2, + UNDEPLOYED = 3, + UNDEPLOYING = 4, + CREATING = 5, + DELETING = 6, + FAILED = 7, + IMPORTING = 8 + } + + /** ModelType enum. */ + enum ModelType { + MODEL_TYPE_UNSPECIFIED = 0, + MODEL_TYPE_GENERATIVE = 1, + MODEL_TYPE_CUSTOM = 2 + } + } + + /** Properties of a ProcessorVersionAlias. */ + interface IProcessorVersionAlias { + + /** ProcessorVersionAlias alias */ + alias?: (string|null); + + /** ProcessorVersionAlias processorVersion */ + processorVersion?: (string|null); + } + + /** Represents a ProcessorVersionAlias. */ + class ProcessorVersionAlias implements IProcessorVersionAlias { + + /** + * Constructs a new ProcessorVersionAlias. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IProcessorVersionAlias); + + /** ProcessorVersionAlias alias. */ + public alias: string; + + /** ProcessorVersionAlias processorVersion. */ + public processorVersion: string; + + /** + * Creates a new ProcessorVersionAlias instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessorVersionAlias instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IProcessorVersionAlias): google.cloud.documentai.v1beta3.ProcessorVersionAlias; + + /** + * Encodes the specified ProcessorVersionAlias message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersionAlias.verify|verify} messages. + * @param message ProcessorVersionAlias message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IProcessorVersionAlias, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessorVersionAlias message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersionAlias.verify|verify} messages. + * @param message ProcessorVersionAlias message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessorVersionAlias, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessorVersionAlias message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessorVersionAlias + * @throws {Error} If the payload is not a 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.v1beta3.ProcessorVersionAlias; + + /** + * Decodes a ProcessorVersionAlias message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessorVersionAlias + * @throws {Error} If the payload is 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.v1beta3.ProcessorVersionAlias; + + /** + * Verifies a ProcessorVersionAlias message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessorVersionAlias message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessorVersionAlias + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorVersionAlias; + + /** + * Creates a plain object from a ProcessorVersionAlias message. Also converts values to other types if specified. + * @param message ProcessorVersionAlias + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessorVersionAlias, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessorVersionAlias to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessorVersionAlias + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Processor. */ + interface IProcessor { + + /** Processor name */ + name?: (string|null); + + /** Processor type */ + type?: (string|null); + + /** Processor displayName */ + displayName?: (string|null); + + /** Processor state */ + state?: (google.cloud.documentai.v1beta3.Processor.State|keyof typeof google.cloud.documentai.v1beta3.Processor.State|null); + + /** Processor defaultProcessorVersion */ + defaultProcessorVersion?: (string|null); + + /** Processor processorVersionAliases */ + processorVersionAliases?: (google.cloud.documentai.v1beta3.IProcessorVersionAlias[]|null); + + /** Processor processEndpoint */ + processEndpoint?: (string|null); + + /** Processor createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Processor kmsKeyName */ + kmsKeyName?: (string|null); + + /** Processor satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Processor satisfiesPzi */ + satisfiesPzi?: (boolean|null); + } + + /** Represents a Processor. */ + class Processor implements IProcessor { + + /** + * Constructs a new Processor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IProcessor); + + /** Processor name. */ + public name: string; + + /** Processor type. */ + public type: string; + + /** Processor displayName. */ + public displayName: string; + + /** Processor state. */ + public state: (google.cloud.documentai.v1beta3.Processor.State|keyof typeof google.cloud.documentai.v1beta3.Processor.State); + + /** Processor defaultProcessorVersion. */ + public defaultProcessorVersion: string; + + /** Processor processorVersionAliases. */ + public processorVersionAliases: google.cloud.documentai.v1beta3.IProcessorVersionAlias[]; + + /** Processor processEndpoint. */ + public processEndpoint: string; + + /** Processor createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Processor kmsKeyName. */ + public kmsKeyName: string; + + /** Processor satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Processor satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** + * Creates a new Processor instance using the specified properties. + * @param [properties] Properties to set + * @returns Processor instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IProcessor): google.cloud.documentai.v1beta3.Processor; + + /** + * Encodes the specified Processor message. Does not implicitly {@link google.cloud.documentai.v1beta3.Processor.verify|verify} messages. + * @param message Processor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IProcessor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Processor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Processor.verify|verify} messages. + * @param message Processor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Processor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Processor + * @throws {Error} If the payload is not a 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.v1beta3.Processor; + + /** + * Decodes a Processor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Processor + * @throws {Error} If the payload is 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.v1beta3.Processor; + + /** + * Verifies a Processor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Processor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Processor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Processor; + + /** + * Creates a plain object from a Processor message. Also converts values to other types if specified. + * @param message Processor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Processor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Processor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Processor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Processor { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2, + ENABLING = 3, + DISABLING = 4, + CREATING = 5, + FAILED = 6, + DELETING = 7 + } + } + + /** Properties of a ProcessorType. */ + interface IProcessorType { + + /** ProcessorType name */ + name?: (string|null); + + /** ProcessorType type */ + type?: (string|null); + + /** ProcessorType category */ + category?: (string|null); + + /** ProcessorType availableLocations */ + availableLocations?: (google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo[]|null); + + /** ProcessorType allowCreation */ + allowCreation?: (boolean|null); + + /** ProcessorType launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ProcessorType sampleDocumentUris */ + sampleDocumentUris?: (string[]|null); + } + + /** Represents a ProcessorType. */ + class ProcessorType implements IProcessorType { + + /** + * Constructs a new ProcessorType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IProcessorType); + + /** ProcessorType name. */ + public name: string; + + /** ProcessorType type. */ + public type: string; + + /** ProcessorType category. */ + public category: string; + + /** ProcessorType availableLocations. */ + public availableLocations: google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo[]; + + /** ProcessorType allowCreation. */ + public allowCreation: boolean; + + /** ProcessorType launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ProcessorType sampleDocumentUris. */ + public sampleDocumentUris: string[]; + + /** + * Creates a new ProcessorType instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessorType instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IProcessorType): google.cloud.documentai.v1beta3.ProcessorType; + + /** + * Encodes the specified ProcessorType message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.verify|verify} messages. + * @param message ProcessorType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IProcessorType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProcessorType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.verify|verify} messages. + * @param message ProcessorType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessorType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProcessorType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessorType + * @throws {Error} If the payload is not a 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.v1beta3.ProcessorType; + + /** + * Decodes a ProcessorType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessorType + * @throws {Error} If the payload is 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.v1beta3.ProcessorType; + + /** + * Verifies a ProcessorType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProcessorType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessorType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorType; + + /** + * Creates a plain object from a ProcessorType message. Also converts values to other types if specified. + * @param message ProcessorType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessorType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProcessorType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessorType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ProcessorType { + + /** Properties of a LocationInfo. */ + interface ILocationInfo { + + /** LocationInfo locationId */ + locationId?: (string|null); + } + + /** Represents a LocationInfo. */ + class LocationInfo implements ILocationInfo { + + /** + * Constructs a new LocationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo); + + /** LocationInfo locationId. */ + public locationId: string; + + /** + * Creates a new LocationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationInfo instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo): google.cloud.documentai.v1beta3.ProcessorType.LocationInfo; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.verify|verify} messages. + * @param message LocationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationInfo + * @throws {Error} If the payload is not a 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.v1beta3.ProcessorType.LocationInfo; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationInfo + * @throws {Error} If the payload is 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.v1beta3.ProcessorType.LocationInfo; + + /** + * Verifies a LocationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorType.LocationInfo; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @param message LocationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ProcessorType.LocationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationInfo + * @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 UpdateDataset. + * @param request UpdateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDataset(request: google.cloud.documentai.v1beta3.IUpdateDatasetRequest, callback: google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetCallback): void; + + /** + * Calls UpdateDataset. + * @param request UpdateDatasetRequest message or plain object + * @returns Promise + */ + public updateDataset(request: google.cloud.documentai.v1beta3.IUpdateDatasetRequest): Promise; + + /** + * Calls ImportDocuments. + * @param request ImportDocumentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importDocuments(request: google.cloud.documentai.v1beta3.IImportDocumentsRequest, callback: google.cloud.documentai.v1beta3.DocumentService.ImportDocumentsCallback): void; + + /** + * Calls ImportDocuments. + * @param request ImportDocumentsRequest message or plain object + * @returns Promise + */ + public importDocuments(request: google.cloud.documentai.v1beta3.IImportDocumentsRequest): Promise; + + /** + * Calls GetDocument. + * @param request GetDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetDocumentResponse + */ + public getDocument(request: google.cloud.documentai.v1beta3.IGetDocumentRequest, callback: google.cloud.documentai.v1beta3.DocumentService.GetDocumentCallback): void; + + /** + * Calls GetDocument. + * @param request GetDocumentRequest message or plain object + * @returns Promise + */ + public getDocument(request: google.cloud.documentai.v1beta3.IGetDocumentRequest): Promise; + + /** + * Calls ListDocuments. + * @param request ListDocumentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDocumentsResponse + */ + public listDocuments(request: google.cloud.documentai.v1beta3.IListDocumentsRequest, callback: google.cloud.documentai.v1beta3.DocumentService.ListDocumentsCallback): void; + + /** + * Calls ListDocuments. + * @param request ListDocumentsRequest message or plain object + * @returns Promise + */ + public listDocuments(request: google.cloud.documentai.v1beta3.IListDocumentsRequest): Promise; + + /** + * Calls BatchDeleteDocuments. + * @param request BatchDeleteDocumentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchDeleteDocuments(request: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, callback: google.cloud.documentai.v1beta3.DocumentService.BatchDeleteDocumentsCallback): void; + + /** + * Calls BatchDeleteDocuments. + * @param request BatchDeleteDocumentsRequest message or plain object + * @returns Promise + */ + public batchDeleteDocuments(request: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest): Promise; + + /** + * Calls GetDatasetSchema. + * @param request GetDatasetSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DatasetSchema + */ + public getDatasetSchema(request: google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, callback: google.cloud.documentai.v1beta3.DocumentService.GetDatasetSchemaCallback): void; + + /** + * Calls GetDatasetSchema. + * @param request GetDatasetSchemaRequest message or plain object + * @returns Promise + */ + public getDatasetSchema(request: google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest): Promise; + + /** + * Calls UpdateDatasetSchema. + * @param request UpdateDatasetSchemaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DatasetSchema + */ + public updateDatasetSchema(request: google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, callback: google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetSchemaCallback): void; + + /** + * Calls UpdateDatasetSchema. + * @param request UpdateDatasetSchemaRequest message or plain object + * @returns Promise + */ + public updateDatasetSchema(request: google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest): Promise; + } + + namespace DocumentService { + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|updateDataset}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|importDocuments}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|getDocument}. + * @param error Error, if any + * @param [response] GetDocumentResponse + */ + type GetDocumentCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.GetDocumentResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|listDocuments}. + * @param error Error, if any + * @param [response] ListDocumentsResponse + */ + type ListDocumentsCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ListDocumentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|batchDeleteDocuments}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchDeleteDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|getDatasetSchema}. + * @param error Error, if any + * @param [response] DatasetSchema + */ + type GetDatasetSchemaCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.DatasetSchema) => void; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|updateDatasetSchema}. + * @param error Error, if any + * @param [response] DatasetSchema + */ + type UpdateDatasetSchemaCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.DatasetSchema) => void; + } + + /** DatasetSplitType enum. */ + enum DatasetSplitType { + DATASET_SPLIT_TYPE_UNSPECIFIED = 0, + DATASET_SPLIT_TRAIN = 1, + DATASET_SPLIT_TEST = 2, + DATASET_SPLIT_UNASSIGNED = 3 + } + + /** DocumentLabelingState enum. */ + enum DocumentLabelingState { + DOCUMENT_LABELING_STATE_UNSPECIFIED = 0, + DOCUMENT_LABELED = 1, + DOCUMENT_UNLABELED = 2, + DOCUMENT_AUTO_LABELED = 3 + } + + /** Properties of an UpdateDatasetRequest. */ + interface IUpdateDatasetRequest { + + /** UpdateDatasetRequest dataset */ + dataset?: (google.cloud.documentai.v1beta3.IDataset|null); + + /** UpdateDatasetRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDatasetRequest. */ + class UpdateDatasetRequest implements IUpdateDatasetRequest { + + /** + * Constructs a new UpdateDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IUpdateDatasetRequest); + + /** UpdateDatasetRequest dataset. */ + public dataset?: (google.cloud.documentai.v1beta3.IDataset|null); + + /** UpdateDatasetRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatasetRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IUpdateDatasetRequest): google.cloud.documentai.v1beta3.UpdateDatasetRequest; + + /** + * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetRequest.verify|verify} messages. + * @param message UpdateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetRequest.verify|verify} messages. + * @param message UpdateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatasetRequest + * @throws {Error} If the payload is not a 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.v1beta3.UpdateDatasetRequest; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatasetRequest + * @throws {Error} If the payload is 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.v1beta3.UpdateDatasetRequest; + + /** + * Verifies an UpdateDatasetRequest message. + * @param message Plain 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 UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UpdateDatasetRequest; + + /** + * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. + * @param message UpdateDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.UpdateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatasetOperationMetadata. */ + interface IUpdateDatasetOperationMetadata { + + /** UpdateDatasetOperationMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + } + + /** Represents an UpdateDatasetOperationMetadata. */ + class UpdateDatasetOperationMetadata implements IUpdateDatasetOperationMetadata { + + /** + * Constructs a new UpdateDatasetOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata); + + /** UpdateDatasetOperationMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** + * Creates a new UpdateDatasetOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatasetOperationMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata): google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata; + + /** + * Encodes the specified UpdateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata.verify|verify} messages. + * @param message UpdateDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata.verify|verify} messages. + * @param message UpdateDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatasetOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatasetOperationMetadata + * @throws {Error} If the payload is not a 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.v1beta3.UpdateDatasetOperationMetadata; + + /** + * Decodes an UpdateDatasetOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatasetOperationMetadata + * @throws {Error} If the payload is 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.v1beta3.UpdateDatasetOperationMetadata; + + /** + * Verifies an UpdateDatasetOperationMetadata message. + * @param message Plain 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 UpdateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatasetOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata; + + /** + * Creates a plain object from an UpdateDatasetOperationMetadata message. Also converts values to other types if specified. + * @param message UpdateDatasetOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatasetOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatasetOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDocumentsRequest. */ + interface IImportDocumentsRequest { + + /** ImportDocumentsRequest dataset */ + dataset?: (string|null); + + /** ImportDocumentsRequest batchDocumentsImportConfigs */ + batchDocumentsImportConfigs?: (google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig[]|null); + } + + /** Represents an ImportDocumentsRequest. */ + class ImportDocumentsRequest implements IImportDocumentsRequest { + + /** + * Constructs a new ImportDocumentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IImportDocumentsRequest); + + /** ImportDocumentsRequest dataset. */ + public dataset: string; + + /** ImportDocumentsRequest batchDocumentsImportConfigs. */ + public batchDocumentsImportConfigs: google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig[]; + + /** + * Creates a new ImportDocumentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDocumentsRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IImportDocumentsRequest): google.cloud.documentai.v1beta3.ImportDocumentsRequest; + + /** + * Encodes the specified ImportDocumentsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.verify|verify} messages. + * @param message ImportDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IImportDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.verify|verify} messages. + * @param message ImportDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDocumentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDocumentsRequest + * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsRequest; + + /** + * Decodes an ImportDocumentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDocumentsRequest + * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsRequest; + + /** + * Verifies an ImportDocumentsRequest message. + * @param message Plain 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 ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDocumentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsRequest; + + /** + * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. + * @param message ImportDocumentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDocumentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDocumentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportDocumentsRequest { + + /** Properties of a BatchDocumentsImportConfig. */ + interface IBatchDocumentsImportConfig { + + /** BatchDocumentsImportConfig datasetSplit */ + datasetSplit?: (google.cloud.documentai.v1beta3.DatasetSplitType|keyof typeof google.cloud.documentai.v1beta3.DatasetSplitType|null); + + /** BatchDocumentsImportConfig autoSplitConfig */ + autoSplitConfig?: (google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig|null); + + /** BatchDocumentsImportConfig batchInputConfig */ + batchInputConfig?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); + + /** BatchDocumentsImportConfig documentType */ + documentType?: (string|null); + } + + /** Represents a BatchDocumentsImportConfig. */ + class BatchDocumentsImportConfig implements IBatchDocumentsImportConfig { + + /** + * Constructs a new BatchDocumentsImportConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig); + + /** BatchDocumentsImportConfig datasetSplit. */ + public datasetSplit?: (google.cloud.documentai.v1beta3.DatasetSplitType|keyof typeof google.cloud.documentai.v1beta3.DatasetSplitType|null); + + /** BatchDocumentsImportConfig autoSplitConfig. */ + public autoSplitConfig?: (google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig|null); + + /** BatchDocumentsImportConfig batchInputConfig. */ + public batchInputConfig?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); + + /** BatchDocumentsImportConfig documentType. */ + public documentType: string; + + /** BatchDocumentsImportConfig splitTypeConfig. */ + public splitTypeConfig?: ("datasetSplit"|"autoSplitConfig"); + + /** + * Creates a new BatchDocumentsImportConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDocumentsImportConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig): google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig; + + /** + * Encodes the specified BatchDocumentsImportConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.verify|verify} messages. + * @param message BatchDocumentsImportConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDocumentsImportConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.verify|verify} messages. + * @param message BatchDocumentsImportConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDocumentsImportConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDocumentsImportConfig + * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig; + + /** + * Decodes a BatchDocumentsImportConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDocumentsImportConfig + * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig; + + /** + * Verifies a BatchDocumentsImportConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDocumentsImportConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDocumentsImportConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig; + + /** + * Creates a plain object from a BatchDocumentsImportConfig message. Also converts values to other types if specified. + * @param message BatchDocumentsImportConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDocumentsImportConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDocumentsImportConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchDocumentsImportConfig { + + /** Properties of an AutoSplitConfig. */ + interface IAutoSplitConfig { + + /** AutoSplitConfig trainingSplitRatio */ + trainingSplitRatio?: (number|null); + } + + /** Represents an AutoSplitConfig. */ + class AutoSplitConfig implements IAutoSplitConfig { + + /** + * Constructs a new AutoSplitConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig); + + /** AutoSplitConfig trainingSplitRatio. */ + public trainingSplitRatio: number; + + /** + * Creates a new AutoSplitConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoSplitConfig instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig): google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig; + + /** + * Encodes the specified AutoSplitConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.verify|verify} messages. + * @param message AutoSplitConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoSplitConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.verify|verify} messages. + * @param message AutoSplitConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoSplitConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoSplitConfig + * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig; + + /** + * Decodes an AutoSplitConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoSplitConfig + * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig; + + /** + * Verifies an AutoSplitConfig message. + * @param message Plain 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 AutoSplitConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoSplitConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig; + + /** + * Creates a plain object from an AutoSplitConfig message. Also converts values to other types if specified. + * @param message AutoSplitConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoSplitConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoSplitConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an ImportDocumentsResponse. */ + interface IImportDocumentsResponse { + } + + /** Represents an ImportDocumentsResponse. */ + class ImportDocumentsResponse implements IImportDocumentsResponse { + + /** + * Constructs a new ImportDocumentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IImportDocumentsResponse); + + /** + * Creates a new ImportDocumentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDocumentsResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IImportDocumentsResponse): google.cloud.documentai.v1beta3.ImportDocumentsResponse; + + /** + * Encodes the specified ImportDocumentsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsResponse.verify|verify} messages. + * @param message ImportDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IImportDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsResponse.verify|verify} messages. + * @param message ImportDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDocumentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDocumentsResponse + * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsResponse; + + /** + * Decodes an ImportDocumentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDocumentsResponse + * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsResponse; + + /** + * Verifies an ImportDocumentsResponse message. + * @param message Plain 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 ImportDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDocumentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsResponse; + + /** + * Creates a plain object from an ImportDocumentsResponse message. Also converts values to other types if specified. + * @param message ImportDocumentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDocumentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDocumentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDocumentsMetadata. */ + interface IImportDocumentsMetadata { + + /** ImportDocumentsMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** ImportDocumentsMetadata individualImportStatuses */ + individualImportStatuses?: (google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus[]|null); + + /** ImportDocumentsMetadata importConfigValidationResults */ + importConfigValidationResults?: (google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult[]|null); + + /** ImportDocumentsMetadata totalDocumentCount */ + totalDocumentCount?: (number|null); + } + + /** Represents an ImportDocumentsMetadata. */ + class ImportDocumentsMetadata implements IImportDocumentsMetadata { + + /** + * Constructs a new ImportDocumentsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IImportDocumentsMetadata); + + /** ImportDocumentsMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** ImportDocumentsMetadata individualImportStatuses. */ + public individualImportStatuses: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus[]; + + /** ImportDocumentsMetadata importConfigValidationResults. */ + public importConfigValidationResults: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult[]; + + /** ImportDocumentsMetadata totalDocumentCount. */ + public totalDocumentCount: number; + + /** + * Creates a new ImportDocumentsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDocumentsMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IImportDocumentsMetadata): google.cloud.documentai.v1beta3.ImportDocumentsMetadata; + + /** + * Encodes the specified ImportDocumentsMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.verify|verify} messages. + * @param message ImportDocumentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IImportDocumentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.verify|verify} messages. + * @param message ImportDocumentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportDocumentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDocumentsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDocumentsMetadata + * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsMetadata; + + /** + * Decodes an ImportDocumentsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDocumentsMetadata + * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsMetadata; + + /** + * Verifies an ImportDocumentsMetadata message. + * @param message Plain 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 ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDocumentsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsMetadata; + + /** + * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. + * @param message ImportDocumentsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDocumentsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDocumentsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ImportDocumentsMetadata { + + /** Properties of an IndividualImportStatus. */ + interface IIndividualImportStatus { + + /** IndividualImportStatus inputGcsSource */ + inputGcsSource?: (string|null); + + /** IndividualImportStatus status */ + status?: (google.rpc.IStatus|null); + + /** IndividualImportStatus outputDocumentId */ + outputDocumentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); + } + + /** Represents an IndividualImportStatus. */ + class IndividualImportStatus implements IIndividualImportStatus { + + /** + * Constructs a new IndividualImportStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus); + + /** IndividualImportStatus inputGcsSource. */ + public inputGcsSource: string; + + /** IndividualImportStatus status. */ + public status?: (google.rpc.IStatus|null); + + /** IndividualImportStatus outputDocumentId. */ + public outputDocumentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); + + /** + * Creates a new IndividualImportStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns IndividualImportStatus instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus): google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus; + + /** + * Encodes the specified IndividualImportStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.verify|verify} messages. + * @param message IndividualImportStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndividualImportStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.verify|verify} messages. + * @param message IndividualImportStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndividualImportStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndividualImportStatus + * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsMetadata.IndividualImportStatus; + + /** + * Decodes an IndividualImportStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndividualImportStatus + * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsMetadata.IndividualImportStatus; + + /** + * Verifies an IndividualImportStatus message. + * @param message Plain 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 IndividualImportStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndividualImportStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus; + + /** + * Creates a plain object from an IndividualImportStatus message. Also converts values to other types if specified. + * @param message IndividualImportStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndividualImportStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndividualImportStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportConfigValidationResult. */ + interface IImportConfigValidationResult { + + /** ImportConfigValidationResult inputGcsSource */ + inputGcsSource?: (string|null); + + /** ImportConfigValidationResult status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents an ImportConfigValidationResult. */ + class ImportConfigValidationResult implements IImportConfigValidationResult { + + /** + * Constructs a new ImportConfigValidationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult); + + /** ImportConfigValidationResult inputGcsSource. */ + public inputGcsSource: string; + + /** ImportConfigValidationResult status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new ImportConfigValidationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportConfigValidationResult instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult): google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult; + + /** + * Encodes the specified ImportConfigValidationResult message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.verify|verify} messages. + * @param message ImportConfigValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportConfigValidationResult message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.verify|verify} messages. + * @param message ImportConfigValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportConfigValidationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportConfigValidationResult + * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult; + + /** + * Decodes an ImportConfigValidationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportConfigValidationResult + * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult; + + /** + * Verifies an ImportConfigValidationResult message. + * @param message Plain 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 ImportConfigValidationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportConfigValidationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult; + + /** + * Creates a plain object from an ImportConfigValidationResult message. Also converts values to other types if specified. + * @param message ImportConfigValidationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportConfigValidationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportConfigValidationResult + * @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 dataset */ + dataset?: (string|null); + + /** GetDocumentRequest documentId */ + documentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); + + /** GetDocumentRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + + /** GetDocumentRequest pageRange */ + pageRange?: (google.cloud.documentai.v1beta3.IDocumentPageRange|null); + } + + /** Represents a GetDocumentRequest. */ + class GetDocumentRequest implements IGetDocumentRequest { + + /** + * Constructs a new GetDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGetDocumentRequest); + + /** GetDocumentRequest dataset. */ + public dataset: string; + + /** GetDocumentRequest documentId. */ + public documentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); + + /** GetDocumentRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** GetDocumentRequest pageRange. */ + public pageRange?: (google.cloud.documentai.v1beta3.IDocumentPageRange|null); + + /** + * Creates a new GetDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDocumentRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IGetDocumentRequest): google.cloud.documentai.v1beta3.GetDocumentRequest; + + /** + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.documentai.v1beta3.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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 a GetDocumentResponse. */ + interface IGetDocumentResponse { + + /** GetDocumentResponse document */ + document?: (google.cloud.documentai.v1beta3.IDocument|null); + } + + /** Represents a GetDocumentResponse. */ + class GetDocumentResponse implements IGetDocumentResponse { + + /** + * Constructs a new GetDocumentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGetDocumentResponse); + + /** GetDocumentResponse document. */ + public document?: (google.cloud.documentai.v1beta3.IDocument|null); + + /** + * Creates a new GetDocumentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDocumentResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IGetDocumentResponse): google.cloud.documentai.v1beta3.GetDocumentResponse; + + /** + * Encodes the specified GetDocumentResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDocumentResponse.verify|verify} messages. + * @param message GetDocumentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IGetDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDocumentResponse.verify|verify} messages. + * @param message GetDocumentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGetDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDocumentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDocumentResponse + * @throws {Error} If the payload is not a 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.v1beta3.GetDocumentResponse; + + /** + * Decodes a GetDocumentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDocumentResponse + * @throws {Error} If the payload is 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.v1beta3.GetDocumentResponse; + + /** + * Verifies a GetDocumentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDocumentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDocumentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GetDocumentResponse; + + /** + * Creates a plain object from a GetDocumentResponse message. Also converts values to other types if specified. + * @param message GetDocumentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.GetDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDocumentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDocumentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDocumentsRequest. */ + interface IListDocumentsRequest { + + /** ListDocumentsRequest dataset */ + dataset?: (string|null); + + /** ListDocumentsRequest pageSize */ + pageSize?: (number|null); + + /** ListDocumentsRequest pageToken */ + pageToken?: (string|null); + + /** ListDocumentsRequest filter */ + filter?: (string|null); + + /** ListDocumentsRequest returnTotalSize */ + returnTotalSize?: (boolean|null); + + /** ListDocumentsRequest skip */ + skip?: (number|null); + } + + /** Represents a ListDocumentsRequest. */ + class ListDocumentsRequest implements IListDocumentsRequest { + + /** + * Constructs a new ListDocumentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IListDocumentsRequest); + + /** ListDocumentsRequest dataset. */ + public dataset: string; + + /** ListDocumentsRequest pageSize. */ + public pageSize: number; + + /** ListDocumentsRequest pageToken. */ + public pageToken: string; + + /** ListDocumentsRequest filter. */ + public filter: string; + + /** ListDocumentsRequest returnTotalSize. */ + public returnTotalSize: boolean; + + /** ListDocumentsRequest skip. */ + public skip: number; + + /** + * Creates a new ListDocumentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDocumentsRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IListDocumentsRequest): google.cloud.documentai.v1beta3.ListDocumentsRequest; + + /** + * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsRequest.verify|verify} messages. + * @param message ListDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsRequest.verify|verify} messages. + * @param message ListDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDocumentsRequest + * @throws {Error} If the payload is not a 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.v1beta3.ListDocumentsRequest; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDocumentsRequest + * @throws {Error} If the payload is 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.v1beta3.ListDocumentsRequest; + + /** + * Verifies a ListDocumentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDocumentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListDocumentsRequest; + + /** + * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. + * @param message ListDocumentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ListDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDocumentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDocumentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDocumentsResponse. */ + interface IListDocumentsResponse { + + /** ListDocumentsResponse documentMetadata */ + documentMetadata?: (google.cloud.documentai.v1beta3.IDocumentMetadata[]|null); + + /** ListDocumentsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListDocumentsResponse totalSize */ + totalSize?: (number|null); + } + + /** Represents a ListDocumentsResponse. */ + class ListDocumentsResponse implements IListDocumentsResponse { + + /** + * Constructs a new ListDocumentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IListDocumentsResponse); + + /** ListDocumentsResponse documentMetadata. */ + public documentMetadata: google.cloud.documentai.v1beta3.IDocumentMetadata[]; + + /** ListDocumentsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListDocumentsResponse totalSize. */ + public totalSize: number; + + /** + * Creates a new ListDocumentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDocumentsResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IListDocumentsResponse): google.cloud.documentai.v1beta3.ListDocumentsResponse; + + /** + * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsResponse.verify|verify} messages. + * @param message ListDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsResponse.verify|verify} messages. + * @param message ListDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDocumentsResponse + * @throws {Error} If the payload is not a 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.v1beta3.ListDocumentsResponse; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDocumentsResponse + * @throws {Error} If the payload is 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.v1beta3.ListDocumentsResponse; + + /** + * Verifies a ListDocumentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDocumentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListDocumentsResponse; + + /** + * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. + * @param message ListDocumentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.ListDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDocumentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDocumentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteDocumentsRequest. */ + interface IBatchDeleteDocumentsRequest { + + /** BatchDeleteDocumentsRequest dataset */ + dataset?: (string|null); + + /** BatchDeleteDocumentsRequest datasetDocuments */ + datasetDocuments?: (google.cloud.documentai.v1beta3.IBatchDatasetDocuments|null); + } + + /** Represents a BatchDeleteDocumentsRequest. */ + class BatchDeleteDocumentsRequest implements IBatchDeleteDocumentsRequest { + + /** + * Constructs a new BatchDeleteDocumentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest); + + /** BatchDeleteDocumentsRequest dataset. */ + public dataset: string; + + /** BatchDeleteDocumentsRequest datasetDocuments. */ + public datasetDocuments?: (google.cloud.documentai.v1beta3.IBatchDatasetDocuments|null); + + /** + * Creates a new BatchDeleteDocumentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteDocumentsRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest): google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest; + + /** + * Encodes the specified BatchDeleteDocumentsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest.verify|verify} messages. + * @param message BatchDeleteDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest.verify|verify} messages. + * @param message BatchDeleteDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteDocumentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteDocumentsRequest + * @throws {Error} If the payload is not a 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.v1beta3.BatchDeleteDocumentsRequest; + + /** + * Decodes a BatchDeleteDocumentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteDocumentsRequest + * @throws {Error} If the payload is 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.v1beta3.BatchDeleteDocumentsRequest; + + /** + * Verifies a BatchDeleteDocumentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteDocumentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest; + + /** + * Creates a plain object from a BatchDeleteDocumentsRequest message. Also converts values to other types if specified. + * @param message BatchDeleteDocumentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteDocumentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteDocumentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteDocumentsResponse. */ + interface IBatchDeleteDocumentsResponse { + } + + /** Represents a BatchDeleteDocumentsResponse. */ + class BatchDeleteDocumentsResponse implements IBatchDeleteDocumentsResponse { + + /** + * Constructs a new BatchDeleteDocumentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse); + + /** + * Creates a new BatchDeleteDocumentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteDocumentsResponse instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse): google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse; + + /** + * Encodes the specified BatchDeleteDocumentsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse.verify|verify} messages. + * @param message BatchDeleteDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse.verify|verify} messages. + * @param message BatchDeleteDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteDocumentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteDocumentsResponse + * @throws {Error} If the payload is not a 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.v1beta3.BatchDeleteDocumentsResponse; + + /** + * Decodes a BatchDeleteDocumentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteDocumentsResponse + * @throws {Error} If the payload is 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.v1beta3.BatchDeleteDocumentsResponse; + + /** + * Verifies a BatchDeleteDocumentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteDocumentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse; + + /** + * Creates a plain object from a BatchDeleteDocumentsResponse message. Also converts values to other types if specified. + * @param message BatchDeleteDocumentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteDocumentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteDocumentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteDocumentsMetadata. */ + interface IBatchDeleteDocumentsMetadata { + + /** BatchDeleteDocumentsMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** BatchDeleteDocumentsMetadata individualBatchDeleteStatuses */ + individualBatchDeleteStatuses?: (google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus[]|null); + + /** BatchDeleteDocumentsMetadata totalDocumentCount */ + totalDocumentCount?: (number|null); + + /** BatchDeleteDocumentsMetadata errorDocumentCount */ + errorDocumentCount?: (number|null); + } + + /** Represents a BatchDeleteDocumentsMetadata. */ + class BatchDeleteDocumentsMetadata implements IBatchDeleteDocumentsMetadata { + + /** + * Constructs a new BatchDeleteDocumentsMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata); + + /** BatchDeleteDocumentsMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** BatchDeleteDocumentsMetadata individualBatchDeleteStatuses. */ + public individualBatchDeleteStatuses: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus[]; + + /** BatchDeleteDocumentsMetadata totalDocumentCount. */ + public totalDocumentCount: number; + + /** BatchDeleteDocumentsMetadata errorDocumentCount. */ + public errorDocumentCount: number; + + /** + * Creates a new BatchDeleteDocumentsMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteDocumentsMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata): google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata; + + /** + * Encodes the specified BatchDeleteDocumentsMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.verify|verify} messages. + * @param message BatchDeleteDocumentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.verify|verify} messages. + * @param message BatchDeleteDocumentsMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteDocumentsMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteDocumentsMetadata + * @throws {Error} If the payload is not a 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.v1beta3.BatchDeleteDocumentsMetadata; + + /** + * Decodes a BatchDeleteDocumentsMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteDocumentsMetadata + * @throws {Error} If the payload is 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.v1beta3.BatchDeleteDocumentsMetadata; + + /** + * Verifies a BatchDeleteDocumentsMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteDocumentsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata; + + /** + * Creates a plain object from a BatchDeleteDocumentsMetadata message. Also converts values to other types if specified. + * @param message BatchDeleteDocumentsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteDocumentsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteDocumentsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchDeleteDocumentsMetadata { + + /** Properties of an IndividualBatchDeleteStatus. */ + interface IIndividualBatchDeleteStatus { + + /** IndividualBatchDeleteStatus documentId */ + documentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); + + /** IndividualBatchDeleteStatus status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents an IndividualBatchDeleteStatus. */ + class IndividualBatchDeleteStatus implements IIndividualBatchDeleteStatus { + + /** + * Constructs a new IndividualBatchDeleteStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus); + + /** IndividualBatchDeleteStatus documentId. */ + public documentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); + + /** IndividualBatchDeleteStatus status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new IndividualBatchDeleteStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns IndividualBatchDeleteStatus instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus): google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus; + + /** + * Encodes the specified IndividualBatchDeleteStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.verify|verify} messages. + * @param message IndividualBatchDeleteStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IndividualBatchDeleteStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.verify|verify} messages. + * @param message IndividualBatchDeleteStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IndividualBatchDeleteStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndividualBatchDeleteStatus + * @throws {Error} If the payload is not a 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.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus; + + /** + * Decodes an IndividualBatchDeleteStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndividualBatchDeleteStatus + * @throws {Error} If the payload is 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.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus; + + /** + * Verifies an IndividualBatchDeleteStatus message. + * @param message Plain 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 IndividualBatchDeleteStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndividualBatchDeleteStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus; + + /** + * Creates a plain object from an IndividualBatchDeleteStatus message. Also converts values to other types if specified. + * @param message IndividualBatchDeleteStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IndividualBatchDeleteStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IndividualBatchDeleteStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GetDatasetSchemaRequest. */ + interface IGetDatasetSchemaRequest { + + /** GetDatasetSchemaRequest name */ + name?: (string|null); + + /** GetDatasetSchemaRequest visibleFieldsOnly */ + visibleFieldsOnly?: (boolean|null); + } + + /** Represents a GetDatasetSchemaRequest. */ + class GetDatasetSchemaRequest implements IGetDatasetSchemaRequest { + + /** + * Constructs a new GetDatasetSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest); + + /** GetDatasetSchemaRequest name. */ + public name: string; + + /** GetDatasetSchemaRequest visibleFieldsOnly. */ + public visibleFieldsOnly: boolean; + + /** + * Creates a new GetDatasetSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDatasetSchemaRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest): google.cloud.documentai.v1beta3.GetDatasetSchemaRequest; + + /** + * Encodes the specified GetDatasetSchemaRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDatasetSchemaRequest.verify|verify} messages. + * @param message GetDatasetSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDatasetSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDatasetSchemaRequest.verify|verify} messages. + * @param message GetDatasetSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDatasetSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDatasetSchemaRequest + * @throws {Error} If the payload is not a 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.v1beta3.GetDatasetSchemaRequest; + + /** + * Decodes a GetDatasetSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDatasetSchemaRequest + * @throws {Error} If the payload is 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.v1beta3.GetDatasetSchemaRequest; + + /** + * Verifies a GetDatasetSchemaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDatasetSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDatasetSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GetDatasetSchemaRequest; + + /** + * Creates a plain object from a GetDatasetSchemaRequest message. Also converts values to other types if specified. + * @param message GetDatasetSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.GetDatasetSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDatasetSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDatasetSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDatasetSchemaRequest. */ + interface IUpdateDatasetSchemaRequest { + + /** UpdateDatasetSchemaRequest datasetSchema */ + datasetSchema?: (google.cloud.documentai.v1beta3.IDatasetSchema|null); + + /** UpdateDatasetSchemaRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDatasetSchemaRequest. */ + class UpdateDatasetSchemaRequest implements IUpdateDatasetSchemaRequest { + + /** + * Constructs a new UpdateDatasetSchemaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest); + + /** UpdateDatasetSchemaRequest datasetSchema. */ + public datasetSchema?: (google.cloud.documentai.v1beta3.IDatasetSchema|null); + + /** UpdateDatasetSchemaRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDatasetSchemaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDatasetSchemaRequest instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest): google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest; + + /** + * Encodes the specified UpdateDatasetSchemaRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.verify|verify} messages. + * @param message UpdateDatasetSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDatasetSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.verify|verify} messages. + * @param message UpdateDatasetSchemaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDatasetSchemaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDatasetSchemaRequest + * @throws {Error} If the payload is not a 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.v1beta3.UpdateDatasetSchemaRequest; + + /** + * Decodes an UpdateDatasetSchemaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDatasetSchemaRequest + * @throws {Error} If the payload is 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.v1beta3.UpdateDatasetSchemaRequest; + + /** + * Verifies an UpdateDatasetSchemaRequest message. + * @param message Plain 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 UpdateDatasetSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDatasetSchemaRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest; + + /** + * Creates a plain object from an UpdateDatasetSchemaRequest message. Also converts values to other types if specified. + * @param message UpdateDatasetSchemaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDatasetSchemaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDatasetSchemaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentPageRange. */ + interface IDocumentPageRange { + + /** DocumentPageRange start */ + start?: (number|null); + + /** DocumentPageRange end */ + end?: (number|null); + } + + /** Represents a DocumentPageRange. */ + class DocumentPageRange implements IDocumentPageRange { + + /** + * Constructs a new DocumentPageRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDocumentPageRange); + + /** DocumentPageRange start. */ + public start: number; + + /** DocumentPageRange end. */ + public end: number; + + /** + * Creates a new DocumentPageRange instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentPageRange instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDocumentPageRange): google.cloud.documentai.v1beta3.DocumentPageRange; + + /** + * Encodes the specified DocumentPageRange message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentPageRange.verify|verify} messages. + * @param message DocumentPageRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDocumentPageRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentPageRange message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentPageRange.verify|verify} messages. + * @param message DocumentPageRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDocumentPageRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentPageRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentPageRange + * @throws {Error} If the payload is not a 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.v1beta3.DocumentPageRange; + + /** + * Decodes a DocumentPageRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentPageRange + * @throws {Error} If the payload is 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.v1beta3.DocumentPageRange; + + /** + * Verifies a DocumentPageRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentPageRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentPageRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentPageRange; + + /** + * Creates a plain object from a DocumentPageRange message. Also converts values to other types if specified. + * @param message DocumentPageRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DocumentPageRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentPageRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentPageRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DocumentMetadata. */ + interface IDocumentMetadata { + + /** DocumentMetadata documentId */ + documentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); + + /** DocumentMetadata pageCount */ + pageCount?: (number|null); + + /** DocumentMetadata datasetType */ + datasetType?: (google.cloud.documentai.v1beta3.DatasetSplitType|keyof typeof google.cloud.documentai.v1beta3.DatasetSplitType|null); + + /** DocumentMetadata labelingState */ + labelingState?: (google.cloud.documentai.v1beta3.DocumentLabelingState|keyof typeof google.cloud.documentai.v1beta3.DocumentLabelingState|null); + + /** DocumentMetadata displayName */ + displayName?: (string|null); + } + + /** Represents a DocumentMetadata. */ + class DocumentMetadata implements IDocumentMetadata { + + /** + * Constructs a new DocumentMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDocumentMetadata); + + /** DocumentMetadata documentId. */ + public documentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); + + /** DocumentMetadata pageCount. */ + public pageCount: number; + + /** DocumentMetadata datasetType. */ + public datasetType: (google.cloud.documentai.v1beta3.DatasetSplitType|keyof typeof google.cloud.documentai.v1beta3.DatasetSplitType); + + /** DocumentMetadata labelingState. */ + public labelingState: (google.cloud.documentai.v1beta3.DocumentLabelingState|keyof typeof google.cloud.documentai.v1beta3.DocumentLabelingState); + + /** DocumentMetadata displayName. */ + public displayName: string; + + /** + * Creates a new DocumentMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDocumentMetadata): google.cloud.documentai.v1beta3.DocumentMetadata; + + /** + * Encodes the specified DocumentMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentMetadata.verify|verify} messages. + * @param message DocumentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentMetadata.verify|verify} messages. + * @param message DocumentMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentMetadata + * @throws {Error} If the payload is not a 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.v1beta3.DocumentMetadata; + + /** + * Decodes a DocumentMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentMetadata + * @throws {Error} If the payload is 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.v1beta3.DocumentMetadata; + + /** + * Verifies a DocumentMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentMetadata; + + /** + * Creates a plain object from a DocumentMetadata message. Also converts values to other types if specified. + * @param message DocumentMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.DocumentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DocumentMetadata + * @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 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 + } + + /** 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; + } + } + + /** 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 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 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 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; + } + } + + /** 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-documentai/protos/protos.js b/owl-bot-staging/google-cloud-documentai/protos/protos.js new file mode 100644 index 00000000000..3ff43c29245 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/protos.js @@ -0,0 +1,124847 @@ +// 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_documentai_protos || ($protobuf.roots._google_cloud_documentai_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.documentai = (function() { + + /** + * Namespace documentai. + * @memberof google.cloud + * @namespace + */ + var documentai = {}; + + documentai.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.documentai + * @namespace + */ + var v1 = {}; + + 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.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.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; + })(); + + v1.RawDocument = (function() { + + /** + * Properties of a RawDocument. + * @memberof google.cloud.documentai.v1 + * @interface IRawDocument + * @property {Uint8Array|null} [content] RawDocument content + * @property {string|null} [mimeType] RawDocument mimeType + * @property {string|null} [displayName] RawDocument displayName + */ + + /** + * Constructs a new RawDocument. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a RawDocument. + * @implements IRawDocument + * @constructor + * @param {google.cloud.documentai.v1.IRawDocument=} [properties] Properties to set + */ + function RawDocument(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RawDocument content. + * @member {Uint8Array} content + * @memberof google.cloud.documentai.v1.RawDocument + * @instance + */ + RawDocument.prototype.content = $util.newBuffer([]); + + /** + * RawDocument mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1.RawDocument + * @instance + */ + RawDocument.prototype.mimeType = ""; + + /** + * RawDocument displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1.RawDocument + * @instance + */ + RawDocument.prototype.displayName = ""; + + /** + * Creates a new RawDocument instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.RawDocument + * @static + * @param {google.cloud.documentai.v1.IRawDocument=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.RawDocument} RawDocument instance + */ + RawDocument.create = function create(properties) { + return new RawDocument(properties); + }; + + /** + * Encodes the specified RawDocument message. Does not implicitly {@link google.cloud.documentai.v1.RawDocument.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.RawDocument + * @static + * @param {google.cloud.documentai.v1.IRawDocument} message RawDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawDocument.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified RawDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.RawDocument.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.RawDocument + * @static + * @param {google.cloud.documentai.v1.IRawDocument} message RawDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawDocument.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RawDocument message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.RawDocument + * @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.RawDocument} RawDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawDocument.decode = function decode(reader, 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.RawDocument(); + 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.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RawDocument message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.RawDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.RawDocument} RawDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawDocument.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RawDocument message. + * @function verify + * @memberof google.cloud.documentai.v1.RawDocument + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RawDocument.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a RawDocument message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.RawDocument + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.RawDocument} RawDocument + */ + RawDocument.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.RawDocument) + return object; + var message = new $root.google.cloud.documentai.v1.RawDocument(); + 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.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a RawDocument message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.RawDocument + * @static + * @param {google.cloud.documentai.v1.RawDocument} message RawDocument + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RawDocument.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.displayName = ""; + } + 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.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this RawDocument to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.RawDocument + * @instance + * @returns {Object.} JSON object + */ + RawDocument.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RawDocument + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.RawDocument + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RawDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.RawDocument"; + }; + + return RawDocument; + })(); + + v1.GcsDocument = (function() { + + /** + * Properties of a GcsDocument. + * @memberof google.cloud.documentai.v1 + * @interface IGcsDocument + * @property {string|null} [gcsUri] GcsDocument gcsUri + * @property {string|null} [mimeType] GcsDocument mimeType + */ + + /** + * Constructs a new GcsDocument. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a GcsDocument. + * @implements IGcsDocument + * @constructor + * @param {google.cloud.documentai.v1.IGcsDocument=} [properties] Properties to set + */ + function GcsDocument(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDocument gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.documentai.v1.GcsDocument + * @instance + */ + GcsDocument.prototype.gcsUri = ""; + + /** + * GcsDocument mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1.GcsDocument + * @instance + */ + GcsDocument.prototype.mimeType = ""; + + /** + * Creates a new GcsDocument instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.GcsDocument + * @static + * @param {google.cloud.documentai.v1.IGcsDocument=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.GcsDocument} GcsDocument instance + */ + GcsDocument.create = function create(properties) { + return new GcsDocument(properties); + }; + + /** + * Encodes the specified GcsDocument message. Does not implicitly {@link google.cloud.documentai.v1.GcsDocument.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.GcsDocument + * @static + * @param {google.cloud.documentai.v1.IGcsDocument} message GcsDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDocument.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified GcsDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GcsDocument.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.GcsDocument + * @static + * @param {google.cloud.documentai.v1.IGcsDocument} message GcsDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDocument.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDocument message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.GcsDocument + * @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.GcsDocument} GcsDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDocument.decode = function decode(reader, 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.GcsDocument(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsUri = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDocument message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.GcsDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.GcsDocument} GcsDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDocument.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDocument message. + * @function verify + * @memberof google.cloud.documentai.v1.GcsDocument + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDocument.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a GcsDocument message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.GcsDocument + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.GcsDocument} GcsDocument + */ + GcsDocument.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.GcsDocument) + return object; + var message = new $root.google.cloud.documentai.v1.GcsDocument(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a GcsDocument message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.GcsDocument + * @static + * @param {google.cloud.documentai.v1.GcsDocument} message GcsDocument + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDocument.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsUri = ""; + object.mimeType = ""; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + object.gcsUri = message.gcsUri; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this GcsDocument to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.GcsDocument + * @instance + * @returns {Object.} JSON object + */ + GcsDocument.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDocument + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.GcsDocument + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.GcsDocument"; + }; + + return GcsDocument; + })(); + + v1.GcsDocuments = (function() { + + /** + * Properties of a GcsDocuments. + * @memberof google.cloud.documentai.v1 + * @interface IGcsDocuments + * @property {Array.|null} [documents] GcsDocuments documents + */ + + /** + * Constructs a new GcsDocuments. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a GcsDocuments. + * @implements IGcsDocuments + * @constructor + * @param {google.cloud.documentai.v1.IGcsDocuments=} [properties] Properties to set + */ + function GcsDocuments(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]]; + } + + /** + * GcsDocuments documents. + * @member {Array.} documents + * @memberof google.cloud.documentai.v1.GcsDocuments + * @instance + */ + GcsDocuments.prototype.documents = $util.emptyArray; + + /** + * Creates a new GcsDocuments instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.GcsDocuments + * @static + * @param {google.cloud.documentai.v1.IGcsDocuments=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.GcsDocuments} GcsDocuments instance + */ + GcsDocuments.create = function create(properties) { + return new GcsDocuments(properties); + }; + + /** + * Encodes the specified GcsDocuments message. Does not implicitly {@link google.cloud.documentai.v1.GcsDocuments.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.GcsDocuments + * @static + * @param {google.cloud.documentai.v1.IGcsDocuments} message GcsDocuments message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDocuments.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) + $root.google.cloud.documentai.v1.GcsDocument.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GcsDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GcsDocuments.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.GcsDocuments + * @static + * @param {google.cloud.documentai.v1.IGcsDocuments} message GcsDocuments message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDocuments.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDocuments message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.GcsDocuments + * @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.GcsDocuments} GcsDocuments + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDocuments.decode = function decode(reader, 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.GcsDocuments(); + 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($root.google.cloud.documentai.v1.GcsDocument.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDocuments message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.GcsDocuments + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.GcsDocuments} GcsDocuments + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDocuments.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDocuments message. + * @function verify + * @memberof google.cloud.documentai.v1.GcsDocuments + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDocuments.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) { + var error = $root.google.cloud.documentai.v1.GcsDocument.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + return null; + }; + + /** + * Creates a GcsDocuments message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.GcsDocuments + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.GcsDocuments} GcsDocuments + */ + GcsDocuments.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.GcsDocuments) + return object; + var message = new $root.google.cloud.documentai.v1.GcsDocuments(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.documentai.v1.GcsDocuments.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.GcsDocuments.documents: object expected"); + message.documents[i] = $root.google.cloud.documentai.v1.GcsDocument.fromObject(object.documents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GcsDocuments message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.GcsDocuments + * @static + * @param {google.cloud.documentai.v1.GcsDocuments} message GcsDocuments + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDocuments.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.cloud.documentai.v1.GcsDocument.toObject(message.documents[j], options); + } + return object; + }; + + /** + * Converts this GcsDocuments to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.GcsDocuments + * @instance + * @returns {Object.} JSON object + */ + GcsDocuments.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDocuments + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.GcsDocuments + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDocuments.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.GcsDocuments"; + }; + + return GcsDocuments; + })(); + + v1.GcsPrefix = (function() { + + /** + * Properties of a GcsPrefix. + * @memberof google.cloud.documentai.v1 + * @interface IGcsPrefix + * @property {string|null} [gcsUriPrefix] GcsPrefix gcsUriPrefix + */ + + /** + * Constructs a new GcsPrefix. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a GcsPrefix. + * @implements IGcsPrefix + * @constructor + * @param {google.cloud.documentai.v1.IGcsPrefix=} [properties] Properties to set + */ + function GcsPrefix(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsPrefix gcsUriPrefix. + * @member {string} gcsUriPrefix + * @memberof google.cloud.documentai.v1.GcsPrefix + * @instance + */ + GcsPrefix.prototype.gcsUriPrefix = ""; + + /** + * Creates a new GcsPrefix instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.GcsPrefix + * @static + * @param {google.cloud.documentai.v1.IGcsPrefix=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.GcsPrefix} GcsPrefix instance + */ + GcsPrefix.create = function create(properties) { + return new GcsPrefix(properties); + }; + + /** + * Encodes the specified GcsPrefix message. Does not implicitly {@link google.cloud.documentai.v1.GcsPrefix.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.GcsPrefix + * @static + * @param {google.cloud.documentai.v1.IGcsPrefix} message GcsPrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsPrefix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsUriPrefix != null && Object.hasOwnProperty.call(message, "gcsUriPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsPrefix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GcsPrefix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.GcsPrefix + * @static + * @param {google.cloud.documentai.v1.IGcsPrefix} message GcsPrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsPrefix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsPrefix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.GcsPrefix + * @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.GcsPrefix} GcsPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsPrefix.decode = function decode(reader, 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.GcsPrefix(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsUriPrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsPrefix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.GcsPrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.GcsPrefix} GcsPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsPrefix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsPrefix message. + * @function verify + * @memberof google.cloud.documentai.v1.GcsPrefix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsPrefix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsUriPrefix != null && message.hasOwnProperty("gcsUriPrefix")) + if (!$util.isString(message.gcsUriPrefix)) + return "gcsUriPrefix: string expected"; + return null; + }; + + /** + * Creates a GcsPrefix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.GcsPrefix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.GcsPrefix} GcsPrefix + */ + GcsPrefix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.GcsPrefix) + return object; + var message = new $root.google.cloud.documentai.v1.GcsPrefix(); + if (object.gcsUriPrefix != null) + message.gcsUriPrefix = String(object.gcsUriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsPrefix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.GcsPrefix + * @static + * @param {google.cloud.documentai.v1.GcsPrefix} message GcsPrefix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsPrefix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsUriPrefix = ""; + if (message.gcsUriPrefix != null && message.hasOwnProperty("gcsUriPrefix")) + object.gcsUriPrefix = message.gcsUriPrefix; + return object; + }; + + /** + * Converts this GcsPrefix to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.GcsPrefix + * @instance + * @returns {Object.} JSON object + */ + GcsPrefix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsPrefix + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.GcsPrefix + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsPrefix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.GcsPrefix"; + }; + + return GcsPrefix; + })(); + + v1.BatchDocumentsInputConfig = (function() { + + /** + * Properties of a BatchDocumentsInputConfig. + * @memberof google.cloud.documentai.v1 + * @interface IBatchDocumentsInputConfig + * @property {google.cloud.documentai.v1.IGcsPrefix|null} [gcsPrefix] BatchDocumentsInputConfig gcsPrefix + * @property {google.cloud.documentai.v1.IGcsDocuments|null} [gcsDocuments] BatchDocumentsInputConfig gcsDocuments + */ + + /** + * Constructs a new BatchDocumentsInputConfig. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a BatchDocumentsInputConfig. + * @implements IBatchDocumentsInputConfig + * @constructor + * @param {google.cloud.documentai.v1.IBatchDocumentsInputConfig=} [properties] Properties to set + */ + function BatchDocumentsInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDocumentsInputConfig gcsPrefix. + * @member {google.cloud.documentai.v1.IGcsPrefix|null|undefined} gcsPrefix + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @instance + */ + BatchDocumentsInputConfig.prototype.gcsPrefix = null; + + /** + * BatchDocumentsInputConfig gcsDocuments. + * @member {google.cloud.documentai.v1.IGcsDocuments|null|undefined} gcsDocuments + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @instance + */ + BatchDocumentsInputConfig.prototype.gcsDocuments = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchDocumentsInputConfig source. + * @member {"gcsPrefix"|"gcsDocuments"|undefined} source + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @instance + */ + Object.defineProperty(BatchDocumentsInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsPrefix", "gcsDocuments"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchDocumentsInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @static + * @param {google.cloud.documentai.v1.IBatchDocumentsInputConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.BatchDocumentsInputConfig} BatchDocumentsInputConfig instance + */ + BatchDocumentsInputConfig.create = function create(properties) { + return new BatchDocumentsInputConfig(properties); + }; + + /** + * Encodes the specified BatchDocumentsInputConfig message. Does not implicitly {@link google.cloud.documentai.v1.BatchDocumentsInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @static + * @param {google.cloud.documentai.v1.IBatchDocumentsInputConfig} message BatchDocumentsInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDocumentsInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) + $root.google.cloud.documentai.v1.GcsPrefix.encode(message.gcsPrefix, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcsDocuments != null && Object.hasOwnProperty.call(message, "gcsDocuments")) + $root.google.cloud.documentai.v1.GcsDocuments.encode(message.gcsDocuments, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchDocumentsInputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchDocumentsInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @static + * @param {google.cloud.documentai.v1.IBatchDocumentsInputConfig} message BatchDocumentsInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDocumentsInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @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.BatchDocumentsInputConfig} BatchDocumentsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDocumentsInputConfig.decode = function decode(reader, 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.BatchDocumentsInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsPrefix = $root.google.cloud.documentai.v1.GcsPrefix.decode(reader, reader.uint32()); + break; + } + case 2: { + message.gcsDocuments = $root.google.cloud.documentai.v1.GcsDocuments.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.BatchDocumentsInputConfig} BatchDocumentsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDocumentsInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDocumentsInputConfig message. + * @function verify + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDocumentsInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1.GcsPrefix.verify(message.gcsPrefix); + if (error) + return "gcsPrefix." + error; + } + } + if (message.gcsDocuments != null && message.hasOwnProperty("gcsDocuments")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1.GcsDocuments.verify(message.gcsDocuments); + if (error) + return "gcsDocuments." + error; + } + } + return null; + }; + + /** + * Creates a BatchDocumentsInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.BatchDocumentsInputConfig} BatchDocumentsInputConfig + */ + BatchDocumentsInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.BatchDocumentsInputConfig) + return object; + var message = new $root.google.cloud.documentai.v1.BatchDocumentsInputConfig(); + if (object.gcsPrefix != null) { + if (typeof object.gcsPrefix !== "object") + throw TypeError(".google.cloud.documentai.v1.BatchDocumentsInputConfig.gcsPrefix: object expected"); + message.gcsPrefix = $root.google.cloud.documentai.v1.GcsPrefix.fromObject(object.gcsPrefix); + } + if (object.gcsDocuments != null) { + if (typeof object.gcsDocuments !== "object") + throw TypeError(".google.cloud.documentai.v1.BatchDocumentsInputConfig.gcsDocuments: object expected"); + message.gcsDocuments = $root.google.cloud.documentai.v1.GcsDocuments.fromObject(object.gcsDocuments); + } + return message; + }; + + /** + * Creates a plain object from a BatchDocumentsInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @static + * @param {google.cloud.documentai.v1.BatchDocumentsInputConfig} message BatchDocumentsInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDocumentsInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + object.gcsPrefix = $root.google.cloud.documentai.v1.GcsPrefix.toObject(message.gcsPrefix, options); + if (options.oneofs) + object.source = "gcsPrefix"; + } + if (message.gcsDocuments != null && message.hasOwnProperty("gcsDocuments")) { + object.gcsDocuments = $root.google.cloud.documentai.v1.GcsDocuments.toObject(message.gcsDocuments, options); + if (options.oneofs) + object.source = "gcsDocuments"; + } + return object; + }; + + /** + * Converts this BatchDocumentsInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchDocumentsInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDocumentsInputConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDocumentsInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.BatchDocumentsInputConfig"; + }; + + return BatchDocumentsInputConfig; + })(); + + v1.DocumentOutputConfig = (function() { + + /** + * Properties of a DocumentOutputConfig. + * @memberof google.cloud.documentai.v1 + * @interface IDocumentOutputConfig + * @property {google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig|null} [gcsOutputConfig] DocumentOutputConfig gcsOutputConfig + */ + + /** + * Constructs a new DocumentOutputConfig. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DocumentOutputConfig. + * @implements IDocumentOutputConfig + * @constructor + * @param {google.cloud.documentai.v1.IDocumentOutputConfig=} [properties] Properties to set + */ + function DocumentOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentOutputConfig gcsOutputConfig. + * @member {google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig|null|undefined} gcsOutputConfig + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @instance + */ + DocumentOutputConfig.prototype.gcsOutputConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DocumentOutputConfig destination. + * @member {"gcsOutputConfig"|undefined} destination + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @instance + */ + Object.defineProperty(DocumentOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DocumentOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @static + * @param {google.cloud.documentai.v1.IDocumentOutputConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DocumentOutputConfig} DocumentOutputConfig instance + */ + DocumentOutputConfig.create = function create(properties) { + return new DocumentOutputConfig(properties); + }; + + /** + * Encodes the specified DocumentOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @static + * @param {google.cloud.documentai.v1.IDocumentOutputConfig} message DocumentOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputConfig != null && Object.hasOwnProperty.call(message, "gcsOutputConfig")) + $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.encode(message.gcsOutputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @static + * @param {google.cloud.documentai.v1.IDocumentOutputConfig} message DocumentOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @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.DocumentOutputConfig} DocumentOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentOutputConfig.decode = function decode(reader, 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.DocumentOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsOutputConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DocumentOutputConfig} DocumentOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentOutputConfig message. + * @function verify + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputConfig != null && message.hasOwnProperty("gcsOutputConfig")) { + properties.destination = 1; + { + var error = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.verify(message.gcsOutputConfig); + if (error) + return "gcsOutputConfig." + error; + } + } + return null; + }; + + /** + * Creates a DocumentOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DocumentOutputConfig} DocumentOutputConfig + */ + DocumentOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DocumentOutputConfig) + return object; + var message = new $root.google.cloud.documentai.v1.DocumentOutputConfig(); + if (object.gcsOutputConfig != null) { + if (typeof object.gcsOutputConfig !== "object") + throw TypeError(".google.cloud.documentai.v1.DocumentOutputConfig.gcsOutputConfig: object expected"); + message.gcsOutputConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.fromObject(object.gcsOutputConfig); + } + return message; + }; + + /** + * Creates a plain object from a DocumentOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @static + * @param {google.cloud.documentai.v1.DocumentOutputConfig} message DocumentOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputConfig != null && message.hasOwnProperty("gcsOutputConfig")) { + object.gcsOutputConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.toObject(message.gcsOutputConfig, options); + if (options.oneofs) + object.destination = "gcsOutputConfig"; + } + return object; + }; + + /** + * Converts this DocumentOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @instance + * @returns {Object.} JSON object + */ + DocumentOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentOutputConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DocumentOutputConfig"; + }; + + DocumentOutputConfig.GcsOutputConfig = (function() { + + /** + * Properties of a GcsOutputConfig. + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @interface IGcsOutputConfig + * @property {string|null} [gcsUri] GcsOutputConfig gcsUri + * @property {google.protobuf.IFieldMask|null} [fieldMask] GcsOutputConfig fieldMask + * @property {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null} [shardingConfig] GcsOutputConfig shardingConfig + */ + + /** + * Constructs a new GcsOutputConfig. + * @memberof google.cloud.documentai.v1.DocumentOutputConfig + * @classdesc Represents a GcsOutputConfig. + * @implements IGcsOutputConfig + * @constructor + * @param {google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig=} [properties] Properties to set + */ + function GcsOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsOutputConfig gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @instance + */ + GcsOutputConfig.prototype.gcsUri = ""; + + /** + * GcsOutputConfig fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @instance + */ + GcsOutputConfig.prototype.fieldMask = null; + + /** + * GcsOutputConfig shardingConfig. + * @member {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null|undefined} shardingConfig + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @instance + */ + GcsOutputConfig.prototype.shardingConfig = null; + + /** + * Creates a new GcsOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig instance + */ + GcsOutputConfig.create = function create(properties) { + return new GcsOutputConfig(properties); + }; + + /** + * Encodes the specified GcsOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig} message GcsOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.shardingConfig != null && Object.hasOwnProperty.call(message, "shardingConfig")) + $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.encode(message.shardingConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GcsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig} message GcsOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @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.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputConfig.decode = function decode(reader, 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.DocumentOutputConfig.GcsOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsUri = reader.string(); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.shardingConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsOutputConfig message. + * @function verify + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.shardingConfig != null && message.hasOwnProperty("shardingConfig")) { + var error = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify(message.shardingConfig); + if (error) + return "shardingConfig." + error; + } + return null; + }; + + /** + * Creates a GcsOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig + */ + GcsOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig) + return object; + var message = new $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.shardingConfig != null) { + if (typeof object.shardingConfig !== "object") + throw TypeError(".google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.shardingConfig: object expected"); + message.shardingConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.fromObject(object.shardingConfig); + } + return message; + }; + + /** + * Creates a plain object from a GcsOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig} message GcsOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsUri = ""; + object.fieldMask = null; + object.shardingConfig = null; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + object.gcsUri = message.gcsUri; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.shardingConfig != null && message.hasOwnProperty("shardingConfig")) + object.shardingConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.toObject(message.shardingConfig, options); + return object; + }; + + /** + * Converts this GcsOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @instance + * @returns {Object.} JSON object + */ + GcsOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsOutputConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig"; + }; + + GcsOutputConfig.ShardingConfig = (function() { + + /** + * Properties of a ShardingConfig. + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @interface IShardingConfig + * @property {number|null} [pagesPerShard] ShardingConfig pagesPerShard + * @property {number|null} [pagesOverlap] ShardingConfig pagesOverlap + */ + + /** + * Constructs a new ShardingConfig. + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig + * @classdesc Represents a ShardingConfig. + * @implements IShardingConfig + * @constructor + * @param {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig=} [properties] Properties to set + */ + function ShardingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShardingConfig pagesPerShard. + * @member {number} pagesPerShard + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @instance + */ + ShardingConfig.prototype.pagesPerShard = 0; + + /** + * ShardingConfig pagesOverlap. + * @member {number} pagesOverlap + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @instance + */ + ShardingConfig.prototype.pagesOverlap = 0; + + /** + * Creates a new ShardingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig instance + */ + ShardingConfig.create = function create(properties) { + return new ShardingConfig(properties); + }; + + /** + * Encodes the specified ShardingConfig message. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig} message ShardingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pagesPerShard != null && Object.hasOwnProperty.call(message, "pagesPerShard")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pagesPerShard); + if (message.pagesOverlap != null && Object.hasOwnProperty.call(message, "pagesOverlap")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pagesOverlap); + return writer; + }; + + /** + * Encodes the specified ShardingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig} message ShardingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShardingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @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.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardingConfig.decode = function decode(reader, 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.DocumentOutputConfig.GcsOutputConfig.ShardingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pagesPerShard = reader.int32(); + break; + } + case 2: { + message.pagesOverlap = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShardingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShardingConfig message. + * @function verify + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShardingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pagesPerShard != null && message.hasOwnProperty("pagesPerShard")) + if (!$util.isInteger(message.pagesPerShard)) + return "pagesPerShard: integer expected"; + if (message.pagesOverlap != null && message.hasOwnProperty("pagesOverlap")) + if (!$util.isInteger(message.pagesOverlap)) + return "pagesOverlap: integer expected"; + return null; + }; + + /** + * Creates a ShardingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig + */ + ShardingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig) + return object; + var message = new $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig(); + if (object.pagesPerShard != null) + message.pagesPerShard = object.pagesPerShard | 0; + if (object.pagesOverlap != null) + message.pagesOverlap = object.pagesOverlap | 0; + return message; + }; + + /** + * Creates a plain object from a ShardingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} message ShardingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShardingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pagesPerShard = 0; + object.pagesOverlap = 0; + } + if (message.pagesPerShard != null && message.hasOwnProperty("pagesPerShard")) + object.pagesPerShard = message.pagesPerShard; + if (message.pagesOverlap != null && message.hasOwnProperty("pagesOverlap")) + object.pagesOverlap = message.pagesOverlap; + return object; + }; + + /** + * Converts this ShardingConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @instance + * @returns {Object.} JSON object + */ + ShardingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShardingConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig"; + }; + + return ShardingConfig; + })(); + + return GcsOutputConfig; + })(); + + return DocumentOutputConfig; + })(); + + v1.OcrConfig = (function() { + + /** + * Properties of an OcrConfig. + * @memberof google.cloud.documentai.v1 + * @interface IOcrConfig + * @property {google.cloud.documentai.v1.OcrConfig.IHints|null} [hints] OcrConfig hints + * @property {boolean|null} [enableNativePdfParsing] OcrConfig enableNativePdfParsing + * @property {boolean|null} [enableImageQualityScores] OcrConfig enableImageQualityScores + * @property {Array.|null} [advancedOcrOptions] OcrConfig advancedOcrOptions + * @property {boolean|null} [enableSymbol] OcrConfig enableSymbol + * @property {boolean|null} [computeStyleInfo] OcrConfig computeStyleInfo + * @property {boolean|null} [disableCharacterBoxesDetection] OcrConfig disableCharacterBoxesDetection + * @property {google.cloud.documentai.v1.OcrConfig.IPremiumFeatures|null} [premiumFeatures] OcrConfig premiumFeatures + */ + + /** + * Constructs a new OcrConfig. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents an OcrConfig. + * @implements IOcrConfig + * @constructor + * @param {google.cloud.documentai.v1.IOcrConfig=} [properties] Properties to set + */ + function OcrConfig(properties) { + this.advancedOcrOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OcrConfig hints. + * @member {google.cloud.documentai.v1.OcrConfig.IHints|null|undefined} hints + * @memberof google.cloud.documentai.v1.OcrConfig + * @instance + */ + OcrConfig.prototype.hints = null; + + /** + * OcrConfig enableNativePdfParsing. + * @member {boolean} enableNativePdfParsing + * @memberof google.cloud.documentai.v1.OcrConfig + * @instance + */ + OcrConfig.prototype.enableNativePdfParsing = false; + + /** + * OcrConfig enableImageQualityScores. + * @member {boolean} enableImageQualityScores + * @memberof google.cloud.documentai.v1.OcrConfig + * @instance + */ + OcrConfig.prototype.enableImageQualityScores = false; + + /** + * OcrConfig advancedOcrOptions. + * @member {Array.} advancedOcrOptions + * @memberof google.cloud.documentai.v1.OcrConfig + * @instance + */ + OcrConfig.prototype.advancedOcrOptions = $util.emptyArray; + + /** + * OcrConfig enableSymbol. + * @member {boolean} enableSymbol + * @memberof google.cloud.documentai.v1.OcrConfig + * @instance + */ + OcrConfig.prototype.enableSymbol = false; + + /** + * OcrConfig computeStyleInfo. + * @member {boolean} computeStyleInfo + * @memberof google.cloud.documentai.v1.OcrConfig + * @instance + */ + OcrConfig.prototype.computeStyleInfo = false; + + /** + * OcrConfig disableCharacterBoxesDetection. + * @member {boolean} disableCharacterBoxesDetection + * @memberof google.cloud.documentai.v1.OcrConfig + * @instance + */ + OcrConfig.prototype.disableCharacterBoxesDetection = false; + + /** + * OcrConfig premiumFeatures. + * @member {google.cloud.documentai.v1.OcrConfig.IPremiumFeatures|null|undefined} premiumFeatures + * @memberof google.cloud.documentai.v1.OcrConfig + * @instance + */ + OcrConfig.prototype.premiumFeatures = null; + + /** + * Creates a new OcrConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.OcrConfig + * @static + * @param {google.cloud.documentai.v1.IOcrConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.OcrConfig} OcrConfig instance + */ + OcrConfig.create = function create(properties) { + return new OcrConfig(properties); + }; + + /** + * Encodes the specified OcrConfig message. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.OcrConfig + * @static + * @param {google.cloud.documentai.v1.IOcrConfig} message OcrConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OcrConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hints != null && Object.hasOwnProperty.call(message, "hints")) + $root.google.cloud.documentai.v1.OcrConfig.Hints.encode(message.hints, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.enableNativePdfParsing != null && Object.hasOwnProperty.call(message, "enableNativePdfParsing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableNativePdfParsing); + if (message.enableImageQualityScores != null && Object.hasOwnProperty.call(message, "enableImageQualityScores")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableImageQualityScores); + if (message.advancedOcrOptions != null && message.advancedOcrOptions.length) + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.advancedOcrOptions[i]); + if (message.enableSymbol != null && Object.hasOwnProperty.call(message, "enableSymbol")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableSymbol); + if (message.computeStyleInfo != null && Object.hasOwnProperty.call(message, "computeStyleInfo")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.computeStyleInfo); + if (message.disableCharacterBoxesDetection != null && Object.hasOwnProperty.call(message, "disableCharacterBoxesDetection")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.disableCharacterBoxesDetection); + if (message.premiumFeatures != null && Object.hasOwnProperty.call(message, "premiumFeatures")) + $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures.encode(message.premiumFeatures, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OcrConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.OcrConfig + * @static + * @param {google.cloud.documentai.v1.IOcrConfig} message OcrConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OcrConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OcrConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.OcrConfig + * @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.OcrConfig} OcrConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OcrConfig.decode = function decode(reader, 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.OcrConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.hints = $root.google.cloud.documentai.v1.OcrConfig.Hints.decode(reader, reader.uint32()); + break; + } + case 3: { + message.enableNativePdfParsing = reader.bool(); + break; + } + case 4: { + message.enableImageQualityScores = reader.bool(); + break; + } + case 5: { + if (!(message.advancedOcrOptions && message.advancedOcrOptions.length)) + message.advancedOcrOptions = []; + message.advancedOcrOptions.push(reader.string()); + break; + } + case 6: { + message.enableSymbol = reader.bool(); + break; + } + case 8: { + message.computeStyleInfo = reader.bool(); + break; + } + case 10: { + message.disableCharacterBoxesDetection = reader.bool(); + break; + } + case 11: { + message.premiumFeatures = $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OcrConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.OcrConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.OcrConfig} OcrConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OcrConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OcrConfig message. + * @function verify + * @memberof google.cloud.documentai.v1.OcrConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OcrConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hints != null && message.hasOwnProperty("hints")) { + var error = $root.google.cloud.documentai.v1.OcrConfig.Hints.verify(message.hints); + if (error) + return "hints." + error; + } + if (message.enableNativePdfParsing != null && message.hasOwnProperty("enableNativePdfParsing")) + if (typeof message.enableNativePdfParsing !== "boolean") + return "enableNativePdfParsing: boolean expected"; + if (message.enableImageQualityScores != null && message.hasOwnProperty("enableImageQualityScores")) + if (typeof message.enableImageQualityScores !== "boolean") + return "enableImageQualityScores: boolean expected"; + if (message.advancedOcrOptions != null && message.hasOwnProperty("advancedOcrOptions")) { + if (!Array.isArray(message.advancedOcrOptions)) + return "advancedOcrOptions: array expected"; + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + if (!$util.isString(message.advancedOcrOptions[i])) + return "advancedOcrOptions: string[] expected"; + } + if (message.enableSymbol != null && message.hasOwnProperty("enableSymbol")) + if (typeof message.enableSymbol !== "boolean") + return "enableSymbol: boolean expected"; + if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) + if (typeof message.computeStyleInfo !== "boolean") + return "computeStyleInfo: boolean expected"; + if (message.disableCharacterBoxesDetection != null && message.hasOwnProperty("disableCharacterBoxesDetection")) + if (typeof message.disableCharacterBoxesDetection !== "boolean") + return "disableCharacterBoxesDetection: boolean expected"; + if (message.premiumFeatures != null && message.hasOwnProperty("premiumFeatures")) { + var error = $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures.verify(message.premiumFeatures); + if (error) + return "premiumFeatures." + error; + } + return null; + }; + + /** + * Creates an OcrConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.OcrConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.OcrConfig} OcrConfig + */ + OcrConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.OcrConfig) + return object; + var message = new $root.google.cloud.documentai.v1.OcrConfig(); + if (object.hints != null) { + if (typeof object.hints !== "object") + throw TypeError(".google.cloud.documentai.v1.OcrConfig.hints: object expected"); + message.hints = $root.google.cloud.documentai.v1.OcrConfig.Hints.fromObject(object.hints); + } + if (object.enableNativePdfParsing != null) + message.enableNativePdfParsing = Boolean(object.enableNativePdfParsing); + if (object.enableImageQualityScores != null) + message.enableImageQualityScores = Boolean(object.enableImageQualityScores); + if (object.advancedOcrOptions) { + if (!Array.isArray(object.advancedOcrOptions)) + throw TypeError(".google.cloud.documentai.v1.OcrConfig.advancedOcrOptions: array expected"); + message.advancedOcrOptions = []; + for (var i = 0; i < object.advancedOcrOptions.length; ++i) + message.advancedOcrOptions[i] = String(object.advancedOcrOptions[i]); + } + if (object.enableSymbol != null) + message.enableSymbol = Boolean(object.enableSymbol); + if (object.computeStyleInfo != null) + message.computeStyleInfo = Boolean(object.computeStyleInfo); + if (object.disableCharacterBoxesDetection != null) + message.disableCharacterBoxesDetection = Boolean(object.disableCharacterBoxesDetection); + if (object.premiumFeatures != null) { + if (typeof object.premiumFeatures !== "object") + throw TypeError(".google.cloud.documentai.v1.OcrConfig.premiumFeatures: object expected"); + message.premiumFeatures = $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures.fromObject(object.premiumFeatures); + } + return message; + }; + + /** + * Creates a plain object from an OcrConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.OcrConfig + * @static + * @param {google.cloud.documentai.v1.OcrConfig} message OcrConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OcrConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.advancedOcrOptions = []; + if (options.defaults) { + object.hints = null; + object.enableNativePdfParsing = false; + object.enableImageQualityScores = false; + object.enableSymbol = false; + object.computeStyleInfo = false; + object.disableCharacterBoxesDetection = false; + object.premiumFeatures = null; + } + if (message.hints != null && message.hasOwnProperty("hints")) + object.hints = $root.google.cloud.documentai.v1.OcrConfig.Hints.toObject(message.hints, options); + if (message.enableNativePdfParsing != null && message.hasOwnProperty("enableNativePdfParsing")) + object.enableNativePdfParsing = message.enableNativePdfParsing; + if (message.enableImageQualityScores != null && message.hasOwnProperty("enableImageQualityScores")) + object.enableImageQualityScores = message.enableImageQualityScores; + if (message.advancedOcrOptions && message.advancedOcrOptions.length) { + object.advancedOcrOptions = []; + for (var j = 0; j < message.advancedOcrOptions.length; ++j) + object.advancedOcrOptions[j] = message.advancedOcrOptions[j]; + } + if (message.enableSymbol != null && message.hasOwnProperty("enableSymbol")) + object.enableSymbol = message.enableSymbol; + if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) + object.computeStyleInfo = message.computeStyleInfo; + if (message.disableCharacterBoxesDetection != null && message.hasOwnProperty("disableCharacterBoxesDetection")) + object.disableCharacterBoxesDetection = message.disableCharacterBoxesDetection; + if (message.premiumFeatures != null && message.hasOwnProperty("premiumFeatures")) + object.premiumFeatures = $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures.toObject(message.premiumFeatures, options); + return object; + }; + + /** + * Converts this OcrConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.OcrConfig + * @instance + * @returns {Object.} JSON object + */ + OcrConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OcrConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.OcrConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OcrConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.OcrConfig"; + }; + + OcrConfig.Hints = (function() { + + /** + * Properties of a Hints. + * @memberof google.cloud.documentai.v1.OcrConfig + * @interface IHints + * @property {Array.|null} [languageHints] Hints languageHints + */ + + /** + * Constructs a new Hints. + * @memberof google.cloud.documentai.v1.OcrConfig + * @classdesc Represents a Hints. + * @implements IHints + * @constructor + * @param {google.cloud.documentai.v1.OcrConfig.IHints=} [properties] Properties to set + */ + function Hints(properties) { + this.languageHints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Hints languageHints. + * @member {Array.} languageHints + * @memberof google.cloud.documentai.v1.OcrConfig.Hints + * @instance + */ + Hints.prototype.languageHints = $util.emptyArray; + + /** + * Creates a new Hints instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.OcrConfig.Hints + * @static + * @param {google.cloud.documentai.v1.OcrConfig.IHints=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.OcrConfig.Hints} Hints instance + */ + Hints.create = function create(properties) { + return new Hints(properties); + }; + + /** + * Encodes the specified Hints message. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.Hints.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.OcrConfig.Hints + * @static + * @param {google.cloud.documentai.v1.OcrConfig.IHints} message Hints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageHints != null && message.languageHints.length) + for (var i = 0; i < message.languageHints.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageHints[i]); + return writer; + }; + + /** + * Encodes the specified Hints message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.Hints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.OcrConfig.Hints + * @static + * @param {google.cloud.documentai.v1.OcrConfig.IHints} message Hints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Hints message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.OcrConfig.Hints + * @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.OcrConfig.Hints} Hints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hints.decode = function decode(reader, 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.OcrConfig.Hints(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.languageHints && message.languageHints.length)) + message.languageHints = []; + message.languageHints.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Hints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.OcrConfig.Hints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.OcrConfig.Hints} Hints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Hints message. + * @function verify + * @memberof google.cloud.documentai.v1.OcrConfig.Hints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Hints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageHints != null && message.hasOwnProperty("languageHints")) { + if (!Array.isArray(message.languageHints)) + return "languageHints: array expected"; + for (var i = 0; i < message.languageHints.length; ++i) + if (!$util.isString(message.languageHints[i])) + return "languageHints: string[] expected"; + } + return null; + }; + + /** + * Creates a Hints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.OcrConfig.Hints + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.OcrConfig.Hints} Hints + */ + Hints.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.OcrConfig.Hints) + return object; + var message = new $root.google.cloud.documentai.v1.OcrConfig.Hints(); + if (object.languageHints) { + if (!Array.isArray(object.languageHints)) + throw TypeError(".google.cloud.documentai.v1.OcrConfig.Hints.languageHints: array expected"); + message.languageHints = []; + for (var i = 0; i < object.languageHints.length; ++i) + message.languageHints[i] = String(object.languageHints[i]); + } + return message; + }; + + /** + * Creates a plain object from a Hints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.OcrConfig.Hints + * @static + * @param {google.cloud.documentai.v1.OcrConfig.Hints} message Hints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Hints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageHints = []; + if (message.languageHints && message.languageHints.length) { + object.languageHints = []; + for (var j = 0; j < message.languageHints.length; ++j) + object.languageHints[j] = message.languageHints[j]; + } + return object; + }; + + /** + * Converts this Hints to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.OcrConfig.Hints + * @instance + * @returns {Object.} JSON object + */ + Hints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Hints + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.OcrConfig.Hints + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Hints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.OcrConfig.Hints"; + }; + + return Hints; + })(); + + OcrConfig.PremiumFeatures = (function() { + + /** + * Properties of a PremiumFeatures. + * @memberof google.cloud.documentai.v1.OcrConfig + * @interface IPremiumFeatures + * @property {boolean|null} [enableSelectionMarkDetection] PremiumFeatures enableSelectionMarkDetection + * @property {boolean|null} [computeStyleInfo] PremiumFeatures computeStyleInfo + * @property {boolean|null} [enableMathOcr] PremiumFeatures enableMathOcr + */ + + /** + * Constructs a new PremiumFeatures. + * @memberof google.cloud.documentai.v1.OcrConfig + * @classdesc Represents a PremiumFeatures. + * @implements IPremiumFeatures + * @constructor + * @param {google.cloud.documentai.v1.OcrConfig.IPremiumFeatures=} [properties] Properties to set + */ + function PremiumFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PremiumFeatures enableSelectionMarkDetection. + * @member {boolean} enableSelectionMarkDetection + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @instance + */ + PremiumFeatures.prototype.enableSelectionMarkDetection = false; + + /** + * PremiumFeatures computeStyleInfo. + * @member {boolean} computeStyleInfo + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @instance + */ + PremiumFeatures.prototype.computeStyleInfo = false; + + /** + * PremiumFeatures enableMathOcr. + * @member {boolean} enableMathOcr + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @instance + */ + PremiumFeatures.prototype.enableMathOcr = false; + + /** + * Creates a new PremiumFeatures instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @static + * @param {google.cloud.documentai.v1.OcrConfig.IPremiumFeatures=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.OcrConfig.PremiumFeatures} PremiumFeatures instance + */ + PremiumFeatures.create = function create(properties) { + return new PremiumFeatures(properties); + }; + + /** + * Encodes the specified PremiumFeatures message. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.PremiumFeatures.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @static + * @param {google.cloud.documentai.v1.OcrConfig.IPremiumFeatures} message PremiumFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PremiumFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableSelectionMarkDetection != null && Object.hasOwnProperty.call(message, "enableSelectionMarkDetection")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableSelectionMarkDetection); + if (message.computeStyleInfo != null && Object.hasOwnProperty.call(message, "computeStyleInfo")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.computeStyleInfo); + if (message.enableMathOcr != null && Object.hasOwnProperty.call(message, "enableMathOcr")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableMathOcr); + return writer; + }; + + /** + * Encodes the specified PremiumFeatures message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.PremiumFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @static + * @param {google.cloud.documentai.v1.OcrConfig.IPremiumFeatures} message PremiumFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PremiumFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PremiumFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @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.OcrConfig.PremiumFeatures} PremiumFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PremiumFeatures.decode = function decode(reader, 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.OcrConfig.PremiumFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.enableSelectionMarkDetection = reader.bool(); + break; + } + case 4: { + message.computeStyleInfo = reader.bool(); + break; + } + case 5: { + message.enableMathOcr = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PremiumFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.OcrConfig.PremiumFeatures} PremiumFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PremiumFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PremiumFeatures message. + * @function verify + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PremiumFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableSelectionMarkDetection != null && message.hasOwnProperty("enableSelectionMarkDetection")) + if (typeof message.enableSelectionMarkDetection !== "boolean") + return "enableSelectionMarkDetection: boolean expected"; + if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) + if (typeof message.computeStyleInfo !== "boolean") + return "computeStyleInfo: boolean expected"; + if (message.enableMathOcr != null && message.hasOwnProperty("enableMathOcr")) + if (typeof message.enableMathOcr !== "boolean") + return "enableMathOcr: boolean expected"; + return null; + }; + + /** + * Creates a PremiumFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.OcrConfig.PremiumFeatures} PremiumFeatures + */ + PremiumFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures) + return object; + var message = new $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures(); + if (object.enableSelectionMarkDetection != null) + message.enableSelectionMarkDetection = Boolean(object.enableSelectionMarkDetection); + if (object.computeStyleInfo != null) + message.computeStyleInfo = Boolean(object.computeStyleInfo); + if (object.enableMathOcr != null) + message.enableMathOcr = Boolean(object.enableMathOcr); + return message; + }; + + /** + * Creates a plain object from a PremiumFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @static + * @param {google.cloud.documentai.v1.OcrConfig.PremiumFeatures} message PremiumFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PremiumFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableSelectionMarkDetection = false; + object.computeStyleInfo = false; + object.enableMathOcr = false; + } + if (message.enableSelectionMarkDetection != null && message.hasOwnProperty("enableSelectionMarkDetection")) + object.enableSelectionMarkDetection = message.enableSelectionMarkDetection; + if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) + object.computeStyleInfo = message.computeStyleInfo; + if (message.enableMathOcr != null && message.hasOwnProperty("enableMathOcr")) + object.enableMathOcr = message.enableMathOcr; + return object; + }; + + /** + * Converts this PremiumFeatures to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @instance + * @returns {Object.} JSON object + */ + PremiumFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PremiumFeatures + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PremiumFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.OcrConfig.PremiumFeatures"; + }; + + return PremiumFeatures; + })(); + + return OcrConfig; + })(); + + v1.DocumentProcessorService = (function() { + + /** + * Constructs a new DocumentProcessorService service. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DocumentProcessorService + * @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 DocumentProcessorService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DocumentProcessorService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DocumentProcessorService; + + /** + * Creates new DocumentProcessorService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @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 {DocumentProcessorService} RPC service. Useful where requests and/or responses are streamed. + */ + DocumentProcessorService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|processDocument}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef ProcessDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1.ProcessResponse} [response] ProcessResponse + */ + + /** + * Calls ProcessDocument. + * @function processDocument + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IProcessRequest} request ProcessRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.ProcessDocumentCallback} callback Node-style callback called with the error, if any, and ProcessResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.processDocument = function processDocument(request, callback) { + return this.rpcCall(processDocument, $root.google.cloud.documentai.v1.ProcessRequest, $root.google.cloud.documentai.v1.ProcessResponse, request, callback); + }, "name", { value: "ProcessDocument" }); + + /** + * Calls ProcessDocument. + * @function processDocument + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IProcessRequest} request ProcessRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|batchProcessDocuments}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef BatchProcessDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchProcessDocuments. + * @function batchProcessDocuments + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IBatchProcessRequest} request BatchProcessRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocumentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.batchProcessDocuments = function batchProcessDocuments(request, callback) { + return this.rpcCall(batchProcessDocuments, $root.google.cloud.documentai.v1.BatchProcessRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchProcessDocuments" }); + + /** + * Calls BatchProcessDocuments. + * @function batchProcessDocuments + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IBatchProcessRequest} request BatchProcessRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|fetchProcessorTypes}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef FetchProcessorTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1.FetchProcessorTypesResponse} [response] FetchProcessorTypesResponse + */ + + /** + * Calls FetchProcessorTypes. + * @function fetchProcessorTypes + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IFetchProcessorTypesRequest} request FetchProcessorTypesRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypesCallback} callback Node-style callback called with the error, if any, and FetchProcessorTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.fetchProcessorTypes = function fetchProcessorTypes(request, callback) { + return this.rpcCall(fetchProcessorTypes, $root.google.cloud.documentai.v1.FetchProcessorTypesRequest, $root.google.cloud.documentai.v1.FetchProcessorTypesResponse, request, callback); + }, "name", { value: "FetchProcessorTypes" }); + + /** + * Calls FetchProcessorTypes. + * @function fetchProcessorTypes + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IFetchProcessorTypesRequest} request FetchProcessorTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listProcessorTypes}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef ListProcessorTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1.ListProcessorTypesResponse} [response] ListProcessorTypesResponse + */ + + /** + * Calls ListProcessorTypes. + * @function listProcessorTypes + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IListProcessorTypesRequest} request ListProcessorTypesRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypesCallback} callback Node-style callback called with the error, if any, and ListProcessorTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.listProcessorTypes = function listProcessorTypes(request, callback) { + return this.rpcCall(listProcessorTypes, $root.google.cloud.documentai.v1.ListProcessorTypesRequest, $root.google.cloud.documentai.v1.ListProcessorTypesResponse, request, callback); + }, "name", { value: "ListProcessorTypes" }); + + /** + * Calls ListProcessorTypes. + * @function listProcessorTypes + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IListProcessorTypesRequest} request ListProcessorTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getProcessorType}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef GetProcessorTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1.ProcessorType} [response] ProcessorType + */ + + /** + * Calls GetProcessorType. + * @function getProcessorType + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IGetProcessorTypeRequest} request GetProcessorTypeRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.GetProcessorTypeCallback} callback Node-style callback called with the error, if any, and ProcessorType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.getProcessorType = function getProcessorType(request, callback) { + return this.rpcCall(getProcessorType, $root.google.cloud.documentai.v1.GetProcessorTypeRequest, $root.google.cloud.documentai.v1.ProcessorType, request, callback); + }, "name", { value: "GetProcessorType" }); + + /** + * Calls GetProcessorType. + * @function getProcessorType + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IGetProcessorTypeRequest} request GetProcessorTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listProcessors}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef ListProcessorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1.ListProcessorsResponse} [response] ListProcessorsResponse + */ + + /** + * Calls ListProcessors. + * @function listProcessors + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IListProcessorsRequest} request ListProcessorsRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.ListProcessorsCallback} callback Node-style callback called with the error, if any, and ListProcessorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.listProcessors = function listProcessors(request, callback) { + return this.rpcCall(listProcessors, $root.google.cloud.documentai.v1.ListProcessorsRequest, $root.google.cloud.documentai.v1.ListProcessorsResponse, request, callback); + }, "name", { value: "ListProcessors" }); + + /** + * Calls ListProcessors. + * @function listProcessors + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IListProcessorsRequest} request ListProcessorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getProcessor}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef GetProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1.Processor} [response] Processor + */ + + /** + * Calls GetProcessor. + * @function getProcessor + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IGetProcessorRequest} request GetProcessorRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.GetProcessorCallback} callback Node-style callback called with the error, if any, and Processor + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.getProcessor = function getProcessor(request, callback) { + return this.rpcCall(getProcessor, $root.google.cloud.documentai.v1.GetProcessorRequest, $root.google.cloud.documentai.v1.Processor, request, callback); + }, "name", { value: "GetProcessor" }); + + /** + * Calls GetProcessor. + * @function getProcessor + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IGetProcessorRequest} request GetProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|trainProcessorVersion}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef TrainProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls TrainProcessorVersion. + * @function trainProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.ITrainProcessorVersionRequest} request TrainProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.trainProcessorVersion = function trainProcessorVersion(request, callback) { + return this.rpcCall(trainProcessorVersion, $root.google.cloud.documentai.v1.TrainProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "TrainProcessorVersion" }); + + /** + * Calls TrainProcessorVersion. + * @function trainProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.ITrainProcessorVersionRequest} request TrainProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getProcessorVersion}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef GetProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1.ProcessorVersion} [response] ProcessorVersion + */ + + /** + * Calls GetProcessorVersion. + * @function getProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IGetProcessorVersionRequest} request GetProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersionCallback} callback Node-style callback called with the error, if any, and ProcessorVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.getProcessorVersion = function getProcessorVersion(request, callback) { + return this.rpcCall(getProcessorVersion, $root.google.cloud.documentai.v1.GetProcessorVersionRequest, $root.google.cloud.documentai.v1.ProcessorVersion, request, callback); + }, "name", { value: "GetProcessorVersion" }); + + /** + * Calls GetProcessorVersion. + * @function getProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IGetProcessorVersionRequest} request GetProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listProcessorVersions}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef ListProcessorVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1.ListProcessorVersionsResponse} [response] ListProcessorVersionsResponse + */ + + /** + * Calls ListProcessorVersions. + * @function listProcessorVersions + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IListProcessorVersionsRequest} request ListProcessorVersionsRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersionsCallback} callback Node-style callback called with the error, if any, and ListProcessorVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.listProcessorVersions = function listProcessorVersions(request, callback) { + return this.rpcCall(listProcessorVersions, $root.google.cloud.documentai.v1.ListProcessorVersionsRequest, $root.google.cloud.documentai.v1.ListProcessorVersionsResponse, request, callback); + }, "name", { value: "ListProcessorVersions" }); + + /** + * Calls ListProcessorVersions. + * @function listProcessorVersions + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IListProcessorVersionsRequest} request ListProcessorVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|deleteProcessorVersion}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef DeleteProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteProcessorVersion. + * @function deleteProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IDeleteProcessorVersionRequest} request DeleteProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.deleteProcessorVersion = function deleteProcessorVersion(request, callback) { + return this.rpcCall(deleteProcessorVersion, $root.google.cloud.documentai.v1.DeleteProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteProcessorVersion" }); + + /** + * Calls DeleteProcessorVersion. + * @function deleteProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IDeleteProcessorVersionRequest} request DeleteProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|deployProcessorVersion}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef DeployProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeployProcessorVersion. + * @function deployProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IDeployProcessorVersionRequest} request DeployProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.deployProcessorVersion = function deployProcessorVersion(request, callback) { + return this.rpcCall(deployProcessorVersion, $root.google.cloud.documentai.v1.DeployProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeployProcessorVersion" }); + + /** + * Calls DeployProcessorVersion. + * @function deployProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IDeployProcessorVersionRequest} request DeployProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|undeployProcessorVersion}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef UndeployProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeployProcessorVersion. + * @function undeployProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionRequest} request UndeployProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.undeployProcessorVersion = function undeployProcessorVersion(request, callback) { + return this.rpcCall(undeployProcessorVersion, $root.google.cloud.documentai.v1.UndeployProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeployProcessorVersion" }); + + /** + * Calls UndeployProcessorVersion. + * @function undeployProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionRequest} request UndeployProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|createProcessor}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef CreateProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1.Processor} [response] Processor + */ + + /** + * Calls CreateProcessor. + * @function createProcessor + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.ICreateProcessorRequest} request CreateProcessorRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.CreateProcessorCallback} callback Node-style callback called with the error, if any, and Processor + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.createProcessor = function createProcessor(request, callback) { + return this.rpcCall(createProcessor, $root.google.cloud.documentai.v1.CreateProcessorRequest, $root.google.cloud.documentai.v1.Processor, request, callback); + }, "name", { value: "CreateProcessor" }); + + /** + * Calls CreateProcessor. + * @function createProcessor + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.ICreateProcessorRequest} request CreateProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|deleteProcessor}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef DeleteProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteProcessor. + * @function deleteProcessor + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IDeleteProcessorRequest} request DeleteProcessorRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.deleteProcessor = function deleteProcessor(request, callback) { + return this.rpcCall(deleteProcessor, $root.google.cloud.documentai.v1.DeleteProcessorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteProcessor" }); + + /** + * Calls DeleteProcessor. + * @function deleteProcessor + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IDeleteProcessorRequest} request DeleteProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|enableProcessor}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef EnableProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls EnableProcessor. + * @function enableProcessor + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IEnableProcessorRequest} request EnableProcessorRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.EnableProcessorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.enableProcessor = function enableProcessor(request, callback) { + return this.rpcCall(enableProcessor, $root.google.cloud.documentai.v1.EnableProcessorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "EnableProcessor" }); + + /** + * Calls EnableProcessor. + * @function enableProcessor + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IEnableProcessorRequest} request EnableProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|disableProcessor}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef DisableProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DisableProcessor. + * @function disableProcessor + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IDisableProcessorRequest} request DisableProcessorRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.DisableProcessorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.disableProcessor = function disableProcessor(request, callback) { + return this.rpcCall(disableProcessor, $root.google.cloud.documentai.v1.DisableProcessorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DisableProcessor" }); + + /** + * Calls DisableProcessor. + * @function disableProcessor + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IDisableProcessorRequest} request DisableProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|setDefaultProcessorVersion}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef SetDefaultProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SetDefaultProcessorVersion. + * @function setDefaultProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest} request SetDefaultProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.setDefaultProcessorVersion = function setDefaultProcessorVersion(request, callback) { + return this.rpcCall(setDefaultProcessorVersion, $root.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SetDefaultProcessorVersion" }); + + /** + * Calls SetDefaultProcessorVersion. + * @function setDefaultProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest} request SetDefaultProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|reviewDocument}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef ReviewDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ReviewDocument. + * @function reviewDocument + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IReviewDocumentRequest} request ReviewDocumentRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.ReviewDocumentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.reviewDocument = function reviewDocument(request, callback) { + return this.rpcCall(reviewDocument, $root.google.cloud.documentai.v1.ReviewDocumentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ReviewDocument" }); + + /** + * Calls ReviewDocument. + * @function reviewDocument + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IReviewDocumentRequest} request ReviewDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|evaluateProcessorVersion}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef EvaluateProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls EvaluateProcessorVersion. + * @function evaluateProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionRequest} request EvaluateProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.evaluateProcessorVersion = function evaluateProcessorVersion(request, callback) { + return this.rpcCall(evaluateProcessorVersion, $root.google.cloud.documentai.v1.EvaluateProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "EvaluateProcessorVersion" }); + + /** + * Calls EvaluateProcessorVersion. + * @function evaluateProcessorVersion + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionRequest} request EvaluateProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getEvaluation}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef GetEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1.Evaluation} [response] Evaluation + */ + + /** + * Calls GetEvaluation. + * @function getEvaluation + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IGetEvaluationRequest} request GetEvaluationRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.GetEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.getEvaluation = function getEvaluation(request, callback) { + return this.rpcCall(getEvaluation, $root.google.cloud.documentai.v1.GetEvaluationRequest, $root.google.cloud.documentai.v1.Evaluation, request, callback); + }, "name", { value: "GetEvaluation" }); + + /** + * Calls GetEvaluation. + * @function getEvaluation + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IGetEvaluationRequest} request GetEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listEvaluations}. + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @typedef ListEvaluationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1.ListEvaluationsResponse} [response] ListEvaluationsResponse + */ + + /** + * Calls ListEvaluations. + * @function listEvaluations + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object + * @param {google.cloud.documentai.v1.DocumentProcessorService.ListEvaluationsCallback} callback Node-style callback called with the error, if any, and ListEvaluationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.listEvaluations = function listEvaluations(request, callback) { + return this.rpcCall(listEvaluations, $root.google.cloud.documentai.v1.ListEvaluationsRequest, $root.google.cloud.documentai.v1.ListEvaluationsResponse, request, callback); + }, "name", { value: "ListEvaluations" }); + + /** + * Calls ListEvaluations. + * @function listEvaluations + * @memberof google.cloud.documentai.v1.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DocumentProcessorService; + })(); + + v1.ProcessOptions = (function() { + + /** + * Properties of a ProcessOptions. + * @memberof google.cloud.documentai.v1 + * @interface IProcessOptions + * @property {google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector|null} [individualPageSelector] ProcessOptions individualPageSelector + * @property {number|null} [fromStart] ProcessOptions fromStart + * @property {number|null} [fromEnd] ProcessOptions fromEnd + * @property {google.cloud.documentai.v1.IOcrConfig|null} [ocrConfig] ProcessOptions ocrConfig + * @property {google.cloud.documentai.v1.ProcessOptions.ILayoutConfig|null} [layoutConfig] ProcessOptions layoutConfig + * @property {google.cloud.documentai.v1.IDocumentSchema|null} [schemaOverride] ProcessOptions schemaOverride + */ + + /** + * Constructs a new ProcessOptions. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ProcessOptions. + * @implements IProcessOptions + * @constructor + * @param {google.cloud.documentai.v1.IProcessOptions=} [properties] Properties to set + */ + function ProcessOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessOptions individualPageSelector. + * @member {google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector|null|undefined} individualPageSelector + * @memberof google.cloud.documentai.v1.ProcessOptions + * @instance + */ + ProcessOptions.prototype.individualPageSelector = null; + + /** + * ProcessOptions fromStart. + * @member {number|null|undefined} fromStart + * @memberof google.cloud.documentai.v1.ProcessOptions + * @instance + */ + ProcessOptions.prototype.fromStart = null; + + /** + * ProcessOptions fromEnd. + * @member {number|null|undefined} fromEnd + * @memberof google.cloud.documentai.v1.ProcessOptions + * @instance + */ + ProcessOptions.prototype.fromEnd = null; + + /** + * ProcessOptions ocrConfig. + * @member {google.cloud.documentai.v1.IOcrConfig|null|undefined} ocrConfig + * @memberof google.cloud.documentai.v1.ProcessOptions + * @instance + */ + ProcessOptions.prototype.ocrConfig = null; + + /** + * ProcessOptions layoutConfig. + * @member {google.cloud.documentai.v1.ProcessOptions.ILayoutConfig|null|undefined} layoutConfig + * @memberof google.cloud.documentai.v1.ProcessOptions + * @instance + */ + ProcessOptions.prototype.layoutConfig = null; + + /** + * ProcessOptions schemaOverride. + * @member {google.cloud.documentai.v1.IDocumentSchema|null|undefined} schemaOverride + * @memberof google.cloud.documentai.v1.ProcessOptions + * @instance + */ + ProcessOptions.prototype.schemaOverride = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProcessOptions pageRange. + * @member {"individualPageSelector"|"fromStart"|"fromEnd"|undefined} pageRange + * @memberof google.cloud.documentai.v1.ProcessOptions + * @instance + */ + Object.defineProperty(ProcessOptions.prototype, "pageRange", { + get: $util.oneOfGetter($oneOfFields = ["individualPageSelector", "fromStart", "fromEnd"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProcessOptions instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessOptions + * @static + * @param {google.cloud.documentai.v1.IProcessOptions=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessOptions} ProcessOptions instance + */ + ProcessOptions.create = function create(properties) { + return new ProcessOptions(properties); + }; + + /** + * Encodes the specified ProcessOptions message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessOptions + * @static + * @param {google.cloud.documentai.v1.IProcessOptions} message ProcessOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ocrConfig != null && Object.hasOwnProperty.call(message, "ocrConfig")) + $root.google.cloud.documentai.v1.OcrConfig.encode(message.ocrConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.individualPageSelector != null && Object.hasOwnProperty.call(message, "individualPageSelector")) + $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.encode(message.individualPageSelector, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fromStart != null && Object.hasOwnProperty.call(message, "fromStart")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.fromStart); + if (message.fromEnd != null && Object.hasOwnProperty.call(message, "fromEnd")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.fromEnd); + if (message.schemaOverride != null && Object.hasOwnProperty.call(message, "schemaOverride")) + $root.google.cloud.documentai.v1.DocumentSchema.encode(message.schemaOverride, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.layoutConfig != null && Object.hasOwnProperty.call(message, "layoutConfig")) + $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.encode(message.layoutConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessOptions + * @static + * @param {google.cloud.documentai.v1.IProcessOptions} message ProcessOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessOptions + * @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.ProcessOptions} ProcessOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessOptions.decode = function decode(reader, 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.ProcessOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.individualPageSelector = $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.decode(reader, reader.uint32()); + break; + } + case 6: { + message.fromStart = reader.int32(); + break; + } + case 7: { + message.fromEnd = reader.int32(); + break; + } + case 1: { + message.ocrConfig = $root.google.cloud.documentai.v1.OcrConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.layoutConfig = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.schemaOverride = $root.google.cloud.documentai.v1.DocumentSchema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessOptions} ProcessOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessOptions message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.individualPageSelector != null && message.hasOwnProperty("individualPageSelector")) { + properties.pageRange = 1; + { + var error = $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.verify(message.individualPageSelector); + if (error) + return "individualPageSelector." + error; + } + } + if (message.fromStart != null && message.hasOwnProperty("fromStart")) { + if (properties.pageRange === 1) + return "pageRange: multiple values"; + properties.pageRange = 1; + if (!$util.isInteger(message.fromStart)) + return "fromStart: integer expected"; + } + if (message.fromEnd != null && message.hasOwnProperty("fromEnd")) { + if (properties.pageRange === 1) + return "pageRange: multiple values"; + properties.pageRange = 1; + if (!$util.isInteger(message.fromEnd)) + return "fromEnd: integer expected"; + } + if (message.ocrConfig != null && message.hasOwnProperty("ocrConfig")) { + var error = $root.google.cloud.documentai.v1.OcrConfig.verify(message.ocrConfig); + if (error) + return "ocrConfig." + error; + } + if (message.layoutConfig != null && message.hasOwnProperty("layoutConfig")) { + var error = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.verify(message.layoutConfig); + if (error) + return "layoutConfig." + error; + } + if (message.schemaOverride != null && message.hasOwnProperty("schemaOverride")) { + var error = $root.google.cloud.documentai.v1.DocumentSchema.verify(message.schemaOverride); + if (error) + return "schemaOverride." + error; + } + return null; + }; + + /** + * Creates a ProcessOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessOptions} ProcessOptions + */ + ProcessOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessOptions) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessOptions(); + if (object.individualPageSelector != null) { + if (typeof object.individualPageSelector !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessOptions.individualPageSelector: object expected"); + message.individualPageSelector = $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.fromObject(object.individualPageSelector); + } + if (object.fromStart != null) + message.fromStart = object.fromStart | 0; + if (object.fromEnd != null) + message.fromEnd = object.fromEnd | 0; + if (object.ocrConfig != null) { + if (typeof object.ocrConfig !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessOptions.ocrConfig: object expected"); + message.ocrConfig = $root.google.cloud.documentai.v1.OcrConfig.fromObject(object.ocrConfig); + } + if (object.layoutConfig != null) { + if (typeof object.layoutConfig !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessOptions.layoutConfig: object expected"); + message.layoutConfig = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.fromObject(object.layoutConfig); + } + if (object.schemaOverride != null) { + if (typeof object.schemaOverride !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessOptions.schemaOverride: object expected"); + message.schemaOverride = $root.google.cloud.documentai.v1.DocumentSchema.fromObject(object.schemaOverride); + } + return message; + }; + + /** + * Creates a plain object from a ProcessOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessOptions + * @static + * @param {google.cloud.documentai.v1.ProcessOptions} message ProcessOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ocrConfig = null; + object.schemaOverride = null; + object.layoutConfig = null; + } + if (message.ocrConfig != null && message.hasOwnProperty("ocrConfig")) + object.ocrConfig = $root.google.cloud.documentai.v1.OcrConfig.toObject(message.ocrConfig, options); + if (message.individualPageSelector != null && message.hasOwnProperty("individualPageSelector")) { + object.individualPageSelector = $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.toObject(message.individualPageSelector, options); + if (options.oneofs) + object.pageRange = "individualPageSelector"; + } + if (message.fromStart != null && message.hasOwnProperty("fromStart")) { + object.fromStart = message.fromStart; + if (options.oneofs) + object.pageRange = "fromStart"; + } + if (message.fromEnd != null && message.hasOwnProperty("fromEnd")) { + object.fromEnd = message.fromEnd; + if (options.oneofs) + object.pageRange = "fromEnd"; + } + if (message.schemaOverride != null && message.hasOwnProperty("schemaOverride")) + object.schemaOverride = $root.google.cloud.documentai.v1.DocumentSchema.toObject(message.schemaOverride, options); + if (message.layoutConfig != null && message.hasOwnProperty("layoutConfig")) + object.layoutConfig = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.toObject(message.layoutConfig, options); + return object; + }; + + /** + * Converts this ProcessOptions to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessOptions + * @instance + * @returns {Object.} JSON object + */ + ProcessOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessOptions + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessOptions"; + }; + + ProcessOptions.LayoutConfig = (function() { + + /** + * Properties of a LayoutConfig. + * @memberof google.cloud.documentai.v1.ProcessOptions + * @interface ILayoutConfig + * @property {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig|null} [chunkingConfig] LayoutConfig chunkingConfig + * @property {boolean|null} [returnImages] LayoutConfig returnImages + * @property {boolean|null} [returnBoundingBoxes] LayoutConfig returnBoundingBoxes + */ + + /** + * Constructs a new LayoutConfig. + * @memberof google.cloud.documentai.v1.ProcessOptions + * @classdesc Represents a LayoutConfig. + * @implements ILayoutConfig + * @constructor + * @param {google.cloud.documentai.v1.ProcessOptions.ILayoutConfig=} [properties] Properties to set + */ + function LayoutConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LayoutConfig chunkingConfig. + * @member {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig|null|undefined} chunkingConfig + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @instance + */ + LayoutConfig.prototype.chunkingConfig = null; + + /** + * LayoutConfig returnImages. + * @member {boolean} returnImages + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @instance + */ + LayoutConfig.prototype.returnImages = false; + + /** + * LayoutConfig returnBoundingBoxes. + * @member {boolean} returnBoundingBoxes + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @instance + */ + LayoutConfig.prototype.returnBoundingBoxes = false; + + /** + * Creates a new LayoutConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @static + * @param {google.cloud.documentai.v1.ProcessOptions.ILayoutConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessOptions.LayoutConfig} LayoutConfig instance + */ + LayoutConfig.create = function create(properties) { + return new LayoutConfig(properties); + }; + + /** + * Encodes the specified LayoutConfig message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @static + * @param {google.cloud.documentai.v1.ProcessOptions.ILayoutConfig} message LayoutConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkingConfig != null && Object.hasOwnProperty.call(message, "chunkingConfig")) + $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.encode(message.chunkingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.returnImages != null && Object.hasOwnProperty.call(message, "returnImages")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.returnImages); + if (message.returnBoundingBoxes != null && Object.hasOwnProperty.call(message, "returnBoundingBoxes")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.returnBoundingBoxes); + return writer; + }; + + /** + * Encodes the specified LayoutConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @static + * @param {google.cloud.documentai.v1.ProcessOptions.ILayoutConfig} message LayoutConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LayoutConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @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.ProcessOptions.LayoutConfig} LayoutConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutConfig.decode = function decode(reader, 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.ProcessOptions.LayoutConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chunkingConfig = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.returnImages = reader.bool(); + break; + } + case 3: { + message.returnBoundingBoxes = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LayoutConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessOptions.LayoutConfig} LayoutConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LayoutConfig message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LayoutConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkingConfig != null && message.hasOwnProperty("chunkingConfig")) { + var error = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.verify(message.chunkingConfig); + if (error) + return "chunkingConfig." + error; + } + if (message.returnImages != null && message.hasOwnProperty("returnImages")) + if (typeof message.returnImages !== "boolean") + return "returnImages: boolean expected"; + if (message.returnBoundingBoxes != null && message.hasOwnProperty("returnBoundingBoxes")) + if (typeof message.returnBoundingBoxes !== "boolean") + return "returnBoundingBoxes: boolean expected"; + return null; + }; + + /** + * Creates a LayoutConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessOptions.LayoutConfig} LayoutConfig + */ + LayoutConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig(); + if (object.chunkingConfig != null) { + if (typeof object.chunkingConfig !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessOptions.LayoutConfig.chunkingConfig: object expected"); + message.chunkingConfig = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.fromObject(object.chunkingConfig); + } + if (object.returnImages != null) + message.returnImages = Boolean(object.returnImages); + if (object.returnBoundingBoxes != null) + message.returnBoundingBoxes = Boolean(object.returnBoundingBoxes); + return message; + }; + + /** + * Creates a plain object from a LayoutConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @static + * @param {google.cloud.documentai.v1.ProcessOptions.LayoutConfig} message LayoutConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LayoutConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chunkingConfig = null; + object.returnImages = false; + object.returnBoundingBoxes = false; + } + if (message.chunkingConfig != null && message.hasOwnProperty("chunkingConfig")) + object.chunkingConfig = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.toObject(message.chunkingConfig, options); + if (message.returnImages != null && message.hasOwnProperty("returnImages")) + object.returnImages = message.returnImages; + if (message.returnBoundingBoxes != null && message.hasOwnProperty("returnBoundingBoxes")) + object.returnBoundingBoxes = message.returnBoundingBoxes; + return object; + }; + + /** + * Converts this LayoutConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @instance + * @returns {Object.} JSON object + */ + LayoutConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LayoutConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LayoutConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessOptions.LayoutConfig"; + }; + + LayoutConfig.ChunkingConfig = (function() { + + /** + * Properties of a ChunkingConfig. + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @interface IChunkingConfig + * @property {number|null} [chunkSize] ChunkingConfig chunkSize + * @property {boolean|null} [includeAncestorHeadings] ChunkingConfig includeAncestorHeadings + */ + + /** + * Constructs a new ChunkingConfig. + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig + * @classdesc Represents a ChunkingConfig. + * @implements IChunkingConfig + * @constructor + * @param {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig=} [properties] Properties to set + */ + function ChunkingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChunkingConfig chunkSize. + * @member {number} chunkSize + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + * @instance + */ + ChunkingConfig.prototype.chunkSize = 0; + + /** + * ChunkingConfig includeAncestorHeadings. + * @member {boolean} includeAncestorHeadings + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + * @instance + */ + ChunkingConfig.prototype.includeAncestorHeadings = false; + + /** + * Creates a new ChunkingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig instance + */ + ChunkingConfig.create = function create(properties) { + return new ChunkingConfig(properties); + }; + + /** + * Encodes the specified ChunkingConfig message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig} message ChunkingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkSize != null && Object.hasOwnProperty.call(message, "chunkSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.chunkSize); + if (message.includeAncestorHeadings != null && Object.hasOwnProperty.call(message, "includeAncestorHeadings")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeAncestorHeadings); + return writer; + }; + + /** + * Encodes the specified ChunkingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig} message ChunkingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + * @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.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkingConfig.decode = function decode(reader, 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.ProcessOptions.LayoutConfig.ChunkingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chunkSize = reader.int32(); + break; + } + case 2: { + message.includeAncestorHeadings = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkingConfig message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) + if (!$util.isInteger(message.chunkSize)) + return "chunkSize: integer expected"; + if (message.includeAncestorHeadings != null && message.hasOwnProperty("includeAncestorHeadings")) + if (typeof message.includeAncestorHeadings !== "boolean") + return "includeAncestorHeadings: boolean expected"; + return null; + }; + + /** + * Creates a ChunkingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig + */ + ChunkingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig(); + if (object.chunkSize != null) + message.chunkSize = object.chunkSize | 0; + if (object.includeAncestorHeadings != null) + message.includeAncestorHeadings = Boolean(object.includeAncestorHeadings); + return message; + }; + + /** + * Creates a plain object from a ChunkingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig} message ChunkingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chunkSize = 0; + object.includeAncestorHeadings = false; + } + if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) + object.chunkSize = message.chunkSize; + if (message.includeAncestorHeadings != null && message.hasOwnProperty("includeAncestorHeadings")) + object.includeAncestorHeadings = message.includeAncestorHeadings; + return object; + }; + + /** + * Converts this ChunkingConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + * @instance + * @returns {Object.} JSON object + */ + ChunkingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkingConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig"; + }; + + return ChunkingConfig; + })(); + + return LayoutConfig; + })(); + + ProcessOptions.IndividualPageSelector = (function() { + + /** + * Properties of an IndividualPageSelector. + * @memberof google.cloud.documentai.v1.ProcessOptions + * @interface IIndividualPageSelector + * @property {Array.|null} [pages] IndividualPageSelector pages + */ + + /** + * Constructs a new IndividualPageSelector. + * @memberof google.cloud.documentai.v1.ProcessOptions + * @classdesc Represents an IndividualPageSelector. + * @implements IIndividualPageSelector + * @constructor + * @param {google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector=} [properties] Properties to set + */ + function IndividualPageSelector(properties) { + this.pages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndividualPageSelector pages. + * @member {Array.} pages + * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector + * @instance + */ + IndividualPageSelector.prototype.pages = $util.emptyArray; + + /** + * Creates a new IndividualPageSelector instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector + * @static + * @param {google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector} IndividualPageSelector instance + */ + IndividualPageSelector.create = function create(properties) { + return new IndividualPageSelector(properties); + }; + + /** + * Encodes the specified IndividualPageSelector message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector + * @static + * @param {google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector} message IndividualPageSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualPageSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pages != null && message.pages.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.pages.length; ++i) + writer.int32(message.pages[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified IndividualPageSelector message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector + * @static + * @param {google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector} message IndividualPageSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualPageSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndividualPageSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector + * @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.ProcessOptions.IndividualPageSelector} IndividualPageSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualPageSelector.decode = function decode(reader, 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.ProcessOptions.IndividualPageSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.pages && message.pages.length)) + message.pages = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.pages.push(reader.int32()); + } else + message.pages.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndividualPageSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector} IndividualPageSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualPageSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndividualPageSelector message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndividualPageSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) + if (!$util.isInteger(message.pages[i])) + return "pages: integer[] expected"; + } + return null; + }; + + /** + * Creates an IndividualPageSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector} IndividualPageSelector + */ + IndividualPageSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector(); + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) + message.pages[i] = object.pages[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an IndividualPageSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector + * @static + * @param {google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector} message IndividualPageSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndividualPageSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pages = []; + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = message.pages[j]; + } + return object; + }; + + /** + * Converts this IndividualPageSelector to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector + * @instance + * @returns {Object.} JSON object + */ + IndividualPageSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndividualPageSelector + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndividualPageSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector"; + }; + + return IndividualPageSelector; + })(); + + return ProcessOptions; + })(); + + v1.ProcessRequest = (function() { + + /** + * Properties of a ProcessRequest. + * @memberof google.cloud.documentai.v1 + * @interface IProcessRequest + * @property {google.cloud.documentai.v1.IDocument|null} [inlineDocument] ProcessRequest inlineDocument + * @property {google.cloud.documentai.v1.IRawDocument|null} [rawDocument] ProcessRequest rawDocument + * @property {google.cloud.documentai.v1.IGcsDocument|null} [gcsDocument] ProcessRequest gcsDocument + * @property {string|null} [name] ProcessRequest name + * @property {boolean|null} [skipHumanReview] ProcessRequest skipHumanReview + * @property {google.protobuf.IFieldMask|null} [fieldMask] ProcessRequest fieldMask + * @property {google.cloud.documentai.v1.IProcessOptions|null} [processOptions] ProcessRequest processOptions + * @property {Object.|null} [labels] ProcessRequest labels + * @property {boolean|null} [imagelessMode] ProcessRequest imagelessMode + */ + + /** + * Constructs a new ProcessRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ProcessRequest. + * @implements IProcessRequest + * @constructor + * @param {google.cloud.documentai.v1.IProcessRequest=} [properties] Properties to set + */ + function ProcessRequest(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessRequest inlineDocument. + * @member {google.cloud.documentai.v1.IDocument|null|undefined} inlineDocument + * @memberof google.cloud.documentai.v1.ProcessRequest + * @instance + */ + ProcessRequest.prototype.inlineDocument = null; + + /** + * ProcessRequest rawDocument. + * @member {google.cloud.documentai.v1.IRawDocument|null|undefined} rawDocument + * @memberof google.cloud.documentai.v1.ProcessRequest + * @instance + */ + ProcessRequest.prototype.rawDocument = null; + + /** + * ProcessRequest gcsDocument. + * @member {google.cloud.documentai.v1.IGcsDocument|null|undefined} gcsDocument + * @memberof google.cloud.documentai.v1.ProcessRequest + * @instance + */ + ProcessRequest.prototype.gcsDocument = null; + + /** + * ProcessRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1.ProcessRequest + * @instance + */ + ProcessRequest.prototype.name = ""; + + /** + * ProcessRequest skipHumanReview. + * @member {boolean} skipHumanReview + * @memberof google.cloud.documentai.v1.ProcessRequest + * @instance + */ + ProcessRequest.prototype.skipHumanReview = false; + + /** + * ProcessRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.documentai.v1.ProcessRequest + * @instance + */ + ProcessRequest.prototype.fieldMask = null; + + /** + * ProcessRequest processOptions. + * @member {google.cloud.documentai.v1.IProcessOptions|null|undefined} processOptions + * @memberof google.cloud.documentai.v1.ProcessRequest + * @instance + */ + ProcessRequest.prototype.processOptions = null; + + /** + * ProcessRequest labels. + * @member {Object.} labels + * @memberof google.cloud.documentai.v1.ProcessRequest + * @instance + */ + ProcessRequest.prototype.labels = $util.emptyObject; + + /** + * ProcessRequest imagelessMode. + * @member {boolean} imagelessMode + * @memberof google.cloud.documentai.v1.ProcessRequest + * @instance + */ + ProcessRequest.prototype.imagelessMode = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProcessRequest source. + * @member {"inlineDocument"|"rawDocument"|"gcsDocument"|undefined} source + * @memberof google.cloud.documentai.v1.ProcessRequest + * @instance + */ + Object.defineProperty(ProcessRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["inlineDocument", "rawDocument", "gcsDocument"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProcessRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessRequest + * @static + * @param {google.cloud.documentai.v1.IProcessRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessRequest} ProcessRequest instance + */ + ProcessRequest.create = function create(properties) { + return new ProcessRequest(properties); + }; + + /** + * Encodes the specified ProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1.ProcessRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessRequest + * @static + * @param {google.cloud.documentai.v1.IProcessRequest} message ProcessRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessRequest.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.skipHumanReview != null && Object.hasOwnProperty.call(message, "skipHumanReview")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skipHumanReview); + if (message.inlineDocument != null && Object.hasOwnProperty.call(message, "inlineDocument")) + $root.google.cloud.documentai.v1.Document.encode(message.inlineDocument, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rawDocument != null && Object.hasOwnProperty.call(message, "rawDocument")) + $root.google.cloud.documentai.v1.RawDocument.encode(message.rawDocument, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.processOptions != null && Object.hasOwnProperty.call(message, "processOptions")) + $root.google.cloud.documentai.v1.ProcessOptions.encode(message.processOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.gcsDocument != null && Object.hasOwnProperty.call(message, "gcsDocument")) + $root.google.cloud.documentai.v1.GcsDocument.encode(message.gcsDocument, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.imagelessMode != null && Object.hasOwnProperty.call(message, "imagelessMode")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.imagelessMode); + return writer; + }; + + /** + * Encodes the specified ProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessRequest + * @static + * @param {google.cloud.documentai.v1.IProcessRequest} message ProcessRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessRequest + * @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.ProcessRequest} ProcessRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessRequest.decode = function decode(reader, 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.ProcessRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.inlineDocument = $root.google.cloud.documentai.v1.Document.decode(reader, reader.uint32()); + break; + } + case 5: { + message.rawDocument = $root.google.cloud.documentai.v1.RawDocument.decode(reader, reader.uint32()); + break; + } + case 8: { + message.gcsDocument = $root.google.cloud.documentai.v1.GcsDocument.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.skipHumanReview = reader.bool(); + break; + } + case 6: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 7: { + message.processOptions = $root.google.cloud.documentai.v1.ProcessOptions.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 11: { + message.imagelessMode = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessRequest} ProcessRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1.Document.verify(message.inlineDocument); + if (error) + return "inlineDocument." + error; + } + } + if (message.rawDocument != null && message.hasOwnProperty("rawDocument")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1.RawDocument.verify(message.rawDocument); + if (error) + return "rawDocument." + error; + } + } + if (message.gcsDocument != null && message.hasOwnProperty("gcsDocument")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1.GcsDocument.verify(message.gcsDocument); + if (error) + return "gcsDocument." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) + if (typeof message.skipHumanReview !== "boolean") + return "skipHumanReview: boolean expected"; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.processOptions != null && message.hasOwnProperty("processOptions")) { + var error = $root.google.cloud.documentai.v1.ProcessOptions.verify(message.processOptions); + if (error) + return "processOptions." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.imagelessMode != null && message.hasOwnProperty("imagelessMode")) + if (typeof message.imagelessMode !== "boolean") + return "imagelessMode: boolean expected"; + return null; + }; + + /** + * Creates a ProcessRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessRequest} ProcessRequest + */ + ProcessRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessRequest) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessRequest(); + if (object.inlineDocument != null) { + if (typeof object.inlineDocument !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessRequest.inlineDocument: object expected"); + message.inlineDocument = $root.google.cloud.documentai.v1.Document.fromObject(object.inlineDocument); + } + if (object.rawDocument != null) { + if (typeof object.rawDocument !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessRequest.rawDocument: object expected"); + message.rawDocument = $root.google.cloud.documentai.v1.RawDocument.fromObject(object.rawDocument); + } + if (object.gcsDocument != null) { + if (typeof object.gcsDocument !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessRequest.gcsDocument: object expected"); + message.gcsDocument = $root.google.cloud.documentai.v1.GcsDocument.fromObject(object.gcsDocument); + } + if (object.name != null) + message.name = String(object.name); + if (object.skipHumanReview != null) + message.skipHumanReview = Boolean(object.skipHumanReview); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.processOptions != null) { + if (typeof object.processOptions !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessRequest.processOptions: object expected"); + message.processOptions = $root.google.cloud.documentai.v1.ProcessOptions.fromObject(object.processOptions); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.imagelessMode != null) + message.imagelessMode = Boolean(object.imagelessMode); + return message; + }; + + /** + * Creates a plain object from a ProcessRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessRequest + * @static + * @param {google.cloud.documentai.v1.ProcessRequest} message ProcessRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.skipHumanReview = false; + object.fieldMask = null; + object.processOptions = null; + object.imagelessMode = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) + object.skipHumanReview = message.skipHumanReview; + if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { + object.inlineDocument = $root.google.cloud.documentai.v1.Document.toObject(message.inlineDocument, options); + if (options.oneofs) + object.source = "inlineDocument"; + } + if (message.rawDocument != null && message.hasOwnProperty("rawDocument")) { + object.rawDocument = $root.google.cloud.documentai.v1.RawDocument.toObject(message.rawDocument, options); + if (options.oneofs) + object.source = "rawDocument"; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.processOptions != null && message.hasOwnProperty("processOptions")) + object.processOptions = $root.google.cloud.documentai.v1.ProcessOptions.toObject(message.processOptions, options); + if (message.gcsDocument != null && message.hasOwnProperty("gcsDocument")) { + object.gcsDocument = $root.google.cloud.documentai.v1.GcsDocument.toObject(message.gcsDocument, options); + if (options.oneofs) + object.source = "gcsDocument"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.imagelessMode != null && message.hasOwnProperty("imagelessMode")) + object.imagelessMode = message.imagelessMode; + return object; + }; + + /** + * Converts this ProcessRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessRequest + * @instance + * @returns {Object.} JSON object + */ + ProcessRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessRequest"; + }; + + return ProcessRequest; + })(); + + v1.HumanReviewStatus = (function() { + + /** + * Properties of a HumanReviewStatus. + * @memberof google.cloud.documentai.v1 + * @interface IHumanReviewStatus + * @property {google.cloud.documentai.v1.HumanReviewStatus.State|null} [state] HumanReviewStatus state + * @property {string|null} [stateMessage] HumanReviewStatus stateMessage + * @property {string|null} [humanReviewOperation] HumanReviewStatus humanReviewOperation + */ + + /** + * Constructs a new HumanReviewStatus. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a HumanReviewStatus. + * @implements IHumanReviewStatus + * @constructor + * @param {google.cloud.documentai.v1.IHumanReviewStatus=} [properties] Properties to set + */ + function HumanReviewStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HumanReviewStatus state. + * @member {google.cloud.documentai.v1.HumanReviewStatus.State} state + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @instance + */ + HumanReviewStatus.prototype.state = 0; + + /** + * HumanReviewStatus stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @instance + */ + HumanReviewStatus.prototype.stateMessage = ""; + + /** + * HumanReviewStatus humanReviewOperation. + * @member {string} humanReviewOperation + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @instance + */ + HumanReviewStatus.prototype.humanReviewOperation = ""; + + /** + * Creates a new HumanReviewStatus instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @static + * @param {google.cloud.documentai.v1.IHumanReviewStatus=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.HumanReviewStatus} HumanReviewStatus instance + */ + HumanReviewStatus.create = function create(properties) { + return new HumanReviewStatus(properties); + }; + + /** + * Encodes the specified HumanReviewStatus message. Does not implicitly {@link google.cloud.documentai.v1.HumanReviewStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @static + * @param {google.cloud.documentai.v1.IHumanReviewStatus} message HumanReviewStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanReviewStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); + if (message.humanReviewOperation != null && Object.hasOwnProperty.call(message, "humanReviewOperation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.humanReviewOperation); + return writer; + }; + + /** + * Encodes the specified HumanReviewStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.HumanReviewStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @static + * @param {google.cloud.documentai.v1.IHumanReviewStatus} message HumanReviewStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanReviewStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HumanReviewStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @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.HumanReviewStatus} HumanReviewStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HumanReviewStatus.decode = function decode(reader, 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.HumanReviewStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.stateMessage = reader.string(); + break; + } + case 3: { + message.humanReviewOperation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HumanReviewStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.HumanReviewStatus} HumanReviewStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HumanReviewStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HumanReviewStatus message. + * @function verify + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HumanReviewStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) + if (!$util.isString(message.humanReviewOperation)) + return "humanReviewOperation: string expected"; + return null; + }; + + /** + * Creates a HumanReviewStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.HumanReviewStatus} HumanReviewStatus + */ + HumanReviewStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.HumanReviewStatus) + return object; + var message = new $root.google.cloud.documentai.v1.HumanReviewStatus(); + 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 "SKIPPED": + case 1: + message.state = 1; + break; + case "VALIDATION_PASSED": + case 2: + message.state = 2; + break; + case "IN_PROGRESS": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.humanReviewOperation != null) + message.humanReviewOperation = String(object.humanReviewOperation); + return message; + }; + + /** + * Creates a plain object from a HumanReviewStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @static + * @param {google.cloud.documentai.v1.HumanReviewStatus} message HumanReviewStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HumanReviewStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.humanReviewOperation = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1.HumanReviewStatus.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.HumanReviewStatus.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) + object.humanReviewOperation = message.humanReviewOperation; + return object; + }; + + /** + * Converts this HumanReviewStatus to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @instance + * @returns {Object.} JSON object + */ + HumanReviewStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HumanReviewStatus + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.HumanReviewStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HumanReviewStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.HumanReviewStatus"; + }; + + /** + * State enum. + * @name google.cloud.documentai.v1.HumanReviewStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} SKIPPED=1 SKIPPED value + * @property {number} VALIDATION_PASSED=2 VALIDATION_PASSED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + * @property {number} ERROR=4 ERROR value + */ + HumanReviewStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SKIPPED"] = 1; + values[valuesById[2] = "VALIDATION_PASSED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); + + return HumanReviewStatus; + })(); + + v1.ProcessResponse = (function() { + + /** + * Properties of a ProcessResponse. + * @memberof google.cloud.documentai.v1 + * @interface IProcessResponse + * @property {google.cloud.documentai.v1.IDocument|null} [document] ProcessResponse document + * @property {google.cloud.documentai.v1.IHumanReviewStatus|null} [humanReviewStatus] ProcessResponse humanReviewStatus + */ + + /** + * Constructs a new ProcessResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ProcessResponse. + * @implements IProcessResponse + * @constructor + * @param {google.cloud.documentai.v1.IProcessResponse=} [properties] Properties to set + */ + function ProcessResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessResponse document. + * @member {google.cloud.documentai.v1.IDocument|null|undefined} document + * @memberof google.cloud.documentai.v1.ProcessResponse + * @instance + */ + ProcessResponse.prototype.document = null; + + /** + * ProcessResponse humanReviewStatus. + * @member {google.cloud.documentai.v1.IHumanReviewStatus|null|undefined} humanReviewStatus + * @memberof google.cloud.documentai.v1.ProcessResponse + * @instance + */ + ProcessResponse.prototype.humanReviewStatus = null; + + /** + * Creates a new ProcessResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessResponse + * @static + * @param {google.cloud.documentai.v1.IProcessResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessResponse} ProcessResponse instance + */ + ProcessResponse.create = function create(properties) { + return new ProcessResponse(properties); + }; + + /** + * Encodes the specified ProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1.ProcessResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessResponse + * @static + * @param {google.cloud.documentai.v1.IProcessResponse} message ProcessResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.documentai.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.humanReviewStatus != null && Object.hasOwnProperty.call(message, "humanReviewStatus")) + $root.google.cloud.documentai.v1.HumanReviewStatus.encode(message.humanReviewStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessResponse + * @static + * @param {google.cloud.documentai.v1.IProcessResponse} message ProcessResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessResponse + * @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.ProcessResponse} ProcessResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessResponse.decode = function decode(reader, 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.ProcessResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.documentai.v1.Document.decode(reader, reader.uint32()); + break; + } + case 3: { + message.humanReviewStatus = $root.google.cloud.documentai.v1.HumanReviewStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessResponse} ProcessResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessResponse.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.documentai.v1.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) { + var error = $root.google.cloud.documentai.v1.HumanReviewStatus.verify(message.humanReviewStatus); + if (error) + return "humanReviewStatus." + error; + } + return null; + }; + + /** + * Creates a ProcessResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessResponse} ProcessResponse + */ + ProcessResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessResponse) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessResponse(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessResponse.document: object expected"); + message.document = $root.google.cloud.documentai.v1.Document.fromObject(object.document); + } + if (object.humanReviewStatus != null) { + if (typeof object.humanReviewStatus !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessResponse.humanReviewStatus: object expected"); + message.humanReviewStatus = $root.google.cloud.documentai.v1.HumanReviewStatus.fromObject(object.humanReviewStatus); + } + return message; + }; + + /** + * Creates a plain object from a ProcessResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessResponse + * @static + * @param {google.cloud.documentai.v1.ProcessResponse} message ProcessResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.humanReviewStatus = null; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.documentai.v1.Document.toObject(message.document, options); + if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) + object.humanReviewStatus = $root.google.cloud.documentai.v1.HumanReviewStatus.toObject(message.humanReviewStatus, options); + return object; + }; + + /** + * Converts this ProcessResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessResponse + * @instance + * @returns {Object.} JSON object + */ + ProcessResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessResponse"; + }; + + return ProcessResponse; + })(); + + v1.BatchProcessRequest = (function() { + + /** + * Properties of a BatchProcessRequest. + * @memberof google.cloud.documentai.v1 + * @interface IBatchProcessRequest + * @property {string|null} [name] BatchProcessRequest name + * @property {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null} [inputDocuments] BatchProcessRequest inputDocuments + * @property {google.cloud.documentai.v1.IDocumentOutputConfig|null} [documentOutputConfig] BatchProcessRequest documentOutputConfig + * @property {boolean|null} [skipHumanReview] BatchProcessRequest skipHumanReview + * @property {google.cloud.documentai.v1.IProcessOptions|null} [processOptions] BatchProcessRequest processOptions + * @property {Object.|null} [labels] BatchProcessRequest labels + */ + + /** + * Constructs a new BatchProcessRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a BatchProcessRequest. + * @implements IBatchProcessRequest + * @constructor + * @param {google.cloud.documentai.v1.IBatchProcessRequest=} [properties] Properties to set + */ + function BatchProcessRequest(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchProcessRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.name = ""; + + /** + * BatchProcessRequest inputDocuments. + * @member {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null|undefined} inputDocuments + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.inputDocuments = null; + + /** + * BatchProcessRequest documentOutputConfig. + * @member {google.cloud.documentai.v1.IDocumentOutputConfig|null|undefined} documentOutputConfig + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.documentOutputConfig = null; + + /** + * BatchProcessRequest skipHumanReview. + * @member {boolean} skipHumanReview + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.skipHumanReview = false; + + /** + * BatchProcessRequest processOptions. + * @member {google.cloud.documentai.v1.IProcessOptions|null|undefined} processOptions + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.processOptions = null; + + /** + * BatchProcessRequest labels. + * @member {Object.} labels + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new BatchProcessRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @static + * @param {google.cloud.documentai.v1.IBatchProcessRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.BatchProcessRequest} BatchProcessRequest instance + */ + BatchProcessRequest.create = function create(properties) { + return new BatchProcessRequest(properties); + }; + + /** + * Encodes the specified BatchProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @static + * @param {google.cloud.documentai.v1.IBatchProcessRequest} message BatchProcessRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProcessRequest.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.skipHumanReview != null && Object.hasOwnProperty.call(message, "skipHumanReview")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipHumanReview); + if (message.inputDocuments != null && Object.hasOwnProperty.call(message, "inputDocuments")) + $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.encode(message.inputDocuments, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.documentOutputConfig != null && Object.hasOwnProperty.call(message, "documentOutputConfig")) + $root.google.cloud.documentai.v1.DocumentOutputConfig.encode(message.documentOutputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.processOptions != null && Object.hasOwnProperty.call(message, "processOptions")) + $root.google.cloud.documentai.v1.ProcessOptions.encode(message.processOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @static + * @param {google.cloud.documentai.v1.IBatchProcessRequest} message BatchProcessRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProcessRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchProcessRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @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.BatchProcessRequest} BatchProcessRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProcessRequest.decode = function decode(reader, 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.BatchProcessRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 5: { + message.inputDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.documentOutputConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.skipHumanReview = reader.bool(); + break; + } + case 7: { + message.processOptions = $root.google.cloud.documentai.v1.ProcessOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchProcessRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.BatchProcessRequest} BatchProcessRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProcessRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchProcessRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchProcessRequest.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.inputDocuments != null && message.hasOwnProperty("inputDocuments")) { + var error = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.verify(message.inputDocuments); + if (error) + return "inputDocuments." + error; + } + if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) { + var error = $root.google.cloud.documentai.v1.DocumentOutputConfig.verify(message.documentOutputConfig); + if (error) + return "documentOutputConfig." + error; + } + if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) + if (typeof message.skipHumanReview !== "boolean") + return "skipHumanReview: boolean expected"; + if (message.processOptions != null && message.hasOwnProperty("processOptions")) { + var error = $root.google.cloud.documentai.v1.ProcessOptions.verify(message.processOptions); + if (error) + return "processOptions." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchProcessRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.BatchProcessRequest} BatchProcessRequest + */ + BatchProcessRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.BatchProcessRequest) + return object; + var message = new $root.google.cloud.documentai.v1.BatchProcessRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputDocuments != null) { + if (typeof object.inputDocuments !== "object") + throw TypeError(".google.cloud.documentai.v1.BatchProcessRequest.inputDocuments: object expected"); + message.inputDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.fromObject(object.inputDocuments); + } + if (object.documentOutputConfig != null) { + if (typeof object.documentOutputConfig !== "object") + throw TypeError(".google.cloud.documentai.v1.BatchProcessRequest.documentOutputConfig: object expected"); + message.documentOutputConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.fromObject(object.documentOutputConfig); + } + if (object.skipHumanReview != null) + message.skipHumanReview = Boolean(object.skipHumanReview); + if (object.processOptions != null) { + if (typeof object.processOptions !== "object") + throw TypeError(".google.cloud.documentai.v1.BatchProcessRequest.processOptions: object expected"); + message.processOptions = $root.google.cloud.documentai.v1.ProcessOptions.fromObject(object.processOptions); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.documentai.v1.BatchProcessRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchProcessRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @static + * @param {google.cloud.documentai.v1.BatchProcessRequest} message BatchProcessRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchProcessRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.skipHumanReview = false; + object.inputDocuments = null; + object.documentOutputConfig = null; + object.processOptions = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) + object.skipHumanReview = message.skipHumanReview; + if (message.inputDocuments != null && message.hasOwnProperty("inputDocuments")) + object.inputDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.toObject(message.inputDocuments, options); + if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) + object.documentOutputConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.toObject(message.documentOutputConfig, options); + if (message.processOptions != null && message.hasOwnProperty("processOptions")) + object.processOptions = $root.google.cloud.documentai.v1.ProcessOptions.toObject(message.processOptions, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchProcessRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @instance + * @returns {Object.} JSON object + */ + BatchProcessRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchProcessRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.BatchProcessRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchProcessRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.BatchProcessRequest"; + }; + + return BatchProcessRequest; + })(); + + v1.BatchProcessResponse = (function() { + + /** + * Properties of a BatchProcessResponse. + * @memberof google.cloud.documentai.v1 + * @interface IBatchProcessResponse + */ + + /** + * Constructs a new BatchProcessResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a BatchProcessResponse. + * @implements IBatchProcessResponse + * @constructor + * @param {google.cloud.documentai.v1.IBatchProcessResponse=} [properties] Properties to set + */ + function BatchProcessResponse(properties) { + if (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 BatchProcessResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.BatchProcessResponse + * @static + * @param {google.cloud.documentai.v1.IBatchProcessResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.BatchProcessResponse} BatchProcessResponse instance + */ + BatchProcessResponse.create = function create(properties) { + return new BatchProcessResponse(properties); + }; + + /** + * Encodes the specified BatchProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.BatchProcessResponse + * @static + * @param {google.cloud.documentai.v1.IBatchProcessResponse} message BatchProcessResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProcessResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BatchProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.BatchProcessResponse + * @static + * @param {google.cloud.documentai.v1.IBatchProcessResponse} message BatchProcessResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProcessResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchProcessResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.BatchProcessResponse + * @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.BatchProcessResponse} BatchProcessResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProcessResponse.decode = function decode(reader, 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.BatchProcessResponse(); + 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 BatchProcessResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.BatchProcessResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.BatchProcessResponse} BatchProcessResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProcessResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchProcessResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.BatchProcessResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchProcessResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BatchProcessResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.BatchProcessResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.BatchProcessResponse} BatchProcessResponse + */ + BatchProcessResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.BatchProcessResponse) + return object; + return new $root.google.cloud.documentai.v1.BatchProcessResponse(); + }; + + /** + * Creates a plain object from a BatchProcessResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.BatchProcessResponse + * @static + * @param {google.cloud.documentai.v1.BatchProcessResponse} message BatchProcessResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchProcessResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BatchProcessResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.BatchProcessResponse + * @instance + * @returns {Object.} JSON object + */ + BatchProcessResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchProcessResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.BatchProcessResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchProcessResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.BatchProcessResponse"; + }; + + return BatchProcessResponse; + })(); + + v1.BatchProcessMetadata = (function() { + + /** + * Properties of a BatchProcessMetadata. + * @memberof google.cloud.documentai.v1 + * @interface IBatchProcessMetadata + * @property {google.cloud.documentai.v1.BatchProcessMetadata.State|null} [state] BatchProcessMetadata state + * @property {string|null} [stateMessage] BatchProcessMetadata stateMessage + * @property {google.protobuf.ITimestamp|null} [createTime] BatchProcessMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BatchProcessMetadata updateTime + * @property {Array.|null} [individualProcessStatuses] BatchProcessMetadata individualProcessStatuses + */ + + /** + * Constructs a new BatchProcessMetadata. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a BatchProcessMetadata. + * @implements IBatchProcessMetadata + * @constructor + * @param {google.cloud.documentai.v1.IBatchProcessMetadata=} [properties] Properties to set + */ + function BatchProcessMetadata(properties) { + this.individualProcessStatuses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchProcessMetadata state. + * @member {google.cloud.documentai.v1.BatchProcessMetadata.State} state + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @instance + */ + BatchProcessMetadata.prototype.state = 0; + + /** + * BatchProcessMetadata stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @instance + */ + BatchProcessMetadata.prototype.stateMessage = ""; + + /** + * BatchProcessMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @instance + */ + BatchProcessMetadata.prototype.createTime = null; + + /** + * BatchProcessMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @instance + */ + BatchProcessMetadata.prototype.updateTime = null; + + /** + * BatchProcessMetadata individualProcessStatuses. + * @member {Array.} individualProcessStatuses + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @instance + */ + BatchProcessMetadata.prototype.individualProcessStatuses = $util.emptyArray; + + /** + * Creates a new BatchProcessMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @static + * @param {google.cloud.documentai.v1.IBatchProcessMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.BatchProcessMetadata} BatchProcessMetadata instance + */ + BatchProcessMetadata.create = function create(properties) { + return new BatchProcessMetadata(properties); + }; + + /** + * Encodes the specified BatchProcessMetadata message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @static + * @param {google.cloud.documentai.v1.IBatchProcessMetadata} message BatchProcessMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProcessMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); + 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.individualProcessStatuses != null && message.individualProcessStatuses.length) + for (var i = 0; i < message.individualProcessStatuses.length; ++i) + $root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.encode(message.individualProcessStatuses[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchProcessMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @static + * @param {google.cloud.documentai.v1.IBatchProcessMetadata} message BatchProcessMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProcessMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchProcessMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @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.BatchProcessMetadata} BatchProcessMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProcessMetadata.decode = function decode(reader, 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.BatchProcessMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.stateMessage = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.individualProcessStatuses && message.individualProcessStatuses.length)) + message.individualProcessStatuses = []; + message.individualProcessStatuses.push($root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchProcessMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.BatchProcessMetadata} BatchProcessMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProcessMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchProcessMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchProcessMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.individualProcessStatuses != null && message.hasOwnProperty("individualProcessStatuses")) { + if (!Array.isArray(message.individualProcessStatuses)) + return "individualProcessStatuses: array expected"; + for (var i = 0; i < message.individualProcessStatuses.length; ++i) { + var error = $root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.verify(message.individualProcessStatuses[i]); + if (error) + return "individualProcessStatuses." + error; + } + } + return null; + }; + + /** + * Creates a BatchProcessMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.BatchProcessMetadata} BatchProcessMetadata + */ + BatchProcessMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.BatchProcessMetadata) + return object; + var message = new $root.google.cloud.documentai.v1.BatchProcessMetadata(); + 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 "WAITING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.documentai.v1.BatchProcessMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.documentai.v1.BatchProcessMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.individualProcessStatuses) { + if (!Array.isArray(object.individualProcessStatuses)) + throw TypeError(".google.cloud.documentai.v1.BatchProcessMetadata.individualProcessStatuses: array expected"); + message.individualProcessStatuses = []; + for (var i = 0; i < object.individualProcessStatuses.length; ++i) { + if (typeof object.individualProcessStatuses[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.BatchProcessMetadata.individualProcessStatuses: object expected"); + message.individualProcessStatuses[i] = $root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.fromObject(object.individualProcessStatuses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchProcessMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @static + * @param {google.cloud.documentai.v1.BatchProcessMetadata} message BatchProcessMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchProcessMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.individualProcessStatuses = []; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1.BatchProcessMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.BatchProcessMetadata.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.individualProcessStatuses && message.individualProcessStatuses.length) { + object.individualProcessStatuses = []; + for (var j = 0; j < message.individualProcessStatuses.length; ++j) + object.individualProcessStatuses[j] = $root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.toObject(message.individualProcessStatuses[j], options); + } + return object; + }; + + /** + * Converts this BatchProcessMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchProcessMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchProcessMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchProcessMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.BatchProcessMetadata"; + }; + + BatchProcessMetadata.IndividualProcessStatus = (function() { + + /** + * Properties of an IndividualProcessStatus. + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @interface IIndividualProcessStatus + * @property {string|null} [inputGcsSource] IndividualProcessStatus inputGcsSource + * @property {google.rpc.IStatus|null} [status] IndividualProcessStatus status + * @property {string|null} [outputGcsDestination] IndividualProcessStatus outputGcsDestination + * @property {google.cloud.documentai.v1.IHumanReviewStatus|null} [humanReviewStatus] IndividualProcessStatus humanReviewStatus + */ + + /** + * Constructs a new IndividualProcessStatus. + * @memberof google.cloud.documentai.v1.BatchProcessMetadata + * @classdesc Represents an IndividualProcessStatus. + * @implements IIndividualProcessStatus + * @constructor + * @param {google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus=} [properties] Properties to set + */ + function IndividualProcessStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndividualProcessStatus inputGcsSource. + * @member {string} inputGcsSource + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @instance + */ + IndividualProcessStatus.prototype.inputGcsSource = ""; + + /** + * IndividualProcessStatus status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @instance + */ + IndividualProcessStatus.prototype.status = null; + + /** + * IndividualProcessStatus outputGcsDestination. + * @member {string} outputGcsDestination + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @instance + */ + IndividualProcessStatus.prototype.outputGcsDestination = ""; + + /** + * IndividualProcessStatus humanReviewStatus. + * @member {google.cloud.documentai.v1.IHumanReviewStatus|null|undefined} humanReviewStatus + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @instance + */ + IndividualProcessStatus.prototype.humanReviewStatus = null; + + /** + * Creates a new IndividualProcessStatus instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus instance + */ + IndividualProcessStatus.create = function create(properties) { + return new IndividualProcessStatus(properties); + }; + + /** + * Encodes the specified IndividualProcessStatus message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus} message IndividualProcessStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualProcessStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputGcsSource != null && Object.hasOwnProperty.call(message, "inputGcsSource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputGcsSource); + 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(); + if (message.outputGcsDestination != null && Object.hasOwnProperty.call(message, "outputGcsDestination")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputGcsDestination); + if (message.humanReviewStatus != null && Object.hasOwnProperty.call(message, "humanReviewStatus")) + $root.google.cloud.documentai.v1.HumanReviewStatus.encode(message.humanReviewStatus, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IndividualProcessStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus} message IndividualProcessStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualProcessStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndividualProcessStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @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.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualProcessStatus.decode = function decode(reader, 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.BatchProcessMetadata.IndividualProcessStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputGcsSource = reader.string(); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.outputGcsDestination = reader.string(); + break; + } + case 5: { + message.humanReviewStatus = $root.google.cloud.documentai.v1.HumanReviewStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndividualProcessStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualProcessStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndividualProcessStatus message. + * @function verify + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndividualProcessStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) + if (!$util.isString(message.inputGcsSource)) + return "inputGcsSource: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.outputGcsDestination != null && message.hasOwnProperty("outputGcsDestination")) + if (!$util.isString(message.outputGcsDestination)) + return "outputGcsDestination: string expected"; + if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) { + var error = $root.google.cloud.documentai.v1.HumanReviewStatus.verify(message.humanReviewStatus); + if (error) + return "humanReviewStatus." + error; + } + return null; + }; + + /** + * Creates an IndividualProcessStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus + */ + IndividualProcessStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus) + return object; + var message = new $root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus(); + if (object.inputGcsSource != null) + message.inputGcsSource = String(object.inputGcsSource); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.outputGcsDestination != null) + message.outputGcsDestination = String(object.outputGcsDestination); + if (object.humanReviewStatus != null) { + if (typeof object.humanReviewStatus !== "object") + throw TypeError(".google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.humanReviewStatus: object expected"); + message.humanReviewStatus = $root.google.cloud.documentai.v1.HumanReviewStatus.fromObject(object.humanReviewStatus); + } + return message; + }; + + /** + * Creates a plain object from an IndividualProcessStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus} message IndividualProcessStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndividualProcessStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputGcsSource = ""; + object.status = null; + object.outputGcsDestination = ""; + object.humanReviewStatus = null; + } + if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) + object.inputGcsSource = message.inputGcsSource; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.outputGcsDestination != null && message.hasOwnProperty("outputGcsDestination")) + object.outputGcsDestination = message.outputGcsDestination; + if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) + object.humanReviewStatus = $root.google.cloud.documentai.v1.HumanReviewStatus.toObject(message.humanReviewStatus, options); + return object; + }; + + /** + * Converts this IndividualProcessStatus to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @instance + * @returns {Object.} JSON object + */ + IndividualProcessStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndividualProcessStatus + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndividualProcessStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus"; + }; + + return IndividualProcessStatus; + })(); + + /** + * State enum. + * @name google.cloud.documentai.v1.BatchProcessMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} WAITING=1 WAITING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + * @property {number} FAILED=6 FAILED value + */ + BatchProcessMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "WAITING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + values[valuesById[6] = "FAILED"] = 6; + return values; + })(); + + return BatchProcessMetadata; + })(); + + v1.FetchProcessorTypesRequest = (function() { + + /** + * Properties of a FetchProcessorTypesRequest. + * @memberof google.cloud.documentai.v1 + * @interface IFetchProcessorTypesRequest + * @property {string|null} [parent] FetchProcessorTypesRequest parent + */ + + /** + * Constructs a new FetchProcessorTypesRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a FetchProcessorTypesRequest. + * @implements IFetchProcessorTypesRequest + * @constructor + * @param {google.cloud.documentai.v1.IFetchProcessorTypesRequest=} [properties] Properties to set + */ + function FetchProcessorTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchProcessorTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest + * @instance + */ + FetchProcessorTypesRequest.prototype.parent = ""; + + /** + * Creates a new FetchProcessorTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1.IFetchProcessorTypesRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.FetchProcessorTypesRequest} FetchProcessorTypesRequest instance + */ + FetchProcessorTypesRequest.create = function create(properties) { + return new FetchProcessorTypesRequest(properties); + }; + + /** + * Encodes the specified FetchProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1.IFetchProcessorTypesRequest} message FetchProcessorTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchProcessorTypesRequest.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); + return writer; + }; + + /** + * Encodes the specified FetchProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1.IFetchProcessorTypesRequest} message FetchProcessorTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchProcessorTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest + * @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.FetchProcessorTypesRequest} FetchProcessorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchProcessorTypesRequest.decode = function decode(reader, 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.FetchProcessorTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.FetchProcessorTypesRequest} FetchProcessorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchProcessorTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchProcessorTypesRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchProcessorTypesRequest.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"; + return null; + }; + + /** + * Creates a FetchProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.FetchProcessorTypesRequest} FetchProcessorTypesRequest + */ + FetchProcessorTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.FetchProcessorTypesRequest) + return object; + var message = new $root.google.cloud.documentai.v1.FetchProcessorTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a FetchProcessorTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1.FetchProcessorTypesRequest} message FetchProcessorTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchProcessorTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this FetchProcessorTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest + * @instance + * @returns {Object.} JSON object + */ + FetchProcessorTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchProcessorTypesRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchProcessorTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.FetchProcessorTypesRequest"; + }; + + return FetchProcessorTypesRequest; + })(); + + v1.FetchProcessorTypesResponse = (function() { + + /** + * Properties of a FetchProcessorTypesResponse. + * @memberof google.cloud.documentai.v1 + * @interface IFetchProcessorTypesResponse + * @property {Array.|null} [processorTypes] FetchProcessorTypesResponse processorTypes + */ + + /** + * Constructs a new FetchProcessorTypesResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a FetchProcessorTypesResponse. + * @implements IFetchProcessorTypesResponse + * @constructor + * @param {google.cloud.documentai.v1.IFetchProcessorTypesResponse=} [properties] Properties to set + */ + function FetchProcessorTypesResponse(properties) { + this.processorTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchProcessorTypesResponse processorTypes. + * @member {Array.} processorTypes + * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse + * @instance + */ + FetchProcessorTypesResponse.prototype.processorTypes = $util.emptyArray; + + /** + * Creates a new FetchProcessorTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1.IFetchProcessorTypesResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.FetchProcessorTypesResponse} FetchProcessorTypesResponse instance + */ + FetchProcessorTypesResponse.create = function create(properties) { + return new FetchProcessorTypesResponse(properties); + }; + + /** + * Encodes the specified FetchProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1.IFetchProcessorTypesResponse} message FetchProcessorTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchProcessorTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorTypes != null && message.processorTypes.length) + for (var i = 0; i < message.processorTypes.length; ++i) + $root.google.cloud.documentai.v1.ProcessorType.encode(message.processorTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FetchProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1.IFetchProcessorTypesResponse} message FetchProcessorTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchProcessorTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse + * @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.FetchProcessorTypesResponse} FetchProcessorTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchProcessorTypesResponse.decode = function decode(reader, 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.FetchProcessorTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.processorTypes && message.processorTypes.length)) + message.processorTypes = []; + message.processorTypes.push($root.google.cloud.documentai.v1.ProcessorType.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.FetchProcessorTypesResponse} FetchProcessorTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchProcessorTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchProcessorTypesResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchProcessorTypesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorTypes != null && message.hasOwnProperty("processorTypes")) { + if (!Array.isArray(message.processorTypes)) + return "processorTypes: array expected"; + for (var i = 0; i < message.processorTypes.length; ++i) { + var error = $root.google.cloud.documentai.v1.ProcessorType.verify(message.processorTypes[i]); + if (error) + return "processorTypes." + error; + } + } + return null; + }; + + /** + * Creates a FetchProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.FetchProcessorTypesResponse} FetchProcessorTypesResponse + */ + FetchProcessorTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.FetchProcessorTypesResponse) + return object; + var message = new $root.google.cloud.documentai.v1.FetchProcessorTypesResponse(); + if (object.processorTypes) { + if (!Array.isArray(object.processorTypes)) + throw TypeError(".google.cloud.documentai.v1.FetchProcessorTypesResponse.processorTypes: array expected"); + message.processorTypes = []; + for (var i = 0; i < object.processorTypes.length; ++i) { + if (typeof object.processorTypes[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.FetchProcessorTypesResponse.processorTypes: object expected"); + message.processorTypes[i] = $root.google.cloud.documentai.v1.ProcessorType.fromObject(object.processorTypes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FetchProcessorTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1.FetchProcessorTypesResponse} message FetchProcessorTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchProcessorTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.processorTypes = []; + if (message.processorTypes && message.processorTypes.length) { + object.processorTypes = []; + for (var j = 0; j < message.processorTypes.length; ++j) + object.processorTypes[j] = $root.google.cloud.documentai.v1.ProcessorType.toObject(message.processorTypes[j], options); + } + return object; + }; + + /** + * Converts this FetchProcessorTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse + * @instance + * @returns {Object.} JSON object + */ + FetchProcessorTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchProcessorTypesResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchProcessorTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.FetchProcessorTypesResponse"; + }; + + return FetchProcessorTypesResponse; + })(); + + v1.ListProcessorTypesRequest = (function() { + + /** + * Properties of a ListProcessorTypesRequest. + * @memberof google.cloud.documentai.v1 + * @interface IListProcessorTypesRequest + * @property {string|null} [parent] ListProcessorTypesRequest parent + * @property {number|null} [pageSize] ListProcessorTypesRequest pageSize + * @property {string|null} [pageToken] ListProcessorTypesRequest pageToken + */ + + /** + * Constructs a new ListProcessorTypesRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ListProcessorTypesRequest. + * @implements IListProcessorTypesRequest + * @constructor + * @param {google.cloud.documentai.v1.IListProcessorTypesRequest=} [properties] Properties to set + */ + function ListProcessorTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @instance + */ + ListProcessorTypesRequest.prototype.parent = ""; + + /** + * ListProcessorTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @instance + */ + ListProcessorTypesRequest.prototype.pageSize = 0; + + /** + * ListProcessorTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @instance + */ + ListProcessorTypesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProcessorTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1.IListProcessorTypesRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ListProcessorTypesRequest} ListProcessorTypesRequest instance + */ + ListProcessorTypesRequest.create = function create(properties) { + return new ListProcessorTypesRequest(properties); + }; + + /** + * Encodes the specified ListProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1.IListProcessorTypesRequest} message ListProcessorTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorTypesRequest.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 ListProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1.IListProcessorTypesRequest} message ListProcessorTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @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.ListProcessorTypesRequest} ListProcessorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorTypesRequest.decode = function decode(reader, 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.ListProcessorTypesRequest(); + 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 ListProcessorTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ListProcessorTypesRequest} ListProcessorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorTypesRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorTypesRequest.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 ListProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ListProcessorTypesRequest} ListProcessorTypesRequest + */ + ListProcessorTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ListProcessorTypesRequest) + return object; + var message = new $root.google.cloud.documentai.v1.ListProcessorTypesRequest(); + 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 ListProcessorTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1.ListProcessorTypesRequest} message ListProcessorTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorTypesRequest.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 ListProcessorTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListProcessorTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorTypesRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ListProcessorTypesRequest"; + }; + + return ListProcessorTypesRequest; + })(); + + v1.ListProcessorTypesResponse = (function() { + + /** + * Properties of a ListProcessorTypesResponse. + * @memberof google.cloud.documentai.v1 + * @interface IListProcessorTypesResponse + * @property {Array.|null} [processorTypes] ListProcessorTypesResponse processorTypes + * @property {string|null} [nextPageToken] ListProcessorTypesResponse nextPageToken + */ + + /** + * Constructs a new ListProcessorTypesResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ListProcessorTypesResponse. + * @implements IListProcessorTypesResponse + * @constructor + * @param {google.cloud.documentai.v1.IListProcessorTypesResponse=} [properties] Properties to set + */ + function ListProcessorTypesResponse(properties) { + this.processorTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorTypesResponse processorTypes. + * @member {Array.} processorTypes + * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse + * @instance + */ + ListProcessorTypesResponse.prototype.processorTypes = $util.emptyArray; + + /** + * ListProcessorTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse + * @instance + */ + ListProcessorTypesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProcessorTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1.IListProcessorTypesResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ListProcessorTypesResponse} ListProcessorTypesResponse instance + */ + ListProcessorTypesResponse.create = function create(properties) { + return new ListProcessorTypesResponse(properties); + }; + + /** + * Encodes the specified ListProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1.IListProcessorTypesResponse} message ListProcessorTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorTypes != null && message.processorTypes.length) + for (var i = 0; i < message.processorTypes.length; ++i) + $root.google.cloud.documentai.v1.ProcessorType.encode(message.processorTypes[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 ListProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1.IListProcessorTypesResponse} message ListProcessorTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse + * @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.ListProcessorTypesResponse} ListProcessorTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorTypesResponse.decode = function decode(reader, 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.ListProcessorTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.processorTypes && message.processorTypes.length)) + message.processorTypes = []; + message.processorTypes.push($root.google.cloud.documentai.v1.ProcessorType.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProcessorTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ListProcessorTypesResponse} ListProcessorTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorTypesResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorTypesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorTypes != null && message.hasOwnProperty("processorTypes")) { + if (!Array.isArray(message.processorTypes)) + return "processorTypes: array expected"; + for (var i = 0; i < message.processorTypes.length; ++i) { + var error = $root.google.cloud.documentai.v1.ProcessorType.verify(message.processorTypes[i]); + if (error) + return "processorTypes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ListProcessorTypesResponse} ListProcessorTypesResponse + */ + ListProcessorTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ListProcessorTypesResponse) + return object; + var message = new $root.google.cloud.documentai.v1.ListProcessorTypesResponse(); + if (object.processorTypes) { + if (!Array.isArray(object.processorTypes)) + throw TypeError(".google.cloud.documentai.v1.ListProcessorTypesResponse.processorTypes: array expected"); + message.processorTypes = []; + for (var i = 0; i < object.processorTypes.length; ++i) { + if (typeof object.processorTypes[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.ListProcessorTypesResponse.processorTypes: object expected"); + message.processorTypes[i] = $root.google.cloud.documentai.v1.ProcessorType.fromObject(object.processorTypes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProcessorTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1.ListProcessorTypesResponse} message ListProcessorTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.processorTypes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.processorTypes && message.processorTypes.length) { + object.processorTypes = []; + for (var j = 0; j < message.processorTypes.length; ++j) + object.processorTypes[j] = $root.google.cloud.documentai.v1.ProcessorType.toObject(message.processorTypes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProcessorTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ListProcessorTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorTypesResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ListProcessorTypesResponse"; + }; + + return ListProcessorTypesResponse; + })(); + + v1.ListProcessorsRequest = (function() { + + /** + * Properties of a ListProcessorsRequest. + * @memberof google.cloud.documentai.v1 + * @interface IListProcessorsRequest + * @property {string|null} [parent] ListProcessorsRequest parent + * @property {number|null} [pageSize] ListProcessorsRequest pageSize + * @property {string|null} [pageToken] ListProcessorsRequest pageToken + */ + + /** + * Constructs a new ListProcessorsRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ListProcessorsRequest. + * @implements IListProcessorsRequest + * @constructor + * @param {google.cloud.documentai.v1.IListProcessorsRequest=} [properties] Properties to set + */ + function ListProcessorsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorsRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @instance + */ + ListProcessorsRequest.prototype.parent = ""; + + /** + * ListProcessorsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @instance + */ + ListProcessorsRequest.prototype.pageSize = 0; + + /** + * ListProcessorsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @instance + */ + ListProcessorsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProcessorsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @static + * @param {google.cloud.documentai.v1.IListProcessorsRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ListProcessorsRequest} ListProcessorsRequest instance + */ + ListProcessorsRequest.create = function create(properties) { + return new ListProcessorsRequest(properties); + }; + + /** + * Encodes the specified ListProcessorsRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @static + * @param {google.cloud.documentai.v1.IListProcessorsRequest} message ListProcessorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorsRequest.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 ListProcessorsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @static + * @param {google.cloud.documentai.v1.IListProcessorsRequest} message ListProcessorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @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.ListProcessorsRequest} ListProcessorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorsRequest.decode = function decode(reader, 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.ListProcessorsRequest(); + 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 ListProcessorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ListProcessorsRequest} ListProcessorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorsRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorsRequest.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 ListProcessorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ListProcessorsRequest} ListProcessorsRequest + */ + ListProcessorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ListProcessorsRequest) + return object; + var message = new $root.google.cloud.documentai.v1.ListProcessorsRequest(); + 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 ListProcessorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @static + * @param {google.cloud.documentai.v1.ListProcessorsRequest} message ListProcessorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorsRequest.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 ListProcessorsRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProcessorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorsRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ListProcessorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ListProcessorsRequest"; + }; + + return ListProcessorsRequest; + })(); + + v1.ListProcessorsResponse = (function() { + + /** + * Properties of a ListProcessorsResponse. + * @memberof google.cloud.documentai.v1 + * @interface IListProcessorsResponse + * @property {Array.|null} [processors] ListProcessorsResponse processors + * @property {string|null} [nextPageToken] ListProcessorsResponse nextPageToken + */ + + /** + * Constructs a new ListProcessorsResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ListProcessorsResponse. + * @implements IListProcessorsResponse + * @constructor + * @param {google.cloud.documentai.v1.IListProcessorsResponse=} [properties] Properties to set + */ + function ListProcessorsResponse(properties) { + this.processors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorsResponse processors. + * @member {Array.} processors + * @memberof google.cloud.documentai.v1.ListProcessorsResponse + * @instance + */ + ListProcessorsResponse.prototype.processors = $util.emptyArray; + + /** + * ListProcessorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.documentai.v1.ListProcessorsResponse + * @instance + */ + ListProcessorsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProcessorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ListProcessorsResponse + * @static + * @param {google.cloud.documentai.v1.IListProcessorsResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ListProcessorsResponse} ListProcessorsResponse instance + */ + ListProcessorsResponse.create = function create(properties) { + return new ListProcessorsResponse(properties); + }; + + /** + * Encodes the specified ListProcessorsResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ListProcessorsResponse + * @static + * @param {google.cloud.documentai.v1.IListProcessorsResponse} message ListProcessorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processors != null && message.processors.length) + for (var i = 0; i < message.processors.length; ++i) + $root.google.cloud.documentai.v1.Processor.encode(message.processors[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 ListProcessorsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ListProcessorsResponse + * @static + * @param {google.cloud.documentai.v1.IListProcessorsResponse} message ListProcessorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ListProcessorsResponse + * @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.ListProcessorsResponse} ListProcessorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorsResponse.decode = function decode(reader, 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.ListProcessorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.processors && message.processors.length)) + message.processors = []; + message.processors.push($root.google.cloud.documentai.v1.Processor.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProcessorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ListProcessorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ListProcessorsResponse} ListProcessorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorsResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.ListProcessorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processors != null && message.hasOwnProperty("processors")) { + if (!Array.isArray(message.processors)) + return "processors: array expected"; + for (var i = 0; i < message.processors.length; ++i) { + var error = $root.google.cloud.documentai.v1.Processor.verify(message.processors[i]); + if (error) + return "processors." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProcessorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ListProcessorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ListProcessorsResponse} ListProcessorsResponse + */ + ListProcessorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ListProcessorsResponse) + return object; + var message = new $root.google.cloud.documentai.v1.ListProcessorsResponse(); + if (object.processors) { + if (!Array.isArray(object.processors)) + throw TypeError(".google.cloud.documentai.v1.ListProcessorsResponse.processors: array expected"); + message.processors = []; + for (var i = 0; i < object.processors.length; ++i) { + if (typeof object.processors[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.ListProcessorsResponse.processors: object expected"); + message.processors[i] = $root.google.cloud.documentai.v1.Processor.fromObject(object.processors[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProcessorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ListProcessorsResponse + * @static + * @param {google.cloud.documentai.v1.ListProcessorsResponse} message ListProcessorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.processors = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.processors && message.processors.length) { + object.processors = []; + for (var j = 0; j < message.processors.length; ++j) + object.processors[j] = $root.google.cloud.documentai.v1.Processor.toObject(message.processors[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProcessorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ListProcessorsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProcessorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorsResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ListProcessorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ListProcessorsResponse"; + }; + + return ListProcessorsResponse; + })(); + + v1.GetProcessorTypeRequest = (function() { + + /** + * Properties of a GetProcessorTypeRequest. + * @memberof google.cloud.documentai.v1 + * @interface IGetProcessorTypeRequest + * @property {string|null} [name] GetProcessorTypeRequest name + */ + + /** + * Constructs a new GetProcessorTypeRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a GetProcessorTypeRequest. + * @implements IGetProcessorTypeRequest + * @constructor + * @param {google.cloud.documentai.v1.IGetProcessorTypeRequest=} [properties] Properties to set + */ + function GetProcessorTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProcessorTypeRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest + * @instance + */ + GetProcessorTypeRequest.prototype.name = ""; + + /** + * Creates a new GetProcessorTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest + * @static + * @param {google.cloud.documentai.v1.IGetProcessorTypeRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.GetProcessorTypeRequest} GetProcessorTypeRequest instance + */ + GetProcessorTypeRequest.create = function create(properties) { + return new GetProcessorTypeRequest(properties); + }; + + /** + * Encodes the specified GetProcessorTypeRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest + * @static + * @param {google.cloud.documentai.v1.IGetProcessorTypeRequest} message GetProcessorTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorTypeRequest.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 GetProcessorTypeRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest + * @static + * @param {google.cloud.documentai.v1.IGetProcessorTypeRequest} message GetProcessorTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProcessorTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest + * @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.GetProcessorTypeRequest} GetProcessorTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorTypeRequest.decode = function decode(reader, 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.GetProcessorTypeRequest(); + 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 GetProcessorTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.GetProcessorTypeRequest} GetProcessorTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProcessorTypeRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProcessorTypeRequest.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 GetProcessorTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.GetProcessorTypeRequest} GetProcessorTypeRequest + */ + GetProcessorTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.GetProcessorTypeRequest) + return object; + var message = new $root.google.cloud.documentai.v1.GetProcessorTypeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProcessorTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest + * @static + * @param {google.cloud.documentai.v1.GetProcessorTypeRequest} message GetProcessorTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProcessorTypeRequest.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 GetProcessorTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetProcessorTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProcessorTypeRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProcessorTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.GetProcessorTypeRequest"; + }; + + return GetProcessorTypeRequest; + })(); + + v1.GetProcessorRequest = (function() { + + /** + * Properties of a GetProcessorRequest. + * @memberof google.cloud.documentai.v1 + * @interface IGetProcessorRequest + * @property {string|null} [name] GetProcessorRequest name + */ + + /** + * Constructs a new GetProcessorRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a GetProcessorRequest. + * @implements IGetProcessorRequest + * @constructor + * @param {google.cloud.documentai.v1.IGetProcessorRequest=} [properties] Properties to set + */ + function GetProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProcessorRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1.GetProcessorRequest + * @instance + */ + GetProcessorRequest.prototype.name = ""; + + /** + * Creates a new GetProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.GetProcessorRequest + * @static + * @param {google.cloud.documentai.v1.IGetProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.GetProcessorRequest} GetProcessorRequest instance + */ + GetProcessorRequest.create = function create(properties) { + return new GetProcessorRequest(properties); + }; + + /** + * Encodes the specified GetProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.GetProcessorRequest + * @static + * @param {google.cloud.documentai.v1.IGetProcessorRequest} message GetProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorRequest.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 GetProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.GetProcessorRequest + * @static + * @param {google.cloud.documentai.v1.IGetProcessorRequest} message GetProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.GetProcessorRequest + * @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.GetProcessorRequest} GetProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorRequest.decode = function decode(reader, 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.GetProcessorRequest(); + 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 GetProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.GetProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.GetProcessorRequest} GetProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProcessorRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.GetProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProcessorRequest.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 GetProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.GetProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.GetProcessorRequest} GetProcessorRequest + */ + GetProcessorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.GetProcessorRequest) + return object; + var message = new $root.google.cloud.documentai.v1.GetProcessorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.GetProcessorRequest + * @static + * @param {google.cloud.documentai.v1.GetProcessorRequest} message GetProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProcessorRequest.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 GetProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.GetProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + GetProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.GetProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.GetProcessorRequest"; + }; + + return GetProcessorRequest; + })(); + + v1.GetProcessorVersionRequest = (function() { + + /** + * Properties of a GetProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @interface IGetProcessorVersionRequest + * @property {string|null} [name] GetProcessorVersionRequest name + */ + + /** + * Constructs a new GetProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a GetProcessorVersionRequest. + * @implements IGetProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1.IGetProcessorVersionRequest=} [properties] Properties to set + */ + function GetProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProcessorVersionRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest + * @instance + */ + GetProcessorVersionRequest.prototype.name = ""; + + /** + * Creates a new GetProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IGetProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.GetProcessorVersionRequest} GetProcessorVersionRequest instance + */ + GetProcessorVersionRequest.create = function create(properties) { + return new GetProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified GetProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IGetProcessorVersionRequest} message GetProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorVersionRequest.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 GetProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IGetProcessorVersionRequest} message GetProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest + * @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.GetProcessorVersionRequest} GetProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorVersionRequest.decode = function decode(reader, 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.GetProcessorVersionRequest(); + 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 GetProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.GetProcessorVersionRequest} GetProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProcessorVersionRequest.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 GetProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.GetProcessorVersionRequest} GetProcessorVersionRequest + */ + GetProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.GetProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1.GetProcessorVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.GetProcessorVersionRequest} message GetProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProcessorVersionRequest.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 GetProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.GetProcessorVersionRequest"; + }; + + return GetProcessorVersionRequest; + })(); + + v1.ListProcessorVersionsRequest = (function() { + + /** + * Properties of a ListProcessorVersionsRequest. + * @memberof google.cloud.documentai.v1 + * @interface IListProcessorVersionsRequest + * @property {string|null} [parent] ListProcessorVersionsRequest parent + * @property {number|null} [pageSize] ListProcessorVersionsRequest pageSize + * @property {string|null} [pageToken] ListProcessorVersionsRequest pageToken + */ + + /** + * Constructs a new ListProcessorVersionsRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ListProcessorVersionsRequest. + * @implements IListProcessorVersionsRequest + * @constructor + * @param {google.cloud.documentai.v1.IListProcessorVersionsRequest=} [properties] Properties to set + */ + function ListProcessorVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @instance + */ + ListProcessorVersionsRequest.prototype.parent = ""; + + /** + * ListProcessorVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @instance + */ + ListProcessorVersionsRequest.prototype.pageSize = 0; + + /** + * ListProcessorVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @instance + */ + ListProcessorVersionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProcessorVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @static + * @param {google.cloud.documentai.v1.IListProcessorVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ListProcessorVersionsRequest} ListProcessorVersionsRequest instance + */ + ListProcessorVersionsRequest.create = function create(properties) { + return new ListProcessorVersionsRequest(properties); + }; + + /** + * Encodes the specified ListProcessorVersionsRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @static + * @param {google.cloud.documentai.v1.IListProcessorVersionsRequest} message ListProcessorVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorVersionsRequest.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 ListProcessorVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @static + * @param {google.cloud.documentai.v1.IListProcessorVersionsRequest} message ListProcessorVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @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.ListProcessorVersionsRequest} ListProcessorVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorVersionsRequest.decode = function decode(reader, 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.ListProcessorVersionsRequest(); + 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 ListProcessorVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ListProcessorVersionsRequest} ListProcessorVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorVersionsRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorVersionsRequest.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 ListProcessorVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ListProcessorVersionsRequest} ListProcessorVersionsRequest + */ + ListProcessorVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ListProcessorVersionsRequest) + return object; + var message = new $root.google.cloud.documentai.v1.ListProcessorVersionsRequest(); + 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 ListProcessorVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @static + * @param {google.cloud.documentai.v1.ListProcessorVersionsRequest} message ListProcessorVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorVersionsRequest.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 ListProcessorVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProcessorVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ListProcessorVersionsRequest"; + }; + + return ListProcessorVersionsRequest; + })(); + + v1.ListProcessorVersionsResponse = (function() { + + /** + * Properties of a ListProcessorVersionsResponse. + * @memberof google.cloud.documentai.v1 + * @interface IListProcessorVersionsResponse + * @property {Array.|null} [processorVersions] ListProcessorVersionsResponse processorVersions + * @property {string|null} [nextPageToken] ListProcessorVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListProcessorVersionsResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ListProcessorVersionsResponse. + * @implements IListProcessorVersionsResponse + * @constructor + * @param {google.cloud.documentai.v1.IListProcessorVersionsResponse=} [properties] Properties to set + */ + function ListProcessorVersionsResponse(properties) { + this.processorVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorVersionsResponse processorVersions. + * @member {Array.} processorVersions + * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse + * @instance + */ + ListProcessorVersionsResponse.prototype.processorVersions = $util.emptyArray; + + /** + * ListProcessorVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse + * @instance + */ + ListProcessorVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProcessorVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse + * @static + * @param {google.cloud.documentai.v1.IListProcessorVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ListProcessorVersionsResponse} ListProcessorVersionsResponse instance + */ + ListProcessorVersionsResponse.create = function create(properties) { + return new ListProcessorVersionsResponse(properties); + }; + + /** + * Encodes the specified ListProcessorVersionsResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse + * @static + * @param {google.cloud.documentai.v1.IListProcessorVersionsResponse} message ListProcessorVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorVersions != null && message.processorVersions.length) + for (var i = 0; i < message.processorVersions.length; ++i) + $root.google.cloud.documentai.v1.ProcessorVersion.encode(message.processorVersions[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 ListProcessorVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse + * @static + * @param {google.cloud.documentai.v1.IListProcessorVersionsResponse} message ListProcessorVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse + * @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.ListProcessorVersionsResponse} ListProcessorVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorVersionsResponse.decode = function decode(reader, 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.ListProcessorVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.processorVersions && message.processorVersions.length)) + message.processorVersions = []; + message.processorVersions.push($root.google.cloud.documentai.v1.ProcessorVersion.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ListProcessorVersionsResponse} ListProcessorVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorVersionsResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorVersions != null && message.hasOwnProperty("processorVersions")) { + if (!Array.isArray(message.processorVersions)) + return "processorVersions: array expected"; + for (var i = 0; i < message.processorVersions.length; ++i) { + var error = $root.google.cloud.documentai.v1.ProcessorVersion.verify(message.processorVersions[i]); + if (error) + return "processorVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProcessorVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ListProcessorVersionsResponse} ListProcessorVersionsResponse + */ + ListProcessorVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ListProcessorVersionsResponse) + return object; + var message = new $root.google.cloud.documentai.v1.ListProcessorVersionsResponse(); + if (object.processorVersions) { + if (!Array.isArray(object.processorVersions)) + throw TypeError(".google.cloud.documentai.v1.ListProcessorVersionsResponse.processorVersions: array expected"); + message.processorVersions = []; + for (var i = 0; i < object.processorVersions.length; ++i) { + if (typeof object.processorVersions[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.ListProcessorVersionsResponse.processorVersions: object expected"); + message.processorVersions[i] = $root.google.cloud.documentai.v1.ProcessorVersion.fromObject(object.processorVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProcessorVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse + * @static + * @param {google.cloud.documentai.v1.ListProcessorVersionsResponse} message ListProcessorVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.processorVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.processorVersions && message.processorVersions.length) { + object.processorVersions = []; + for (var j = 0; j < message.processorVersions.length; ++j) + object.processorVersions[j] = $root.google.cloud.documentai.v1.ProcessorVersion.toObject(message.processorVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProcessorVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProcessorVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ListProcessorVersionsResponse"; + }; + + return ListProcessorVersionsResponse; + })(); + + v1.DeleteProcessorVersionRequest = (function() { + + /** + * Properties of a DeleteProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @interface IDeleteProcessorVersionRequest + * @property {string|null} [name] DeleteProcessorVersionRequest name + */ + + /** + * Constructs a new DeleteProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DeleteProcessorVersionRequest. + * @implements IDeleteProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1.IDeleteProcessorVersionRequest=} [properties] Properties to set + */ + function DeleteProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteProcessorVersionRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest + * @instance + */ + DeleteProcessorVersionRequest.prototype.name = ""; + + /** + * Creates a new DeleteProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IDeleteProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest instance + */ + DeleteProcessorVersionRequest.create = function create(properties) { + return new DeleteProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IDeleteProcessorVersionRequest} message DeleteProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorVersionRequest.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 DeleteProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IDeleteProcessorVersionRequest} message DeleteProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest + * @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.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorVersionRequest.decode = function decode(reader, 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.DeleteProcessorVersionRequest(); + 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 DeleteProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProcessorVersionRequest.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 DeleteProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest + */ + DeleteProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DeleteProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1.DeleteProcessorVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.DeleteProcessorVersionRequest} message DeleteProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProcessorVersionRequest.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 DeleteProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DeleteProcessorVersionRequest"; + }; + + return DeleteProcessorVersionRequest; + })(); + + v1.DeleteProcessorVersionMetadata = (function() { + + /** + * Properties of a DeleteProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1 + * @interface IDeleteProcessorVersionMetadata + * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] DeleteProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new DeleteProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DeleteProcessorVersionMetadata. + * @implements IDeleteProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1.IDeleteProcessorVersionMetadata=} [properties] Properties to set + */ + function DeleteProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata + * @instance + */ + DeleteProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new DeleteProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.IDeleteProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata instance + */ + DeleteProcessorVersionMetadata.create = function create(properties) { + return new DeleteProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified DeleteProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.IDeleteProcessorVersionMetadata} message DeleteProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.IDeleteProcessorVersionMetadata} message DeleteProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata + * @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.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorVersionMetadata.decode = function decode(reader, 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.DeleteProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates a DeleteProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata + */ + DeleteProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DeleteProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1.DeleteProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1.DeleteProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from a DeleteProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.DeleteProcessorVersionMetadata} message DeleteProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this DeleteProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DeleteProcessorVersionMetadata"; + }; + + return DeleteProcessorVersionMetadata; + })(); + + v1.DeployProcessorVersionRequest = (function() { + + /** + * Properties of a DeployProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @interface IDeployProcessorVersionRequest + * @property {string|null} [name] DeployProcessorVersionRequest name + */ + + /** + * Constructs a new DeployProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DeployProcessorVersionRequest. + * @implements IDeployProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1.IDeployProcessorVersionRequest=} [properties] Properties to set + */ + function DeployProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployProcessorVersionRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest + * @instance + */ + DeployProcessorVersionRequest.prototype.name = ""; + + /** + * Creates a new DeployProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IDeployProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DeployProcessorVersionRequest} DeployProcessorVersionRequest instance + */ + DeployProcessorVersionRequest.create = function create(properties) { + return new DeployProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified DeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IDeployProcessorVersionRequest} message DeployProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployProcessorVersionRequest.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 DeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IDeployProcessorVersionRequest} message DeployProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest + * @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.DeployProcessorVersionRequest} DeployProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployProcessorVersionRequest.decode = function decode(reader, 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.DeployProcessorVersionRequest(); + 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 DeployProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DeployProcessorVersionRequest} DeployProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployProcessorVersionRequest.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 DeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DeployProcessorVersionRequest} DeployProcessorVersionRequest + */ + DeployProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DeployProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1.DeployProcessorVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeployProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.DeployProcessorVersionRequest} message DeployProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployProcessorVersionRequest.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 DeployProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeployProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DeployProcessorVersionRequest"; + }; + + return DeployProcessorVersionRequest; + })(); + + v1.DeployProcessorVersionResponse = (function() { + + /** + * Properties of a DeployProcessorVersionResponse. + * @memberof google.cloud.documentai.v1 + * @interface IDeployProcessorVersionResponse + */ + + /** + * Constructs a new DeployProcessorVersionResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DeployProcessorVersionResponse. + * @implements IDeployProcessorVersionResponse + * @constructor + * @param {google.cloud.documentai.v1.IDeployProcessorVersionResponse=} [properties] Properties to set + */ + function DeployProcessorVersionResponse(properties) { + if (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 DeployProcessorVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.IDeployProcessorVersionResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DeployProcessorVersionResponse} DeployProcessorVersionResponse instance + */ + DeployProcessorVersionResponse.create = function create(properties) { + return new DeployProcessorVersionResponse(properties); + }; + + /** + * Encodes the specified DeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.IDeployProcessorVersionResponse} message DeployProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployProcessorVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.IDeployProcessorVersionResponse} message DeployProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployProcessorVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse + * @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.DeployProcessorVersionResponse} DeployProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployProcessorVersionResponse.decode = function decode(reader, 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.DeployProcessorVersionResponse(); + 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 DeployProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DeployProcessorVersionResponse} DeployProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployProcessorVersionResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployProcessorVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DeployProcessorVersionResponse} DeployProcessorVersionResponse + */ + DeployProcessorVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DeployProcessorVersionResponse) + return object; + return new $root.google.cloud.documentai.v1.DeployProcessorVersionResponse(); + }; + + /** + * Creates a plain object from a DeployProcessorVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.DeployProcessorVersionResponse} message DeployProcessorVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployProcessorVersionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeployProcessorVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse + * @instance + * @returns {Object.} JSON object + */ + DeployProcessorVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployProcessorVersionResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DeployProcessorVersionResponse"; + }; + + return DeployProcessorVersionResponse; + })(); + + v1.DeployProcessorVersionMetadata = (function() { + + /** + * Properties of a DeployProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1 + * @interface IDeployProcessorVersionMetadata + * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] DeployProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new DeployProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DeployProcessorVersionMetadata. + * @implements IDeployProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1.IDeployProcessorVersionMetadata=} [properties] Properties to set + */ + function DeployProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata + * @instance + */ + DeployProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new DeployProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.IDeployProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata instance + */ + DeployProcessorVersionMetadata.create = function create(properties) { + return new DeployProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified DeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.IDeployProcessorVersionMetadata} message DeployProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.IDeployProcessorVersionMetadata} message DeployProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata + * @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.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployProcessorVersionMetadata.decode = function decode(reader, 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.DeployProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates a DeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata + */ + DeployProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DeployProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1.DeployProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1.DeployProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from a DeployProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.DeployProcessorVersionMetadata} message DeployProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this DeployProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DeployProcessorVersionMetadata"; + }; + + return DeployProcessorVersionMetadata; + })(); + + v1.UndeployProcessorVersionRequest = (function() { + + /** + * Properties of an UndeployProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @interface IUndeployProcessorVersionRequest + * @property {string|null} [name] UndeployProcessorVersionRequest name + */ + + /** + * Constructs a new UndeployProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents an UndeployProcessorVersionRequest. + * @implements IUndeployProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionRequest=} [properties] Properties to set + */ + function UndeployProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeployProcessorVersionRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest + * @instance + */ + UndeployProcessorVersionRequest.prototype.name = ""; + + /** + * Creates a new UndeployProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest instance + */ + UndeployProcessorVersionRequest.create = function create(properties) { + return new UndeployProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified UndeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionRequest} message UndeployProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployProcessorVersionRequest.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 UndeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionRequest} message UndeployProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest + * @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.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployProcessorVersionRequest.decode = function decode(reader, 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.UndeployProcessorVersionRequest(); + 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 an UndeployProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployProcessorVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an UndeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest + */ + UndeployProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.UndeployProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1.UndeployProcessorVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UndeployProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.UndeployProcessorVersionRequest} message UndeployProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployProcessorVersionRequest.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 UndeployProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + UndeployProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.UndeployProcessorVersionRequest"; + }; + + return UndeployProcessorVersionRequest; + })(); + + v1.UndeployProcessorVersionResponse = (function() { + + /** + * Properties of an UndeployProcessorVersionResponse. + * @memberof google.cloud.documentai.v1 + * @interface IUndeployProcessorVersionResponse + */ + + /** + * Constructs a new UndeployProcessorVersionResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents an UndeployProcessorVersionResponse. + * @implements IUndeployProcessorVersionResponse + * @constructor + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionResponse=} [properties] Properties to set + */ + function UndeployProcessorVersionResponse(properties) { + if (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 UndeployProcessorVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse instance + */ + UndeployProcessorVersionResponse.create = function create(properties) { + return new UndeployProcessorVersionResponse(properties); + }; + + /** + * Encodes the specified UndeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionResponse} message UndeployProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployProcessorVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UndeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionResponse} message UndeployProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployProcessorVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse + * @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.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployProcessorVersionResponse.decode = function decode(reader, 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.UndeployProcessorVersionResponse(); + 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 UndeployProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployProcessorVersionResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployProcessorVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UndeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse + */ + UndeployProcessorVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.UndeployProcessorVersionResponse) + return object; + return new $root.google.cloud.documentai.v1.UndeployProcessorVersionResponse(); + }; + + /** + * Creates a plain object from an UndeployProcessorVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.UndeployProcessorVersionResponse} message UndeployProcessorVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployProcessorVersionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UndeployProcessorVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse + * @instance + * @returns {Object.} JSON object + */ + UndeployProcessorVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployProcessorVersionResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.UndeployProcessorVersionResponse"; + }; + + return UndeployProcessorVersionResponse; + })(); + + v1.UndeployProcessorVersionMetadata = (function() { + + /** + * Properties of an UndeployProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1 + * @interface IUndeployProcessorVersionMetadata + * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] UndeployProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new UndeployProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents an UndeployProcessorVersionMetadata. + * @implements IUndeployProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionMetadata=} [properties] Properties to set + */ + function UndeployProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeployProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata + * @instance + */ + UndeployProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new UndeployProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata instance + */ + UndeployProcessorVersionMetadata.create = function create(properties) { + return new UndeployProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified UndeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionMetadata} message UndeployProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UndeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.IUndeployProcessorVersionMetadata} message UndeployProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata + * @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.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployProcessorVersionMetadata.decode = function decode(reader, 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.UndeployProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates an UndeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata + */ + UndeployProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.UndeployProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1.UndeployProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1.UndeployProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from an UndeployProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.UndeployProcessorVersionMetadata} message UndeployProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this UndeployProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + UndeployProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.UndeployProcessorVersionMetadata"; + }; + + return UndeployProcessorVersionMetadata; + })(); + + v1.CreateProcessorRequest = (function() { + + /** + * Properties of a CreateProcessorRequest. + * @memberof google.cloud.documentai.v1 + * @interface ICreateProcessorRequest + * @property {string|null} [parent] CreateProcessorRequest parent + * @property {google.cloud.documentai.v1.IProcessor|null} [processor] CreateProcessorRequest processor + */ + + /** + * Constructs a new CreateProcessorRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a CreateProcessorRequest. + * @implements ICreateProcessorRequest + * @constructor + * @param {google.cloud.documentai.v1.ICreateProcessorRequest=} [properties] Properties to set + */ + function CreateProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateProcessorRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1.CreateProcessorRequest + * @instance + */ + CreateProcessorRequest.prototype.parent = ""; + + /** + * CreateProcessorRequest processor. + * @member {google.cloud.documentai.v1.IProcessor|null|undefined} processor + * @memberof google.cloud.documentai.v1.CreateProcessorRequest + * @instance + */ + CreateProcessorRequest.prototype.processor = null; + + /** + * Creates a new CreateProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.CreateProcessorRequest + * @static + * @param {google.cloud.documentai.v1.ICreateProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.CreateProcessorRequest} CreateProcessorRequest instance + */ + CreateProcessorRequest.create = function create(properties) { + return new CreateProcessorRequest(properties); + }; + + /** + * Encodes the specified CreateProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.CreateProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.CreateProcessorRequest + * @static + * @param {google.cloud.documentai.v1.ICreateProcessorRequest} message CreateProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProcessorRequest.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.processor != null && Object.hasOwnProperty.call(message, "processor")) + $root.google.cloud.documentai.v1.Processor.encode(message.processor, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.CreateProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.CreateProcessorRequest + * @static + * @param {google.cloud.documentai.v1.ICreateProcessorRequest} message CreateProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.CreateProcessorRequest + * @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.CreateProcessorRequest} CreateProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProcessorRequest.decode = function decode(reader, 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.CreateProcessorRequest(); + 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.processor = $root.google.cloud.documentai.v1.Processor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.CreateProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.CreateProcessorRequest} CreateProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateProcessorRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.CreateProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateProcessorRequest.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.processor != null && message.hasOwnProperty("processor")) { + var error = $root.google.cloud.documentai.v1.Processor.verify(message.processor); + if (error) + return "processor." + error; + } + return null; + }; + + /** + * Creates a CreateProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.CreateProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.CreateProcessorRequest} CreateProcessorRequest + */ + CreateProcessorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.CreateProcessorRequest) + return object; + var message = new $root.google.cloud.documentai.v1.CreateProcessorRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.processor != null) { + if (typeof object.processor !== "object") + throw TypeError(".google.cloud.documentai.v1.CreateProcessorRequest.processor: object expected"); + message.processor = $root.google.cloud.documentai.v1.Processor.fromObject(object.processor); + } + return message; + }; + + /** + * Creates a plain object from a CreateProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.CreateProcessorRequest + * @static + * @param {google.cloud.documentai.v1.CreateProcessorRequest} message CreateProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateProcessorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.processor = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.processor != null && message.hasOwnProperty("processor")) + object.processor = $root.google.cloud.documentai.v1.Processor.toObject(message.processor, options); + return object; + }; + + /** + * Converts this CreateProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.CreateProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + CreateProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.CreateProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.CreateProcessorRequest"; + }; + + return CreateProcessorRequest; + })(); + + v1.DeleteProcessorRequest = (function() { + + /** + * Properties of a DeleteProcessorRequest. + * @memberof google.cloud.documentai.v1 + * @interface IDeleteProcessorRequest + * @property {string|null} [name] DeleteProcessorRequest name + */ + + /** + * Constructs a new DeleteProcessorRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DeleteProcessorRequest. + * @implements IDeleteProcessorRequest + * @constructor + * @param {google.cloud.documentai.v1.IDeleteProcessorRequest=} [properties] Properties to set + */ + function DeleteProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteProcessorRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1.DeleteProcessorRequest + * @instance + */ + DeleteProcessorRequest.prototype.name = ""; + + /** + * Creates a new DeleteProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DeleteProcessorRequest + * @static + * @param {google.cloud.documentai.v1.IDeleteProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DeleteProcessorRequest} DeleteProcessorRequest instance + */ + DeleteProcessorRequest.create = function create(properties) { + return new DeleteProcessorRequest(properties); + }; + + /** + * Encodes the specified DeleteProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DeleteProcessorRequest + * @static + * @param {google.cloud.documentai.v1.IDeleteProcessorRequest} message DeleteProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorRequest.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 DeleteProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DeleteProcessorRequest + * @static + * @param {google.cloud.documentai.v1.IDeleteProcessorRequest} message DeleteProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DeleteProcessorRequest + * @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.DeleteProcessorRequest} DeleteProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorRequest.decode = function decode(reader, 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.DeleteProcessorRequest(); + 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 DeleteProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DeleteProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DeleteProcessorRequest} DeleteProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProcessorRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.DeleteProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProcessorRequest.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 DeleteProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DeleteProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DeleteProcessorRequest} DeleteProcessorRequest + */ + DeleteProcessorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DeleteProcessorRequest) + return object; + var message = new $root.google.cloud.documentai.v1.DeleteProcessorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DeleteProcessorRequest + * @static + * @param {google.cloud.documentai.v1.DeleteProcessorRequest} message DeleteProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProcessorRequest.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 DeleteProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DeleteProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DeleteProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DeleteProcessorRequest"; + }; + + return DeleteProcessorRequest; + })(); + + v1.DeleteProcessorMetadata = (function() { + + /** + * Properties of a DeleteProcessorMetadata. + * @memberof google.cloud.documentai.v1 + * @interface IDeleteProcessorMetadata + * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] DeleteProcessorMetadata commonMetadata + */ + + /** + * Constructs a new DeleteProcessorMetadata. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DeleteProcessorMetadata. + * @implements IDeleteProcessorMetadata + * @constructor + * @param {google.cloud.documentai.v1.IDeleteProcessorMetadata=} [properties] Properties to set + */ + function DeleteProcessorMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteProcessorMetadata commonMetadata. + * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata + * @instance + */ + DeleteProcessorMetadata.prototype.commonMetadata = null; + + /** + * Creates a new DeleteProcessorMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata + * @static + * @param {google.cloud.documentai.v1.IDeleteProcessorMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DeleteProcessorMetadata} DeleteProcessorMetadata instance + */ + DeleteProcessorMetadata.create = function create(properties) { + return new DeleteProcessorMetadata(properties); + }; + + /** + * Encodes the specified DeleteProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata + * @static + * @param {google.cloud.documentai.v1.IDeleteProcessorMetadata} message DeleteProcessorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata + * @static + * @param {google.cloud.documentai.v1.IDeleteProcessorMetadata} message DeleteProcessorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProcessorMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata + * @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.DeleteProcessorMetadata} DeleteProcessorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorMetadata.decode = function decode(reader, 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.DeleteProcessorMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteProcessorMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DeleteProcessorMetadata} DeleteProcessorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProcessorMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProcessorMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates a DeleteProcessorMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DeleteProcessorMetadata} DeleteProcessorMetadata + */ + DeleteProcessorMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DeleteProcessorMetadata) + return object; + var message = new $root.google.cloud.documentai.v1.DeleteProcessorMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1.DeleteProcessorMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from a DeleteProcessorMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata + * @static + * @param {google.cloud.documentai.v1.DeleteProcessorMetadata} message DeleteProcessorMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProcessorMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this DeleteProcessorMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteProcessorMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteProcessorMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteProcessorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DeleteProcessorMetadata"; + }; + + return DeleteProcessorMetadata; + })(); + + v1.EnableProcessorRequest = (function() { + + /** + * Properties of an EnableProcessorRequest. + * @memberof google.cloud.documentai.v1 + * @interface IEnableProcessorRequest + * @property {string|null} [name] EnableProcessorRequest name + */ + + /** + * Constructs a new EnableProcessorRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents an EnableProcessorRequest. + * @implements IEnableProcessorRequest + * @constructor + * @param {google.cloud.documentai.v1.IEnableProcessorRequest=} [properties] Properties to set + */ + function EnableProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnableProcessorRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1.EnableProcessorRequest + * @instance + */ + EnableProcessorRequest.prototype.name = ""; + + /** + * Creates a new EnableProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.EnableProcessorRequest + * @static + * @param {google.cloud.documentai.v1.IEnableProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.EnableProcessorRequest} EnableProcessorRequest instance + */ + EnableProcessorRequest.create = function create(properties) { + return new EnableProcessorRequest(properties); + }; + + /** + * Encodes the specified EnableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.EnableProcessorRequest + * @static + * @param {google.cloud.documentai.v1.IEnableProcessorRequest} message EnableProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProcessorRequest.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 EnableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.EnableProcessorRequest + * @static + * @param {google.cloud.documentai.v1.IEnableProcessorRequest} message EnableProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.EnableProcessorRequest + * @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.EnableProcessorRequest} EnableProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProcessorRequest.decode = function decode(reader, 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.EnableProcessorRequest(); + 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 an EnableProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.EnableProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.EnableProcessorRequest} EnableProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableProcessorRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.EnableProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableProcessorRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an EnableProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.EnableProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.EnableProcessorRequest} EnableProcessorRequest + */ + EnableProcessorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.EnableProcessorRequest) + return object; + var message = new $root.google.cloud.documentai.v1.EnableProcessorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an EnableProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.EnableProcessorRequest + * @static + * @param {google.cloud.documentai.v1.EnableProcessorRequest} message EnableProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableProcessorRequest.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 EnableProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.EnableProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + EnableProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnableProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.EnableProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnableProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.EnableProcessorRequest"; + }; + + return EnableProcessorRequest; + })(); + + v1.EnableProcessorResponse = (function() { + + /** + * Properties of an EnableProcessorResponse. + * @memberof google.cloud.documentai.v1 + * @interface IEnableProcessorResponse + */ + + /** + * Constructs a new EnableProcessorResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents an EnableProcessorResponse. + * @implements IEnableProcessorResponse + * @constructor + * @param {google.cloud.documentai.v1.IEnableProcessorResponse=} [properties] Properties to set + */ + function EnableProcessorResponse(properties) { + if (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 EnableProcessorResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.EnableProcessorResponse + * @static + * @param {google.cloud.documentai.v1.IEnableProcessorResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.EnableProcessorResponse} EnableProcessorResponse instance + */ + EnableProcessorResponse.create = function create(properties) { + return new EnableProcessorResponse(properties); + }; + + /** + * Encodes the specified EnableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.EnableProcessorResponse + * @static + * @param {google.cloud.documentai.v1.IEnableProcessorResponse} message EnableProcessorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProcessorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified EnableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.EnableProcessorResponse + * @static + * @param {google.cloud.documentai.v1.IEnableProcessorResponse} message EnableProcessorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProcessorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableProcessorResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.EnableProcessorResponse + * @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.EnableProcessorResponse} EnableProcessorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProcessorResponse.decode = function decode(reader, 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.EnableProcessorResponse(); + 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 EnableProcessorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.EnableProcessorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.EnableProcessorResponse} EnableProcessorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProcessorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableProcessorResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.EnableProcessorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableProcessorResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an EnableProcessorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.EnableProcessorResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.EnableProcessorResponse} EnableProcessorResponse + */ + EnableProcessorResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.EnableProcessorResponse) + return object; + return new $root.google.cloud.documentai.v1.EnableProcessorResponse(); + }; + + /** + * Creates a plain object from an EnableProcessorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.EnableProcessorResponse + * @static + * @param {google.cloud.documentai.v1.EnableProcessorResponse} message EnableProcessorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableProcessorResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this EnableProcessorResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.EnableProcessorResponse + * @instance + * @returns {Object.} JSON object + */ + EnableProcessorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnableProcessorResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.EnableProcessorResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnableProcessorResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.EnableProcessorResponse"; + }; + + return EnableProcessorResponse; + })(); + + v1.EnableProcessorMetadata = (function() { + + /** + * Properties of an EnableProcessorMetadata. + * @memberof google.cloud.documentai.v1 + * @interface IEnableProcessorMetadata + * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] EnableProcessorMetadata commonMetadata + */ + + /** + * Constructs a new EnableProcessorMetadata. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents an EnableProcessorMetadata. + * @implements IEnableProcessorMetadata + * @constructor + * @param {google.cloud.documentai.v1.IEnableProcessorMetadata=} [properties] Properties to set + */ + function EnableProcessorMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnableProcessorMetadata commonMetadata. + * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1.EnableProcessorMetadata + * @instance + */ + EnableProcessorMetadata.prototype.commonMetadata = null; + + /** + * Creates a new EnableProcessorMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.EnableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1.IEnableProcessorMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.EnableProcessorMetadata} EnableProcessorMetadata instance + */ + EnableProcessorMetadata.create = function create(properties) { + return new EnableProcessorMetadata(properties); + }; + + /** + * Encodes the specified EnableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.EnableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1.IEnableProcessorMetadata} message EnableProcessorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProcessorMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.EnableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1.IEnableProcessorMetadata} message EnableProcessorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProcessorMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableProcessorMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.EnableProcessorMetadata + * @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.EnableProcessorMetadata} EnableProcessorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProcessorMetadata.decode = function decode(reader, 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.EnableProcessorMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnableProcessorMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.EnableProcessorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.EnableProcessorMetadata} EnableProcessorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProcessorMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableProcessorMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1.EnableProcessorMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableProcessorMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates an EnableProcessorMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.EnableProcessorMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.EnableProcessorMetadata} EnableProcessorMetadata + */ + EnableProcessorMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.EnableProcessorMetadata) + return object; + var message = new $root.google.cloud.documentai.v1.EnableProcessorMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1.EnableProcessorMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from an EnableProcessorMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.EnableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1.EnableProcessorMetadata} message EnableProcessorMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableProcessorMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this EnableProcessorMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.EnableProcessorMetadata + * @instance + * @returns {Object.} JSON object + */ + EnableProcessorMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnableProcessorMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.EnableProcessorMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnableProcessorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.EnableProcessorMetadata"; + }; + + return EnableProcessorMetadata; + })(); + + v1.DisableProcessorRequest = (function() { + + /** + * Properties of a DisableProcessorRequest. + * @memberof google.cloud.documentai.v1 + * @interface IDisableProcessorRequest + * @property {string|null} [name] DisableProcessorRequest name + */ + + /** + * Constructs a new DisableProcessorRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DisableProcessorRequest. + * @implements IDisableProcessorRequest + * @constructor + * @param {google.cloud.documentai.v1.IDisableProcessorRequest=} [properties] Properties to set + */ + function DisableProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisableProcessorRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1.DisableProcessorRequest + * @instance + */ + DisableProcessorRequest.prototype.name = ""; + + /** + * Creates a new DisableProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DisableProcessorRequest + * @static + * @param {google.cloud.documentai.v1.IDisableProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DisableProcessorRequest} DisableProcessorRequest instance + */ + DisableProcessorRequest.create = function create(properties) { + return new DisableProcessorRequest(properties); + }; + + /** + * Encodes the specified DisableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DisableProcessorRequest + * @static + * @param {google.cloud.documentai.v1.IDisableProcessorRequest} message DisableProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProcessorRequest.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 DisableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DisableProcessorRequest + * @static + * @param {google.cloud.documentai.v1.IDisableProcessorRequest} message DisableProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DisableProcessorRequest + * @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.DisableProcessorRequest} DisableProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProcessorRequest.decode = function decode(reader, 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.DisableProcessorRequest(); + 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 DisableProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DisableProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DisableProcessorRequest} DisableProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableProcessorRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.DisableProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableProcessorRequest.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 DisableProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DisableProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DisableProcessorRequest} DisableProcessorRequest + */ + DisableProcessorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DisableProcessorRequest) + return object; + var message = new $root.google.cloud.documentai.v1.DisableProcessorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DisableProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DisableProcessorRequest + * @static + * @param {google.cloud.documentai.v1.DisableProcessorRequest} message DisableProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableProcessorRequest.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 DisableProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DisableProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + DisableProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisableProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DisableProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisableProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DisableProcessorRequest"; + }; + + return DisableProcessorRequest; + })(); + + v1.DisableProcessorResponse = (function() { + + /** + * Properties of a DisableProcessorResponse. + * @memberof google.cloud.documentai.v1 + * @interface IDisableProcessorResponse + */ + + /** + * Constructs a new DisableProcessorResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DisableProcessorResponse. + * @implements IDisableProcessorResponse + * @constructor + * @param {google.cloud.documentai.v1.IDisableProcessorResponse=} [properties] Properties to set + */ + function DisableProcessorResponse(properties) { + if (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 DisableProcessorResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DisableProcessorResponse + * @static + * @param {google.cloud.documentai.v1.IDisableProcessorResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DisableProcessorResponse} DisableProcessorResponse instance + */ + DisableProcessorResponse.create = function create(properties) { + return new DisableProcessorResponse(properties); + }; + + /** + * Encodes the specified DisableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DisableProcessorResponse + * @static + * @param {google.cloud.documentai.v1.IDisableProcessorResponse} message DisableProcessorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProcessorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DisableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DisableProcessorResponse + * @static + * @param {google.cloud.documentai.v1.IDisableProcessorResponse} message DisableProcessorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProcessorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableProcessorResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DisableProcessorResponse + * @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.DisableProcessorResponse} DisableProcessorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProcessorResponse.decode = function decode(reader, 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.DisableProcessorResponse(); + 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 DisableProcessorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DisableProcessorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DisableProcessorResponse} DisableProcessorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProcessorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableProcessorResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.DisableProcessorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableProcessorResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DisableProcessorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DisableProcessorResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DisableProcessorResponse} DisableProcessorResponse + */ + DisableProcessorResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DisableProcessorResponse) + return object; + return new $root.google.cloud.documentai.v1.DisableProcessorResponse(); + }; + + /** + * Creates a plain object from a DisableProcessorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DisableProcessorResponse + * @static + * @param {google.cloud.documentai.v1.DisableProcessorResponse} message DisableProcessorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableProcessorResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DisableProcessorResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DisableProcessorResponse + * @instance + * @returns {Object.} JSON object + */ + DisableProcessorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisableProcessorResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DisableProcessorResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisableProcessorResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DisableProcessorResponse"; + }; + + return DisableProcessorResponse; + })(); + + v1.DisableProcessorMetadata = (function() { + + /** + * Properties of a DisableProcessorMetadata. + * @memberof google.cloud.documentai.v1 + * @interface IDisableProcessorMetadata + * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] DisableProcessorMetadata commonMetadata + */ + + /** + * Constructs a new DisableProcessorMetadata. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DisableProcessorMetadata. + * @implements IDisableProcessorMetadata + * @constructor + * @param {google.cloud.documentai.v1.IDisableProcessorMetadata=} [properties] Properties to set + */ + function DisableProcessorMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisableProcessorMetadata commonMetadata. + * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1.DisableProcessorMetadata + * @instance + */ + DisableProcessorMetadata.prototype.commonMetadata = null; + + /** + * Creates a new DisableProcessorMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DisableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1.IDisableProcessorMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DisableProcessorMetadata} DisableProcessorMetadata instance + */ + DisableProcessorMetadata.create = function create(properties) { + return new DisableProcessorMetadata(properties); + }; + + /** + * Encodes the specified DisableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DisableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1.IDisableProcessorMetadata} message DisableProcessorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProcessorMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DisableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DisableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1.IDisableProcessorMetadata} message DisableProcessorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProcessorMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableProcessorMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DisableProcessorMetadata + * @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.DisableProcessorMetadata} DisableProcessorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProcessorMetadata.decode = function decode(reader, 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.DisableProcessorMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisableProcessorMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DisableProcessorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DisableProcessorMetadata} DisableProcessorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProcessorMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableProcessorMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1.DisableProcessorMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableProcessorMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates a DisableProcessorMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DisableProcessorMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DisableProcessorMetadata} DisableProcessorMetadata + */ + DisableProcessorMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DisableProcessorMetadata) + return object; + var message = new $root.google.cloud.documentai.v1.DisableProcessorMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1.DisableProcessorMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from a DisableProcessorMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DisableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1.DisableProcessorMetadata} message DisableProcessorMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableProcessorMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this DisableProcessorMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DisableProcessorMetadata + * @instance + * @returns {Object.} JSON object + */ + DisableProcessorMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisableProcessorMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DisableProcessorMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisableProcessorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DisableProcessorMetadata"; + }; + + return DisableProcessorMetadata; + })(); + + v1.SetDefaultProcessorVersionRequest = (function() { + + /** + * Properties of a SetDefaultProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @interface ISetDefaultProcessorVersionRequest + * @property {string|null} [processor] SetDefaultProcessorVersionRequest processor + * @property {string|null} [defaultProcessorVersion] SetDefaultProcessorVersionRequest defaultProcessorVersion + */ + + /** + * Constructs a new SetDefaultProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a SetDefaultProcessorVersionRequest. + * @implements ISetDefaultProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest=} [properties] Properties to set + */ + function SetDefaultProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetDefaultProcessorVersionRequest processor. + * @member {string} processor + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + * @instance + */ + SetDefaultProcessorVersionRequest.prototype.processor = ""; + + /** + * SetDefaultProcessorVersionRequest defaultProcessorVersion. + * @member {string} defaultProcessorVersion + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + * @instance + */ + SetDefaultProcessorVersionRequest.prototype.defaultProcessorVersion = ""; + + /** + * Creates a new SetDefaultProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest instance + */ + SetDefaultProcessorVersionRequest.create = function create(properties) { + return new SetDefaultProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified SetDefaultProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest} message SetDefaultProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultProcessorVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processor != null && Object.hasOwnProperty.call(message, "processor")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.processor); + if (message.defaultProcessorVersion != null && Object.hasOwnProperty.call(message, "defaultProcessorVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.defaultProcessorVersion); + return writer; + }; + + /** + * Encodes the specified SetDefaultProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest} message SetDefaultProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + * @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.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultProcessorVersionRequest.decode = function decode(reader, 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.SetDefaultProcessorVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.processor = reader.string(); + break; + } + case 2: { + message.defaultProcessorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetDefaultProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetDefaultProcessorVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processor != null && message.hasOwnProperty("processor")) + if (!$util.isString(message.processor)) + return "processor: string expected"; + if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) + if (!$util.isString(message.defaultProcessorVersion)) + return "defaultProcessorVersion: string expected"; + return null; + }; + + /** + * Creates a SetDefaultProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest + */ + SetDefaultProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest(); + if (object.processor != null) + message.processor = String(object.processor); + if (object.defaultProcessorVersion != null) + message.defaultProcessorVersion = String(object.defaultProcessorVersion); + return message; + }; + + /** + * Creates a plain object from a SetDefaultProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.SetDefaultProcessorVersionRequest} message SetDefaultProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetDefaultProcessorVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.processor = ""; + object.defaultProcessorVersion = ""; + } + if (message.processor != null && message.hasOwnProperty("processor")) + object.processor = message.processor; + if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) + object.defaultProcessorVersion = message.defaultProcessorVersion; + return object; + }; + + /** + * Converts this SetDefaultProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + SetDefaultProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetDefaultProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetDefaultProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.SetDefaultProcessorVersionRequest"; + }; + + return SetDefaultProcessorVersionRequest; + })(); + + v1.SetDefaultProcessorVersionResponse = (function() { + + /** + * Properties of a SetDefaultProcessorVersionResponse. + * @memberof google.cloud.documentai.v1 + * @interface ISetDefaultProcessorVersionResponse + */ + + /** + * Constructs a new SetDefaultProcessorVersionResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a SetDefaultProcessorVersionResponse. + * @implements ISetDefaultProcessorVersionResponse + * @constructor + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse=} [properties] Properties to set + */ + function SetDefaultProcessorVersionResponse(properties) { + if (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 SetDefaultProcessorVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse instance + */ + SetDefaultProcessorVersionResponse.create = function create(properties) { + return new SetDefaultProcessorVersionResponse(properties); + }; + + /** + * Encodes the specified SetDefaultProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse} message SetDefaultProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultProcessorVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SetDefaultProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse} message SetDefaultProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetDefaultProcessorVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + * @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.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultProcessorVersionResponse.decode = function decode(reader, 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.SetDefaultProcessorVersionResponse(); + 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 SetDefaultProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetDefaultProcessorVersionResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetDefaultProcessorVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a SetDefaultProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse + */ + SetDefaultProcessorVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse) + return object; + return new $root.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse(); + }; + + /** + * Creates a plain object from a SetDefaultProcessorVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.SetDefaultProcessorVersionResponse} message SetDefaultProcessorVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetDefaultProcessorVersionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SetDefaultProcessorVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + * @instance + * @returns {Object.} JSON object + */ + SetDefaultProcessorVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetDefaultProcessorVersionResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetDefaultProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.SetDefaultProcessorVersionResponse"; + }; + + return SetDefaultProcessorVersionResponse; + })(); + + v1.SetDefaultProcessorVersionMetadata = (function() { + + /** + * Properties of a SetDefaultProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1 + * @interface ISetDefaultProcessorVersionMetadata + * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] SetDefaultProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new SetDefaultProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a SetDefaultProcessorVersionMetadata. + * @implements ISetDefaultProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata=} [properties] Properties to set + */ + function SetDefaultProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetDefaultProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + * @instance + */ + SetDefaultProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new SetDefaultProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata instance + */ + SetDefaultProcessorVersionMetadata.create = function create(properties) { + return new SetDefaultProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified SetDefaultProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata} message SetDefaultProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetDefaultProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata} message SetDefaultProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + * @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.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultProcessorVersionMetadata.decode = function decode(reader, 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.SetDefaultProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetDefaultProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetDefaultProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates a SetDefaultProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata + */ + SetDefaultProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from a SetDefaultProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata} message SetDefaultProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetDefaultProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this SetDefaultProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + SetDefaultProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetDefaultProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetDefaultProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata"; + }; + + return SetDefaultProcessorVersionMetadata; + })(); + + v1.TrainProcessorVersionRequest = (function() { + + /** + * Properties of a TrainProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @interface ITrainProcessorVersionRequest + * @property {google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null} [customDocumentExtractionOptions] TrainProcessorVersionRequest customDocumentExtractionOptions + * @property {google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null} [foundationModelTuningOptions] TrainProcessorVersionRequest foundationModelTuningOptions + * @property {string|null} [parent] TrainProcessorVersionRequest parent + * @property {google.cloud.documentai.v1.IProcessorVersion|null} [processorVersion] TrainProcessorVersionRequest processorVersion + * @property {google.cloud.documentai.v1.IDocumentSchema|null} [documentSchema] TrainProcessorVersionRequest documentSchema + * @property {google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData|null} [inputData] TrainProcessorVersionRequest inputData + * @property {string|null} [baseProcessorVersion] TrainProcessorVersionRequest baseProcessorVersion + */ + + /** + * Constructs a new TrainProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a TrainProcessorVersionRequest. + * @implements ITrainProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1.ITrainProcessorVersionRequest=} [properties] Properties to set + */ + function TrainProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainProcessorVersionRequest customDocumentExtractionOptions. + * @member {google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null|undefined} customDocumentExtractionOptions + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.customDocumentExtractionOptions = null; + + /** + * TrainProcessorVersionRequest foundationModelTuningOptions. + * @member {google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null|undefined} foundationModelTuningOptions + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.foundationModelTuningOptions = null; + + /** + * TrainProcessorVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.parent = ""; + + /** + * TrainProcessorVersionRequest processorVersion. + * @member {google.cloud.documentai.v1.IProcessorVersion|null|undefined} processorVersion + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.processorVersion = null; + + /** + * TrainProcessorVersionRequest documentSchema. + * @member {google.cloud.documentai.v1.IDocumentSchema|null|undefined} documentSchema + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.documentSchema = null; + + /** + * TrainProcessorVersionRequest inputData. + * @member {google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData|null|undefined} inputData + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.inputData = null; + + /** + * TrainProcessorVersionRequest baseProcessorVersion. + * @member {string} baseProcessorVersion + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.baseProcessorVersion = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TrainProcessorVersionRequest processorFlags. + * @member {"customDocumentExtractionOptions"|"foundationModelTuningOptions"|undefined} processorFlags + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @instance + */ + Object.defineProperty(TrainProcessorVersionRequest.prototype, "processorFlags", { + get: $util.oneOfGetter($oneOfFields = ["customDocumentExtractionOptions", "foundationModelTuningOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TrainProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.ITrainProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest} TrainProcessorVersionRequest instance + */ + TrainProcessorVersionRequest.create = function create(properties) { + return new TrainProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified TrainProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.ITrainProcessorVersionRequest} message TrainProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainProcessorVersionRequest.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.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) + $root.google.cloud.documentai.v1.ProcessorVersion.encode(message.processorVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inputData != null && Object.hasOwnProperty.call(message, "inputData")) + $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.encode(message.inputData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.customDocumentExtractionOptions != null && Object.hasOwnProperty.call(message, "customDocumentExtractionOptions")) + $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.encode(message.customDocumentExtractionOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.baseProcessorVersion != null && Object.hasOwnProperty.call(message, "baseProcessorVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.baseProcessorVersion); + if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) + $root.google.cloud.documentai.v1.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.foundationModelTuningOptions != null && Object.hasOwnProperty.call(message, "foundationModelTuningOptions")) + $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.encode(message.foundationModelTuningOptions, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrainProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.ITrainProcessorVersionRequest} message TrainProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @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.TrainProcessorVersionRequest} TrainProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainProcessorVersionRequest.decode = function decode(reader, 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.TrainProcessorVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.customDocumentExtractionOptions = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.decode(reader, reader.uint32()); + break; + } + case 12: { + message.foundationModelTuningOptions = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.processorVersion = $root.google.cloud.documentai.v1.ProcessorVersion.decode(reader, reader.uint32()); + break; + } + case 10: { + message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.inputData = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.decode(reader, reader.uint32()); + break; + } + case 8: { + message.baseProcessorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest} TrainProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainProcessorVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.customDocumentExtractionOptions != null && message.hasOwnProperty("customDocumentExtractionOptions")) { + properties.processorFlags = 1; + { + var error = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify(message.customDocumentExtractionOptions); + if (error) + return "customDocumentExtractionOptions." + error; + } + } + if (message.foundationModelTuningOptions != null && message.hasOwnProperty("foundationModelTuningOptions")) { + if (properties.processorFlags === 1) + return "processorFlags: multiple values"; + properties.processorFlags = 1; + { + var error = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify(message.foundationModelTuningOptions); + if (error) + return "foundationModelTuningOptions." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) { + var error = $root.google.cloud.documentai.v1.ProcessorVersion.verify(message.processorVersion); + if (error) + return "processorVersion." + error; + } + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) { + var error = $root.google.cloud.documentai.v1.DocumentSchema.verify(message.documentSchema); + if (error) + return "documentSchema." + error; + } + if (message.inputData != null && message.hasOwnProperty("inputData")) { + var error = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.verify(message.inputData); + if (error) + return "inputData." + error; + } + if (message.baseProcessorVersion != null && message.hasOwnProperty("baseProcessorVersion")) + if (!$util.isString(message.baseProcessorVersion)) + return "baseProcessorVersion: string expected"; + return null; + }; + + /** + * Creates a TrainProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest} TrainProcessorVersionRequest + */ + TrainProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionRequest(); + if (object.customDocumentExtractionOptions != null) { + if (typeof object.customDocumentExtractionOptions !== "object") + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.customDocumentExtractionOptions: object expected"); + message.customDocumentExtractionOptions = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.fromObject(object.customDocumentExtractionOptions); + } + if (object.foundationModelTuningOptions != null) { + if (typeof object.foundationModelTuningOptions !== "object") + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.foundationModelTuningOptions: object expected"); + message.foundationModelTuningOptions = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.fromObject(object.foundationModelTuningOptions); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.processorVersion != null) { + if (typeof object.processorVersion !== "object") + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.processorVersion: object expected"); + message.processorVersion = $root.google.cloud.documentai.v1.ProcessorVersion.fromObject(object.processorVersion); + } + if (object.documentSchema != null) { + if (typeof object.documentSchema !== "object") + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.documentSchema: object expected"); + message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.fromObject(object.documentSchema); + } + if (object.inputData != null) { + if (typeof object.inputData !== "object") + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.inputData: object expected"); + message.inputData = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.fromObject(object.inputData); + } + if (object.baseProcessorVersion != null) + message.baseProcessorVersion = String(object.baseProcessorVersion); + return message; + }; + + /** + * Creates a plain object from a TrainProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest} message TrainProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainProcessorVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.processorVersion = null; + object.inputData = null; + object.baseProcessorVersion = ""; + object.documentSchema = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + object.processorVersion = $root.google.cloud.documentai.v1.ProcessorVersion.toObject(message.processorVersion, options); + if (message.inputData != null && message.hasOwnProperty("inputData")) + object.inputData = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.toObject(message.inputData, options); + if (message.customDocumentExtractionOptions != null && message.hasOwnProperty("customDocumentExtractionOptions")) { + object.customDocumentExtractionOptions = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.toObject(message.customDocumentExtractionOptions, options); + if (options.oneofs) + object.processorFlags = "customDocumentExtractionOptions"; + } + if (message.baseProcessorVersion != null && message.hasOwnProperty("baseProcessorVersion")) + object.baseProcessorVersion = message.baseProcessorVersion; + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) + object.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.toObject(message.documentSchema, options); + if (message.foundationModelTuningOptions != null && message.hasOwnProperty("foundationModelTuningOptions")) { + object.foundationModelTuningOptions = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.toObject(message.foundationModelTuningOptions, options); + if (options.oneofs) + object.processorFlags = "foundationModelTuningOptions"; + } + return object; + }; + + /** + * Converts this TrainProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + TrainProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrainProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrainProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionRequest"; + }; + + TrainProcessorVersionRequest.InputData = (function() { + + /** + * Properties of an InputData. + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @interface IInputData + * @property {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null} [trainingDocuments] InputData trainingDocuments + * @property {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null} [testDocuments] InputData testDocuments + */ + + /** + * Constructs a new InputData. + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @classdesc Represents an InputData. + * @implements IInputData + * @constructor + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData=} [properties] Properties to set + */ + function InputData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputData trainingDocuments. + * @member {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null|undefined} trainingDocuments + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + * @instance + */ + InputData.prototype.trainingDocuments = null; + + /** + * InputData testDocuments. + * @member {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null|undefined} testDocuments + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + * @instance + */ + InputData.prototype.testDocuments = null; + + /** + * Creates a new InputData instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData} InputData instance + */ + InputData.create = function create(properties) { + return new InputData(properties); + }; + + /** + * Encodes the specified InputData message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData} message InputData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trainingDocuments != null && Object.hasOwnProperty.call(message, "trainingDocuments")) + $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.encode(message.trainingDocuments, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.testDocuments != null && Object.hasOwnProperty.call(message, "testDocuments")) + $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.encode(message.testDocuments, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputData message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData} message InputData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + * @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.TrainProcessorVersionRequest.InputData} InputData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputData.decode = function decode(reader, 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.TrainProcessorVersionRequest.InputData(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.trainingDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.testDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData} InputData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputData message. + * @function verify + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trainingDocuments != null && message.hasOwnProperty("trainingDocuments")) { + var error = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.verify(message.trainingDocuments); + if (error) + return "trainingDocuments." + error; + } + if (message.testDocuments != null && message.hasOwnProperty("testDocuments")) { + var error = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.verify(message.testDocuments); + if (error) + return "testDocuments." + error; + } + return null; + }; + + /** + * Creates an InputData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData} InputData + */ + InputData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData) + return object; + var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData(); + if (object.trainingDocuments != null) { + if (typeof object.trainingDocuments !== "object") + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.trainingDocuments: object expected"); + message.trainingDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.fromObject(object.trainingDocuments); + } + if (object.testDocuments != null) { + if (typeof object.testDocuments !== "object") + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.testDocuments: object expected"); + message.testDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.fromObject(object.testDocuments); + } + return message; + }; + + /** + * Creates a plain object from an InputData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData} message InputData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.trainingDocuments = null; + object.testDocuments = null; + } + if (message.trainingDocuments != null && message.hasOwnProperty("trainingDocuments")) + object.trainingDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.toObject(message.trainingDocuments, options); + if (message.testDocuments != null && message.hasOwnProperty("testDocuments")) + object.testDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.toObject(message.testDocuments, options); + return object; + }; + + /** + * Converts this InputData to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + * @instance + * @returns {Object.} JSON object + */ + InputData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputData + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData"; + }; + + return InputData; + })(); + + TrainProcessorVersionRequest.CustomDocumentExtractionOptions = (function() { + + /** + * Properties of a CustomDocumentExtractionOptions. + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @interface ICustomDocumentExtractionOptions + * @property {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|null} [trainingMethod] CustomDocumentExtractionOptions trainingMethod + */ + + /** + * Constructs a new CustomDocumentExtractionOptions. + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @classdesc Represents a CustomDocumentExtractionOptions. + * @implements ICustomDocumentExtractionOptions + * @constructor + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions=} [properties] Properties to set + */ + function CustomDocumentExtractionOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomDocumentExtractionOptions trainingMethod. + * @member {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod} trainingMethod + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @instance + */ + CustomDocumentExtractionOptions.prototype.trainingMethod = 0; + + /** + * Creates a new CustomDocumentExtractionOptions instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions instance + */ + CustomDocumentExtractionOptions.create = function create(properties) { + return new CustomDocumentExtractionOptions(properties); + }; + + /** + * Encodes the specified CustomDocumentExtractionOptions message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions} message CustomDocumentExtractionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomDocumentExtractionOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trainingMethod != null && Object.hasOwnProperty.call(message, "trainingMethod")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.trainingMethod); + return writer; + }; + + /** + * Encodes the specified CustomDocumentExtractionOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions} message CustomDocumentExtractionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomDocumentExtractionOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @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.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomDocumentExtractionOptions.decode = function decode(reader, 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.TrainProcessorVersionRequest.CustomDocumentExtractionOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.trainingMethod = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomDocumentExtractionOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomDocumentExtractionOptions message. + * @function verify + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomDocumentExtractionOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trainingMethod != null && message.hasOwnProperty("trainingMethod")) + switch (message.trainingMethod) { + default: + return "trainingMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a CustomDocumentExtractionOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions + */ + CustomDocumentExtractionOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions) + return object; + var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions(); + switch (object.trainingMethod) { + default: + if (typeof object.trainingMethod === "number") { + message.trainingMethod = object.trainingMethod; + break; + } + break; + case "TRAINING_METHOD_UNSPECIFIED": + case 0: + message.trainingMethod = 0; + break; + case "MODEL_BASED": + case 1: + message.trainingMethod = 1; + break; + case "TEMPLATE_BASED": + case 2: + message.trainingMethod = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CustomDocumentExtractionOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} message CustomDocumentExtractionOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomDocumentExtractionOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.trainingMethod = options.enums === String ? "TRAINING_METHOD_UNSPECIFIED" : 0; + if (message.trainingMethod != null && message.hasOwnProperty("trainingMethod")) + object.trainingMethod = options.enums === String ? $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod[message.trainingMethod] === undefined ? message.trainingMethod : $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod[message.trainingMethod] : message.trainingMethod; + return object; + }; + + /** + * Converts this CustomDocumentExtractionOptions to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @instance + * @returns {Object.} JSON object + */ + CustomDocumentExtractionOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomDocumentExtractionOptions + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomDocumentExtractionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions"; + }; + + /** + * TrainingMethod enum. + * @name google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod + * @enum {number} + * @property {number} TRAINING_METHOD_UNSPECIFIED=0 TRAINING_METHOD_UNSPECIFIED value + * @property {number} MODEL_BASED=1 MODEL_BASED value + * @property {number} TEMPLATE_BASED=2 TEMPLATE_BASED value + */ + CustomDocumentExtractionOptions.TrainingMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRAINING_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODEL_BASED"] = 1; + values[valuesById[2] = "TEMPLATE_BASED"] = 2; + return values; + })(); + + return CustomDocumentExtractionOptions; + })(); + + TrainProcessorVersionRequest.FoundationModelTuningOptions = (function() { + + /** + * Properties of a FoundationModelTuningOptions. + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @interface IFoundationModelTuningOptions + * @property {number|null} [trainSteps] FoundationModelTuningOptions trainSteps + * @property {number|null} [learningRateMultiplier] FoundationModelTuningOptions learningRateMultiplier + */ + + /** + * Constructs a new FoundationModelTuningOptions. + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest + * @classdesc Represents a FoundationModelTuningOptions. + * @implements IFoundationModelTuningOptions + * @constructor + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions=} [properties] Properties to set + */ + function FoundationModelTuningOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FoundationModelTuningOptions trainSteps. + * @member {number} trainSteps + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @instance + */ + FoundationModelTuningOptions.prototype.trainSteps = 0; + + /** + * FoundationModelTuningOptions learningRateMultiplier. + * @member {number} learningRateMultiplier + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @instance + */ + FoundationModelTuningOptions.prototype.learningRateMultiplier = 0; + + /** + * Creates a new FoundationModelTuningOptions instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions instance + */ + FoundationModelTuningOptions.create = function create(properties) { + return new FoundationModelTuningOptions(properties); + }; + + /** + * Encodes the specified FoundationModelTuningOptions message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions} message FoundationModelTuningOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FoundationModelTuningOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trainSteps != null && Object.hasOwnProperty.call(message, "trainSteps")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.trainSteps); + if (message.learningRateMultiplier != null && Object.hasOwnProperty.call(message, "learningRateMultiplier")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.learningRateMultiplier); + return writer; + }; + + /** + * Encodes the specified FoundationModelTuningOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions} message FoundationModelTuningOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FoundationModelTuningOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FoundationModelTuningOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @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.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FoundationModelTuningOptions.decode = function decode(reader, 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.TrainProcessorVersionRequest.FoundationModelTuningOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.trainSteps = reader.int32(); + break; + } + case 3: { + message.learningRateMultiplier = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FoundationModelTuningOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FoundationModelTuningOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FoundationModelTuningOptions message. + * @function verify + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FoundationModelTuningOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trainSteps != null && message.hasOwnProperty("trainSteps")) + if (!$util.isInteger(message.trainSteps)) + return "trainSteps: integer expected"; + if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) + if (typeof message.learningRateMultiplier !== "number") + return "learningRateMultiplier: number expected"; + return null; + }; + + /** + * Creates a FoundationModelTuningOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions + */ + FoundationModelTuningOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions) + return object; + var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions(); + if (object.trainSteps != null) + message.trainSteps = object.trainSteps | 0; + if (object.learningRateMultiplier != null) + message.learningRateMultiplier = Number(object.learningRateMultiplier); + return message; + }; + + /** + * Creates a plain object from a FoundationModelTuningOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions} message FoundationModelTuningOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FoundationModelTuningOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.trainSteps = 0; + object.learningRateMultiplier = 0; + } + if (message.trainSteps != null && message.hasOwnProperty("trainSteps")) + object.trainSteps = message.trainSteps; + if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) + object.learningRateMultiplier = options.json && !isFinite(message.learningRateMultiplier) ? String(message.learningRateMultiplier) : message.learningRateMultiplier; + return object; + }; + + /** + * Converts this FoundationModelTuningOptions to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @instance + * @returns {Object.} JSON object + */ + FoundationModelTuningOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FoundationModelTuningOptions + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FoundationModelTuningOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions"; + }; + + return FoundationModelTuningOptions; + })(); + + return TrainProcessorVersionRequest; + })(); + + v1.TrainProcessorVersionResponse = (function() { + + /** + * Properties of a TrainProcessorVersionResponse. + * @memberof google.cloud.documentai.v1 + * @interface ITrainProcessorVersionResponse + * @property {string|null} [processorVersion] TrainProcessorVersionResponse processorVersion + */ + + /** + * Constructs a new TrainProcessorVersionResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a TrainProcessorVersionResponse. + * @implements ITrainProcessorVersionResponse + * @constructor + * @param {google.cloud.documentai.v1.ITrainProcessorVersionResponse=} [properties] Properties to set + */ + function TrainProcessorVersionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainProcessorVersionResponse processorVersion. + * @member {string} processorVersion + * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse + * @instance + */ + TrainProcessorVersionResponse.prototype.processorVersion = ""; + + /** + * Creates a new TrainProcessorVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.ITrainProcessorVersionResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.TrainProcessorVersionResponse} TrainProcessorVersionResponse instance + */ + TrainProcessorVersionResponse.create = function create(properties) { + return new TrainProcessorVersionResponse(properties); + }; + + /** + * Encodes the specified TrainProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.ITrainProcessorVersionResponse} message TrainProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainProcessorVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorVersion); + return writer; + }; + + /** + * Encodes the specified TrainProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.ITrainProcessorVersionResponse} message TrainProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse + * @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.TrainProcessorVersionResponse} TrainProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainProcessorVersionResponse.decode = function decode(reader, 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.TrainProcessorVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.processorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.TrainProcessorVersionResponse} TrainProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainProcessorVersionResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainProcessorVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + if (!$util.isString(message.processorVersion)) + return "processorVersion: string expected"; + return null; + }; + + /** + * Creates a TrainProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.TrainProcessorVersionResponse} TrainProcessorVersionResponse + */ + TrainProcessorVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionResponse) + return object; + var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionResponse(); + if (object.processorVersion != null) + message.processorVersion = String(object.processorVersion); + return message; + }; + + /** + * Creates a plain object from a TrainProcessorVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionResponse} message TrainProcessorVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainProcessorVersionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.processorVersion = ""; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + object.processorVersion = message.processorVersion; + return object; + }; + + /** + * Converts this TrainProcessorVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse + * @instance + * @returns {Object.} JSON object + */ + TrainProcessorVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrainProcessorVersionResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrainProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionResponse"; + }; + + return TrainProcessorVersionResponse; + })(); + + v1.TrainProcessorVersionMetadata = (function() { + + /** + * Properties of a TrainProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1 + * @interface ITrainProcessorVersionMetadata + * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] TrainProcessorVersionMetadata commonMetadata + * @property {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null} [trainingDatasetValidation] TrainProcessorVersionMetadata trainingDatasetValidation + * @property {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null} [testDatasetValidation] TrainProcessorVersionMetadata testDatasetValidation + */ + + /** + * Constructs a new TrainProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a TrainProcessorVersionMetadata. + * @implements ITrainProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1.ITrainProcessorVersionMetadata=} [properties] Properties to set + */ + function TrainProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @instance + */ + TrainProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * TrainProcessorVersionMetadata trainingDatasetValidation. + * @member {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null|undefined} trainingDatasetValidation + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @instance + */ + TrainProcessorVersionMetadata.prototype.trainingDatasetValidation = null; + + /** + * TrainProcessorVersionMetadata testDatasetValidation. + * @member {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null|undefined} testDatasetValidation + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @instance + */ + TrainProcessorVersionMetadata.prototype.testDatasetValidation = null; + + /** + * Creates a new TrainProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.ITrainProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata instance + */ + TrainProcessorVersionMetadata.create = function create(properties) { + return new TrainProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified TrainProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.ITrainProcessorVersionMetadata} message TrainProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.trainingDatasetValidation != null && Object.hasOwnProperty.call(message, "trainingDatasetValidation")) + $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.encode(message.trainingDatasetValidation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.testDatasetValidation != null && Object.hasOwnProperty.call(message, "testDatasetValidation")) + $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.encode(message.testDatasetValidation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrainProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.ITrainProcessorVersionMetadata} message TrainProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @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.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainProcessorVersionMetadata.decode = function decode(reader, 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.TrainProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.trainingDatasetValidation = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.testDatasetValidation = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + if (message.trainingDatasetValidation != null && message.hasOwnProperty("trainingDatasetValidation")) { + var error = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.verify(message.trainingDatasetValidation); + if (error) + return "trainingDatasetValidation." + error; + } + if (message.testDatasetValidation != null && message.hasOwnProperty("testDatasetValidation")) { + var error = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.verify(message.testDatasetValidation); + if (error) + return "testDatasetValidation." + error; + } + return null; + }; + + /** + * Creates a TrainProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata + */ + TrainProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); + } + if (object.trainingDatasetValidation != null) { + if (typeof object.trainingDatasetValidation !== "object") + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.trainingDatasetValidation: object expected"); + message.trainingDatasetValidation = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.fromObject(object.trainingDatasetValidation); + } + if (object.testDatasetValidation != null) { + if (typeof object.testDatasetValidation !== "object") + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.testDatasetValidation: object expected"); + message.testDatasetValidation = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.fromObject(object.testDatasetValidation); + } + return message; + }; + + /** + * Creates a plain object from a TrainProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionMetadata} message TrainProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.commonMetadata = null; + object.trainingDatasetValidation = null; + object.testDatasetValidation = null; + } + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); + if (message.trainingDatasetValidation != null && message.hasOwnProperty("trainingDatasetValidation")) + object.trainingDatasetValidation = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.toObject(message.trainingDatasetValidation, options); + if (message.testDatasetValidation != null && message.hasOwnProperty("testDatasetValidation")) + object.testDatasetValidation = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.toObject(message.testDatasetValidation, options); + return object; + }; + + /** + * Converts this TrainProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + TrainProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrainProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrainProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionMetadata"; + }; + + TrainProcessorVersionMetadata.DatasetValidation = (function() { + + /** + * Properties of a DatasetValidation. + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @interface IDatasetValidation + * @property {number|null} [documentErrorCount] DatasetValidation documentErrorCount + * @property {number|null} [datasetErrorCount] DatasetValidation datasetErrorCount + * @property {Array.|null} [documentErrors] DatasetValidation documentErrors + * @property {Array.|null} [datasetErrors] DatasetValidation datasetErrors + */ + + /** + * Constructs a new DatasetValidation. + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata + * @classdesc Represents a DatasetValidation. + * @implements IDatasetValidation + * @constructor + * @param {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation=} [properties] Properties to set + */ + function DatasetValidation(properties) { + this.documentErrors = []; + this.datasetErrors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatasetValidation documentErrorCount. + * @member {number} documentErrorCount + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @instance + */ + DatasetValidation.prototype.documentErrorCount = 0; + + /** + * DatasetValidation datasetErrorCount. + * @member {number} datasetErrorCount + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @instance + */ + DatasetValidation.prototype.datasetErrorCount = 0; + + /** + * DatasetValidation documentErrors. + * @member {Array.} documentErrors + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @instance + */ + DatasetValidation.prototype.documentErrors = $util.emptyArray; + + /** + * DatasetValidation datasetErrors. + * @member {Array.} datasetErrors + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @instance + */ + DatasetValidation.prototype.datasetErrors = $util.emptyArray; + + /** + * Creates a new DatasetValidation instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation instance + */ + DatasetValidation.create = function create(properties) { + return new DatasetValidation(properties); + }; + + /** + * Encodes the specified DatasetValidation message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation} message DatasetValidation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetValidation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentErrors != null && message.documentErrors.length) + for (var i = 0; i < message.documentErrors.length; ++i) + $root.google.rpc.Status.encode(message.documentErrors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.datasetErrors != null && message.datasetErrors.length) + for (var i = 0; i < message.datasetErrors.length; ++i) + $root.google.rpc.Status.encode(message.datasetErrors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.documentErrorCount != null && Object.hasOwnProperty.call(message, "documentErrorCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.documentErrorCount); + if (message.datasetErrorCount != null && Object.hasOwnProperty.call(message, "datasetErrorCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.datasetErrorCount); + return writer; + }; + + /** + * Encodes the specified DatasetValidation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation} message DatasetValidation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetValidation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatasetValidation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @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.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetValidation.decode = function decode(reader, 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.TrainProcessorVersionMetadata.DatasetValidation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.documentErrorCount = reader.int32(); + break; + } + case 4: { + message.datasetErrorCount = reader.int32(); + break; + } + case 1: { + if (!(message.documentErrors && message.documentErrors.length)) + message.documentErrors = []; + message.documentErrors.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.datasetErrors && message.datasetErrors.length)) + message.datasetErrors = []; + message.datasetErrors.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatasetValidation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetValidation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatasetValidation message. + * @function verify + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatasetValidation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentErrorCount != null && message.hasOwnProperty("documentErrorCount")) + if (!$util.isInteger(message.documentErrorCount)) + return "documentErrorCount: integer expected"; + if (message.datasetErrorCount != null && message.hasOwnProperty("datasetErrorCount")) + if (!$util.isInteger(message.datasetErrorCount)) + return "datasetErrorCount: integer expected"; + if (message.documentErrors != null && message.hasOwnProperty("documentErrors")) { + if (!Array.isArray(message.documentErrors)) + return "documentErrors: array expected"; + for (var i = 0; i < message.documentErrors.length; ++i) { + var error = $root.google.rpc.Status.verify(message.documentErrors[i]); + if (error) + return "documentErrors." + error; + } + } + if (message.datasetErrors != null && message.hasOwnProperty("datasetErrors")) { + if (!Array.isArray(message.datasetErrors)) + return "datasetErrors: array expected"; + for (var i = 0; i < message.datasetErrors.length; ++i) { + var error = $root.google.rpc.Status.verify(message.datasetErrors[i]); + if (error) + return "datasetErrors." + error; + } + } + return null; + }; + + /** + * Creates a DatasetValidation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation + */ + DatasetValidation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation) + return object; + var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation(); + if (object.documentErrorCount != null) + message.documentErrorCount = object.documentErrorCount | 0; + if (object.datasetErrorCount != null) + message.datasetErrorCount = object.datasetErrorCount | 0; + if (object.documentErrors) { + if (!Array.isArray(object.documentErrors)) + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.documentErrors: array expected"); + message.documentErrors = []; + for (var i = 0; i < object.documentErrors.length; ++i) { + if (typeof object.documentErrors[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.documentErrors: object expected"); + message.documentErrors[i] = $root.google.rpc.Status.fromObject(object.documentErrors[i]); + } + } + if (object.datasetErrors) { + if (!Array.isArray(object.datasetErrors)) + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.datasetErrors: array expected"); + message.datasetErrors = []; + for (var i = 0; i < object.datasetErrors.length; ++i) { + if (typeof object.datasetErrors[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.datasetErrors: object expected"); + message.datasetErrors[i] = $root.google.rpc.Status.fromObject(object.datasetErrors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DatasetValidation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation} message DatasetValidation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatasetValidation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.documentErrors = []; + object.datasetErrors = []; + } + if (options.defaults) { + object.documentErrorCount = 0; + object.datasetErrorCount = 0; + } + if (message.documentErrors && message.documentErrors.length) { + object.documentErrors = []; + for (var j = 0; j < message.documentErrors.length; ++j) + object.documentErrors[j] = $root.google.rpc.Status.toObject(message.documentErrors[j], options); + } + if (message.datasetErrors && message.datasetErrors.length) { + object.datasetErrors = []; + for (var j = 0; j < message.datasetErrors.length; ++j) + object.datasetErrors[j] = $root.google.rpc.Status.toObject(message.datasetErrors[j], options); + } + if (message.documentErrorCount != null && message.hasOwnProperty("documentErrorCount")) + object.documentErrorCount = message.documentErrorCount; + if (message.datasetErrorCount != null && message.hasOwnProperty("datasetErrorCount")) + object.datasetErrorCount = message.datasetErrorCount; + return object; + }; + + /** + * Converts this DatasetValidation to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @instance + * @returns {Object.} JSON object + */ + DatasetValidation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatasetValidation + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatasetValidation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation"; + }; + + return DatasetValidation; + })(); + + return TrainProcessorVersionMetadata; + })(); + + v1.ReviewDocumentRequest = (function() { + + /** + * Properties of a ReviewDocumentRequest. + * @memberof google.cloud.documentai.v1 + * @interface IReviewDocumentRequest + * @property {google.cloud.documentai.v1.IDocument|null} [inlineDocument] ReviewDocumentRequest inlineDocument + * @property {string|null} [humanReviewConfig] ReviewDocumentRequest humanReviewConfig + * @property {boolean|null} [enableSchemaValidation] ReviewDocumentRequest enableSchemaValidation + * @property {google.cloud.documentai.v1.ReviewDocumentRequest.Priority|null} [priority] ReviewDocumentRequest priority + * @property {google.cloud.documentai.v1.IDocumentSchema|null} [documentSchema] ReviewDocumentRequest documentSchema + */ + + /** + * Constructs a new ReviewDocumentRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ReviewDocumentRequest. + * @implements IReviewDocumentRequest + * @constructor + * @param {google.cloud.documentai.v1.IReviewDocumentRequest=} [properties] Properties to set + */ + function ReviewDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReviewDocumentRequest inlineDocument. + * @member {google.cloud.documentai.v1.IDocument|null|undefined} inlineDocument + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @instance + */ + ReviewDocumentRequest.prototype.inlineDocument = null; + + /** + * ReviewDocumentRequest humanReviewConfig. + * @member {string} humanReviewConfig + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @instance + */ + ReviewDocumentRequest.prototype.humanReviewConfig = ""; + + /** + * ReviewDocumentRequest enableSchemaValidation. + * @member {boolean} enableSchemaValidation + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @instance + */ + ReviewDocumentRequest.prototype.enableSchemaValidation = false; + + /** + * ReviewDocumentRequest priority. + * @member {google.cloud.documentai.v1.ReviewDocumentRequest.Priority} priority + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @instance + */ + ReviewDocumentRequest.prototype.priority = 0; + + /** + * ReviewDocumentRequest documentSchema. + * @member {google.cloud.documentai.v1.IDocumentSchema|null|undefined} documentSchema + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @instance + */ + ReviewDocumentRequest.prototype.documentSchema = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReviewDocumentRequest source. + * @member {"inlineDocument"|undefined} source + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @instance + */ + Object.defineProperty(ReviewDocumentRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["inlineDocument"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReviewDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @static + * @param {google.cloud.documentai.v1.IReviewDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ReviewDocumentRequest} ReviewDocumentRequest instance + */ + ReviewDocumentRequest.create = function create(properties) { + return new ReviewDocumentRequest(properties); + }; + + /** + * Encodes the specified ReviewDocumentRequest message. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @static + * @param {google.cloud.documentai.v1.IReviewDocumentRequest} message ReviewDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReviewDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.humanReviewConfig != null && Object.hasOwnProperty.call(message, "humanReviewConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.humanReviewConfig); + if (message.enableSchemaValidation != null && Object.hasOwnProperty.call(message, "enableSchemaValidation")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableSchemaValidation); + if (message.inlineDocument != null && Object.hasOwnProperty.call(message, "inlineDocument")) + $root.google.cloud.documentai.v1.Document.encode(message.inlineDocument, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.priority); + if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) + $root.google.cloud.documentai.v1.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReviewDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @static + * @param {google.cloud.documentai.v1.IReviewDocumentRequest} message ReviewDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReviewDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReviewDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @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.ReviewDocumentRequest} ReviewDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReviewDocumentRequest.decode = function decode(reader, 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.ReviewDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.inlineDocument = $root.google.cloud.documentai.v1.Document.decode(reader, reader.uint32()); + break; + } + case 1: { + message.humanReviewConfig = reader.string(); + break; + } + case 3: { + message.enableSchemaValidation = reader.bool(); + break; + } + case 5: { + message.priority = reader.int32(); + break; + } + case 6: { + message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReviewDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ReviewDocumentRequest} ReviewDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReviewDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReviewDocumentRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReviewDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1.Document.verify(message.inlineDocument); + if (error) + return "inlineDocument." + error; + } + } + if (message.humanReviewConfig != null && message.hasOwnProperty("humanReviewConfig")) + if (!$util.isString(message.humanReviewConfig)) + return "humanReviewConfig: string expected"; + if (message.enableSchemaValidation != null && message.hasOwnProperty("enableSchemaValidation")) + if (typeof message.enableSchemaValidation !== "boolean") + return "enableSchemaValidation: boolean expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + switch (message.priority) { + default: + return "priority: enum value expected"; + case 0: + case 1: + break; + } + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) { + var error = $root.google.cloud.documentai.v1.DocumentSchema.verify(message.documentSchema); + if (error) + return "documentSchema." + error; + } + return null; + }; + + /** + * Creates a ReviewDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ReviewDocumentRequest} ReviewDocumentRequest + */ + ReviewDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ReviewDocumentRequest) + return object; + var message = new $root.google.cloud.documentai.v1.ReviewDocumentRequest(); + if (object.inlineDocument != null) { + if (typeof object.inlineDocument !== "object") + throw TypeError(".google.cloud.documentai.v1.ReviewDocumentRequest.inlineDocument: object expected"); + message.inlineDocument = $root.google.cloud.documentai.v1.Document.fromObject(object.inlineDocument); + } + if (object.humanReviewConfig != null) + message.humanReviewConfig = String(object.humanReviewConfig); + if (object.enableSchemaValidation != null) + message.enableSchemaValidation = Boolean(object.enableSchemaValidation); + switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; + case "DEFAULT": + case 0: + message.priority = 0; + break; + case "URGENT": + case 1: + message.priority = 1; + break; + } + if (object.documentSchema != null) { + if (typeof object.documentSchema !== "object") + throw TypeError(".google.cloud.documentai.v1.ReviewDocumentRequest.documentSchema: object expected"); + message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.fromObject(object.documentSchema); + } + return message; + }; + + /** + * Creates a plain object from a ReviewDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @static + * @param {google.cloud.documentai.v1.ReviewDocumentRequest} message ReviewDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReviewDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.humanReviewConfig = ""; + object.enableSchemaValidation = false; + object.priority = options.enums === String ? "DEFAULT" : 0; + object.documentSchema = null; + } + if (message.humanReviewConfig != null && message.hasOwnProperty("humanReviewConfig")) + object.humanReviewConfig = message.humanReviewConfig; + if (message.enableSchemaValidation != null && message.hasOwnProperty("enableSchemaValidation")) + object.enableSchemaValidation = message.enableSchemaValidation; + if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { + object.inlineDocument = $root.google.cloud.documentai.v1.Document.toObject(message.inlineDocument, options); + if (options.oneofs) + object.source = "inlineDocument"; + } + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = options.enums === String ? $root.google.cloud.documentai.v1.ReviewDocumentRequest.Priority[message.priority] === undefined ? message.priority : $root.google.cloud.documentai.v1.ReviewDocumentRequest.Priority[message.priority] : message.priority; + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) + object.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.toObject(message.documentSchema, options); + return object; + }; + + /** + * Converts this ReviewDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + ReviewDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReviewDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ReviewDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReviewDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ReviewDocumentRequest"; + }; + + /** + * Priority enum. + * @name google.cloud.documentai.v1.ReviewDocumentRequest.Priority + * @enum {number} + * @property {number} DEFAULT=0 DEFAULT value + * @property {number} URGENT=1 URGENT value + */ + ReviewDocumentRequest.Priority = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "URGENT"] = 1; + return values; + })(); + + return ReviewDocumentRequest; + })(); + + v1.ReviewDocumentResponse = (function() { + + /** + * Properties of a ReviewDocumentResponse. + * @memberof google.cloud.documentai.v1 + * @interface IReviewDocumentResponse + * @property {string|null} [gcsDestination] ReviewDocumentResponse gcsDestination + * @property {google.cloud.documentai.v1.ReviewDocumentResponse.State|null} [state] ReviewDocumentResponse state + * @property {string|null} [rejectionReason] ReviewDocumentResponse rejectionReason + */ + + /** + * Constructs a new ReviewDocumentResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ReviewDocumentResponse. + * @implements IReviewDocumentResponse + * @constructor + * @param {google.cloud.documentai.v1.IReviewDocumentResponse=} [properties] Properties to set + */ + function ReviewDocumentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReviewDocumentResponse gcsDestination. + * @member {string} gcsDestination + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @instance + */ + ReviewDocumentResponse.prototype.gcsDestination = ""; + + /** + * ReviewDocumentResponse state. + * @member {google.cloud.documentai.v1.ReviewDocumentResponse.State} state + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @instance + */ + ReviewDocumentResponse.prototype.state = 0; + + /** + * ReviewDocumentResponse rejectionReason. + * @member {string} rejectionReason + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @instance + */ + ReviewDocumentResponse.prototype.rejectionReason = ""; + + /** + * Creates a new ReviewDocumentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @static + * @param {google.cloud.documentai.v1.IReviewDocumentResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ReviewDocumentResponse} ReviewDocumentResponse instance + */ + ReviewDocumentResponse.create = function create(properties) { + return new ReviewDocumentResponse(properties); + }; + + /** + * Encodes the specified ReviewDocumentResponse message. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @static + * @param {google.cloud.documentai.v1.IReviewDocumentResponse} message ReviewDocumentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReviewDocumentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsDestination); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.rejectionReason != null && Object.hasOwnProperty.call(message, "rejectionReason")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.rejectionReason); + return writer; + }; + + /** + * Encodes the specified ReviewDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @static + * @param {google.cloud.documentai.v1.IReviewDocumentResponse} message ReviewDocumentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReviewDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReviewDocumentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @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.ReviewDocumentResponse} ReviewDocumentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReviewDocumentResponse.decode = function decode(reader, 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.ReviewDocumentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsDestination = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.rejectionReason = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReviewDocumentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ReviewDocumentResponse} ReviewDocumentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReviewDocumentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReviewDocumentResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReviewDocumentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + if (!$util.isString(message.gcsDestination)) + return "gcsDestination: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.rejectionReason != null && message.hasOwnProperty("rejectionReason")) + if (!$util.isString(message.rejectionReason)) + return "rejectionReason: string expected"; + return null; + }; + + /** + * Creates a ReviewDocumentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ReviewDocumentResponse} ReviewDocumentResponse + */ + ReviewDocumentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ReviewDocumentResponse) + return object; + var message = new $root.google.cloud.documentai.v1.ReviewDocumentResponse(); + if (object.gcsDestination != null) + message.gcsDestination = String(object.gcsDestination); + 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 "REJECTED": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + } + if (object.rejectionReason != null) + message.rejectionReason = String(object.rejectionReason); + return message; + }; + + /** + * Creates a plain object from a ReviewDocumentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @static + * @param {google.cloud.documentai.v1.ReviewDocumentResponse} message ReviewDocumentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReviewDocumentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsDestination = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.rejectionReason = ""; + } + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + object.gcsDestination = message.gcsDestination; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1.ReviewDocumentResponse.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.ReviewDocumentResponse.State[message.state] : message.state; + if (message.rejectionReason != null && message.hasOwnProperty("rejectionReason")) + object.rejectionReason = message.rejectionReason; + return object; + }; + + /** + * Converts this ReviewDocumentResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @instance + * @returns {Object.} JSON object + */ + ReviewDocumentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReviewDocumentResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ReviewDocumentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReviewDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ReviewDocumentResponse"; + }; + + /** + * State enum. + * @name google.cloud.documentai.v1.ReviewDocumentResponse.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} REJECTED=1 REJECTED value + * @property {number} SUCCEEDED=2 SUCCEEDED value + */ + ReviewDocumentResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REJECTED"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + return values; + })(); + + return ReviewDocumentResponse; + })(); + + v1.ReviewDocumentOperationMetadata = (function() { + + /** + * Properties of a ReviewDocumentOperationMetadata. + * @memberof google.cloud.documentai.v1 + * @interface IReviewDocumentOperationMetadata + * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] ReviewDocumentOperationMetadata commonMetadata + * @property {string|null} [questionId] ReviewDocumentOperationMetadata questionId + */ + + /** + * Constructs a new ReviewDocumentOperationMetadata. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ReviewDocumentOperationMetadata. + * @implements IReviewDocumentOperationMetadata + * @constructor + * @param {google.cloud.documentai.v1.IReviewDocumentOperationMetadata=} [properties] Properties to set + */ + function ReviewDocumentOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReviewDocumentOperationMetadata commonMetadata. + * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata + * @instance + */ + ReviewDocumentOperationMetadata.prototype.commonMetadata = null; + + /** + * ReviewDocumentOperationMetadata questionId. + * @member {string} questionId + * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata + * @instance + */ + ReviewDocumentOperationMetadata.prototype.questionId = ""; + + /** + * Creates a new ReviewDocumentOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata + * @static + * @param {google.cloud.documentai.v1.IReviewDocumentOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata instance + */ + ReviewDocumentOperationMetadata.create = function create(properties) { + return new ReviewDocumentOperationMetadata(properties); + }; + + /** + * Encodes the specified ReviewDocumentOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata + * @static + * @param {google.cloud.documentai.v1.IReviewDocumentOperationMetadata} message ReviewDocumentOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReviewDocumentOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.questionId != null && Object.hasOwnProperty.call(message, "questionId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.questionId); + return writer; + }; + + /** + * Encodes the specified ReviewDocumentOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata + * @static + * @param {google.cloud.documentai.v1.IReviewDocumentOperationMetadata} message ReviewDocumentOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReviewDocumentOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata + * @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.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReviewDocumentOperationMetadata.decode = function decode(reader, 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.ReviewDocumentOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 6: { + message.questionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReviewDocumentOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReviewDocumentOperationMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReviewDocumentOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + if (message.questionId != null && message.hasOwnProperty("questionId")) + if (!$util.isString(message.questionId)) + return "questionId: string expected"; + return null; + }; + + /** + * Creates a ReviewDocumentOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata + */ + ReviewDocumentOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ReviewDocumentOperationMetadata) + return object; + var message = new $root.google.cloud.documentai.v1.ReviewDocumentOperationMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1.ReviewDocumentOperationMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); + } + if (object.questionId != null) + message.questionId = String(object.questionId); + return message; + }; + + /** + * Creates a plain object from a ReviewDocumentOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata + * @static + * @param {google.cloud.documentai.v1.ReviewDocumentOperationMetadata} message ReviewDocumentOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReviewDocumentOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.commonMetadata = null; + object.questionId = ""; + } + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); + if (message.questionId != null && message.hasOwnProperty("questionId")) + object.questionId = message.questionId; + return object; + }; + + /** + * Converts this ReviewDocumentOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ReviewDocumentOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReviewDocumentOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReviewDocumentOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ReviewDocumentOperationMetadata"; + }; + + return ReviewDocumentOperationMetadata; + })(); + + v1.EvaluateProcessorVersionRequest = (function() { + + /** + * Properties of an EvaluateProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @interface IEvaluateProcessorVersionRequest + * @property {string|null} [processorVersion] EvaluateProcessorVersionRequest processorVersion + * @property {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null} [evaluationDocuments] EvaluateProcessorVersionRequest evaluationDocuments + */ + + /** + * Constructs a new EvaluateProcessorVersionRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents an EvaluateProcessorVersionRequest. + * @implements IEvaluateProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionRequest=} [properties] Properties to set + */ + function EvaluateProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluateProcessorVersionRequest processorVersion. + * @member {string} processorVersion + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest + * @instance + */ + EvaluateProcessorVersionRequest.prototype.processorVersion = ""; + + /** + * EvaluateProcessorVersionRequest evaluationDocuments. + * @member {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null|undefined} evaluationDocuments + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest + * @instance + */ + EvaluateProcessorVersionRequest.prototype.evaluationDocuments = null; + + /** + * Creates a new EvaluateProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest instance + */ + EvaluateProcessorVersionRequest.create = function create(properties) { + return new EvaluateProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified EvaluateProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionRequest} message EvaluateProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateProcessorVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorVersion); + if (message.evaluationDocuments != null && Object.hasOwnProperty.call(message, "evaluationDocuments")) + $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.encode(message.evaluationDocuments, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluateProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionRequest} message EvaluateProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest + * @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.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateProcessorVersionRequest.decode = function decode(reader, 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.EvaluateProcessorVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.processorVersion = reader.string(); + break; + } + case 3: { + message.evaluationDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluateProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluateProcessorVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + if (!$util.isString(message.processorVersion)) + return "processorVersion: string expected"; + if (message.evaluationDocuments != null && message.hasOwnProperty("evaluationDocuments")) { + var error = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.verify(message.evaluationDocuments); + if (error) + return "evaluationDocuments." + error; + } + return null; + }; + + /** + * Creates an EvaluateProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest + */ + EvaluateProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.EvaluateProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1.EvaluateProcessorVersionRequest(); + if (object.processorVersion != null) + message.processorVersion = String(object.processorVersion); + if (object.evaluationDocuments != null) { + if (typeof object.evaluationDocuments !== "object") + throw TypeError(".google.cloud.documentai.v1.EvaluateProcessorVersionRequest.evaluationDocuments: object expected"); + message.evaluationDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.fromObject(object.evaluationDocuments); + } + return message; + }; + + /** + * Creates a plain object from an EvaluateProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1.EvaluateProcessorVersionRequest} message EvaluateProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluateProcessorVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.processorVersion = ""; + object.evaluationDocuments = null; + } + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + object.processorVersion = message.processorVersion; + if (message.evaluationDocuments != null && message.hasOwnProperty("evaluationDocuments")) + object.evaluationDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.toObject(message.evaluationDocuments, options); + return object; + }; + + /** + * Converts this EvaluateProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + EvaluateProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluateProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluateProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.EvaluateProcessorVersionRequest"; + }; + + return EvaluateProcessorVersionRequest; + })(); + + v1.EvaluateProcessorVersionMetadata = (function() { + + /** + * Properties of an EvaluateProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1 + * @interface IEvaluateProcessorVersionMetadata + * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] EvaluateProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new EvaluateProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents an EvaluateProcessorVersionMetadata. + * @implements IEvaluateProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata=} [properties] Properties to set + */ + function EvaluateProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluateProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + * @instance + */ + EvaluateProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new EvaluateProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata instance + */ + EvaluateProcessorVersionMetadata.create = function create(properties) { + return new EvaluateProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified EvaluateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata} message EvaluateProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata} message EvaluateProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + * @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.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateProcessorVersionMetadata.decode = function decode(reader, 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.EvaluateProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluateProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluateProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates an EvaluateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata + */ + EvaluateProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from an EvaluateProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1.EvaluateProcessorVersionMetadata} message EvaluateProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluateProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this EvaluateProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + EvaluateProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluateProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluateProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.EvaluateProcessorVersionMetadata"; + }; + + return EvaluateProcessorVersionMetadata; + })(); + + v1.EvaluateProcessorVersionResponse = (function() { + + /** + * Properties of an EvaluateProcessorVersionResponse. + * @memberof google.cloud.documentai.v1 + * @interface IEvaluateProcessorVersionResponse + * @property {string|null} [evaluation] EvaluateProcessorVersionResponse evaluation + */ + + /** + * Constructs a new EvaluateProcessorVersionResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents an EvaluateProcessorVersionResponse. + * @implements IEvaluateProcessorVersionResponse + * @constructor + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionResponse=} [properties] Properties to set + */ + function EvaluateProcessorVersionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluateProcessorVersionResponse evaluation. + * @member {string} evaluation + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse + * @instance + */ + EvaluateProcessorVersionResponse.prototype.evaluation = ""; + + /** + * Creates a new EvaluateProcessorVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse instance + */ + EvaluateProcessorVersionResponse.create = function create(properties) { + return new EvaluateProcessorVersionResponse(properties); + }; + + /** + * Encodes the specified EvaluateProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionResponse} message EvaluateProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateProcessorVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluation); + return writer; + }; + + /** + * Encodes the specified EvaluateProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionResponse} message EvaluateProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse + * @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.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateProcessorVersionResponse.decode = function decode(reader, 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.EvaluateProcessorVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.evaluation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluateProcessorVersionResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluateProcessorVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) + if (!$util.isString(message.evaluation)) + return "evaluation: string expected"; + return null; + }; + + /** + * Creates an EvaluateProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse + */ + EvaluateProcessorVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.EvaluateProcessorVersionResponse) + return object; + var message = new $root.google.cloud.documentai.v1.EvaluateProcessorVersionResponse(); + if (object.evaluation != null) + message.evaluation = String(object.evaluation); + return message; + }; + + /** + * Creates a plain object from an EvaluateProcessorVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1.EvaluateProcessorVersionResponse} message EvaluateProcessorVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluateProcessorVersionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.evaluation = ""; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) + object.evaluation = message.evaluation; + return object; + }; + + /** + * Converts this EvaluateProcessorVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse + * @instance + * @returns {Object.} JSON object + */ + EvaluateProcessorVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluateProcessorVersionResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluateProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.EvaluateProcessorVersionResponse"; + }; + + return EvaluateProcessorVersionResponse; + })(); + + v1.GetEvaluationRequest = (function() { + + /** + * Properties of a GetEvaluationRequest. + * @memberof google.cloud.documentai.v1 + * @interface IGetEvaluationRequest + * @property {string|null} [name] GetEvaluationRequest name + */ + + /** + * Constructs a new GetEvaluationRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a GetEvaluationRequest. + * @implements IGetEvaluationRequest + * @constructor + * @param {google.cloud.documentai.v1.IGetEvaluationRequest=} [properties] Properties to set + */ + function GetEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1.GetEvaluationRequest + * @instance + */ + GetEvaluationRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.GetEvaluationRequest + * @static + * @param {google.cloud.documentai.v1.IGetEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.GetEvaluationRequest} GetEvaluationRequest instance + */ + GetEvaluationRequest.create = function create(properties) { + return new GetEvaluationRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.GetEvaluationRequest + * @static + * @param {google.cloud.documentai.v1.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRequest.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 GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.GetEvaluationRequest + * @static + * @param {google.cloud.documentai.v1.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.GetEvaluationRequest + * @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.GetEvaluationRequest} GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRequest.decode = function decode(reader, 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.GetEvaluationRequest(); + 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 GetEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.GetEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.GetEvaluationRequest} GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.GetEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationRequest.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 GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.GetEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.GetEvaluationRequest} GetEvaluationRequest + */ + GetEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.GetEvaluationRequest) + return object; + var message = new $root.google.cloud.documentai.v1.GetEvaluationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.GetEvaluationRequest + * @static + * @param {google.cloud.documentai.v1.GetEvaluationRequest} message GetEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationRequest.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 GetEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.GetEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.GetEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.GetEvaluationRequest"; + }; + + return GetEvaluationRequest; + })(); + + v1.ListEvaluationsRequest = (function() { + + /** + * Properties of a ListEvaluationsRequest. + * @memberof google.cloud.documentai.v1 + * @interface IListEvaluationsRequest + * @property {string|null} [parent] ListEvaluationsRequest parent + * @property {number|null} [pageSize] ListEvaluationsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationsRequest pageToken + */ + + /** + * Constructs a new ListEvaluationsRequest. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ListEvaluationsRequest. + * @implements IListEvaluationsRequest + * @constructor + * @param {google.cloud.documentai.v1.IListEvaluationsRequest=} [properties] Properties to set + */ + function ListEvaluationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationsRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.parent = ""; + + /** + * ListEvaluationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEvaluationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @static + * @param {google.cloud.documentai.v1.IListEvaluationsRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ListEvaluationsRequest} ListEvaluationsRequest instance + */ + ListEvaluationsRequest.create = function create(properties) { + return new ListEvaluationsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @static + * @param {google.cloud.documentai.v1.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsRequest.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 ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @static + * @param {google.cloud.documentai.v1.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @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.ListEvaluationsRequest} ListEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsRequest.decode = function decode(reader, 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.ListEvaluationsRequest(); + 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 ListEvaluationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ListEvaluationsRequest} ListEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationsRequest message. + * @function verify + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationsRequest.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 ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ListEvaluationsRequest} ListEvaluationsRequest + */ + ListEvaluationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ListEvaluationsRequest) + return object; + var message = new $root.google.cloud.documentai.v1.ListEvaluationsRequest(); + 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 ListEvaluationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @static + * @param {google.cloud.documentai.v1.ListEvaluationsRequest} message ListEvaluationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationsRequest.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 ListEvaluationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationsRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ListEvaluationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ListEvaluationsRequest"; + }; + + return ListEvaluationsRequest; + })(); + + v1.ListEvaluationsResponse = (function() { + + /** + * Properties of a ListEvaluationsResponse. + * @memberof google.cloud.documentai.v1 + * @interface IListEvaluationsResponse + * @property {Array.|null} [evaluations] ListEvaluationsResponse evaluations + * @property {string|null} [nextPageToken] ListEvaluationsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationsResponse. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ListEvaluationsResponse. + * @implements IListEvaluationsResponse + * @constructor + * @param {google.cloud.documentai.v1.IListEvaluationsResponse=} [properties] Properties to set + */ + function ListEvaluationsResponse(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationsResponse evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.documentai.v1.ListEvaluationsResponse + * @instance + */ + ListEvaluationsResponse.prototype.evaluations = $util.emptyArray; + + /** + * ListEvaluationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.documentai.v1.ListEvaluationsResponse + * @instance + */ + ListEvaluationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ListEvaluationsResponse + * @static + * @param {google.cloud.documentai.v1.IListEvaluationsResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ListEvaluationsResponse} ListEvaluationsResponse instance + */ + ListEvaluationsResponse.create = function create(properties) { + return new ListEvaluationsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ListEvaluationsResponse + * @static + * @param {google.cloud.documentai.v1.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + $root.google.cloud.documentai.v1.Evaluation.encode(message.evaluations[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 ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ListEvaluationsResponse + * @static + * @param {google.cloud.documentai.v1.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ListEvaluationsResponse + * @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.ListEvaluationsResponse} ListEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsResponse.decode = function decode(reader, 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.ListEvaluationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push($root.google.cloud.documentai.v1.Evaluation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ListEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ListEvaluationsResponse} ListEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationsResponse message. + * @function verify + * @memberof google.cloud.documentai.v1.ListEvaluationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) { + var error = $root.google.cloud.documentai.v1.Evaluation.verify(message.evaluations[i]); + if (error) + return "evaluations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ListEvaluationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ListEvaluationsResponse} ListEvaluationsResponse + */ + ListEvaluationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ListEvaluationsResponse) + return object; + var message = new $root.google.cloud.documentai.v1.ListEvaluationsResponse(); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.documentai.v1.ListEvaluationsResponse.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) { + if (typeof object.evaluations[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.ListEvaluationsResponse.evaluations: object expected"); + message.evaluations[i] = $root.google.cloud.documentai.v1.Evaluation.fromObject(object.evaluations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ListEvaluationsResponse + * @static + * @param {google.cloud.documentai.v1.ListEvaluationsResponse} message ListEvaluationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = $root.google.cloud.documentai.v1.Evaluation.toObject(message.evaluations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ListEvaluationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationsResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ListEvaluationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ListEvaluationsResponse"; + }; + + return ListEvaluationsResponse; + })(); + + v1.DocumentSchema = (function() { + + /** + * Properties of a DocumentSchema. + * @memberof google.cloud.documentai.v1 + * @interface IDocumentSchema + * @property {string|null} [displayName] DocumentSchema displayName + * @property {string|null} [description] DocumentSchema description + * @property {Array.|null} [entityTypes] DocumentSchema entityTypes + * @property {google.cloud.documentai.v1.DocumentSchema.IMetadata|null} [metadata] DocumentSchema metadata + */ + + /** + * Constructs a new DocumentSchema. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a DocumentSchema. + * @implements IDocumentSchema + * @constructor + * @param {google.cloud.documentai.v1.IDocumentSchema=} [properties] Properties to set + */ + function DocumentSchema(properties) { + this.entityTypes = []; + if (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 displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1.DocumentSchema + * @instance + */ + DocumentSchema.prototype.displayName = ""; + + /** + * DocumentSchema description. + * @member {string} description + * @memberof google.cloud.documentai.v1.DocumentSchema + * @instance + */ + DocumentSchema.prototype.description = ""; + + /** + * DocumentSchema entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.documentai.v1.DocumentSchema + * @instance + */ + DocumentSchema.prototype.entityTypes = $util.emptyArray; + + /** + * DocumentSchema metadata. + * @member {google.cloud.documentai.v1.DocumentSchema.IMetadata|null|undefined} metadata + * @memberof google.cloud.documentai.v1.DocumentSchema + * @instance + */ + DocumentSchema.prototype.metadata = null; + + /** + * Creates a new DocumentSchema instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DocumentSchema + * @static + * @param {google.cloud.documentai.v1.IDocumentSchema=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DocumentSchema} DocumentSchema instance + */ + DocumentSchema.create = function create(properties) { + return new DocumentSchema(properties); + }; + + /** + * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DocumentSchema + * @static + * @param {google.cloud.documentai.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + $root.google.cloud.documentai.v1.DocumentSchema.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.documentai.v1.DocumentSchema.Metadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DocumentSchema + * @static + * @param {google.cloud.documentai.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.documentai.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.documentai.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.documentai.v1.DocumentSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push($root.google.cloud.documentai.v1.DocumentSchema.EntityType.decode(reader, reader.uint32())); + break; + } + case 4: { + message.metadata = $root.google.cloud.documentai.v1.DocumentSchema.Metadata.decode(reader, reader.uint32()); + 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.documentai.v1.DocumentSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.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.documentai.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) { + var error = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.verify(message.entityTypes[i]); + if (error) + return "entityTypes." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.documentai.v1.DocumentSchema.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a DocumentSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DocumentSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DocumentSchema} DocumentSchema + */ + DocumentSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DocumentSchema) + return object; + var message = new $root.google.cloud.documentai.v1.DocumentSchema(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.documentai.v1.DocumentSchema.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) { + if (typeof object.entityTypes[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.DocumentSchema.entityTypes: object expected"); + message.entityTypes[i] = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.fromObject(object.entityTypes[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.documentai.v1.DocumentSchema.metadata: object expected"); + message.metadata = $root.google.cloud.documentai.v1.DocumentSchema.Metadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a DocumentSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DocumentSchema + * @static + * @param {google.cloud.documentai.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.entityTypes = []; + if (options.defaults) { + object.displayName = ""; + object.description = ""; + object.metadata = null; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.toObject(message.entityTypes[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.documentai.v1.DocumentSchema.Metadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this DocumentSchema to JSON. + * @function toJSON + * @memberof google.cloud.documentai.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.documentai.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.documentai.v1.DocumentSchema"; + }; + + DocumentSchema.EntityType = (function() { + + /** + * Properties of an EntityType. + * @memberof google.cloud.documentai.v1.DocumentSchema + * @interface IEntityType + * @property {google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues|null} [enumValues] EntityType enumValues + * @property {string|null} [displayName] EntityType displayName + * @property {string|null} [name] EntityType name + * @property {Array.|null} [baseTypes] EntityType baseTypes + * @property {Array.|null} [properties] EntityType properties + */ + + /** + * Constructs a new EntityType. + * @memberof google.cloud.documentai.v1.DocumentSchema + * @classdesc Represents an EntityType. + * @implements IEntityType + * @constructor + * @param {google.cloud.documentai.v1.DocumentSchema.IEntityType=} [properties] Properties to set + */ + function EntityType(properties) { + this.baseTypes = []; + 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]]; + } + + /** + * EntityType enumValues. + * @member {google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues|null|undefined} enumValues + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.enumValues = null; + + /** + * EntityType displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.displayName = ""; + + /** + * EntityType name. + * @member {string} name + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.name = ""; + + /** + * EntityType baseTypes. + * @member {Array.} baseTypes + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.baseTypes = $util.emptyArray; + + /** + * EntityType properties. + * @member {Array.} properties + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.properties = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EntityType valueSource. + * @member {"enumValues"|undefined} valueSource + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @instance + */ + Object.defineProperty(EntityType.prototype, "valueSource", { + get: $util.oneOfGetter($oneOfFields = ["enumValues"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EntityType instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.IEntityType=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType} EntityType instance + */ + EntityType.create = function create(properties) { + return new EntityType(properties); + }; + + /** + * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.IEntityType} message EntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityType.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.baseTypes != null && message.baseTypes.length) + for (var i = 0; i < message.baseTypes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseTypes[i]); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.encode(message.properties[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.displayName); + if (message.enumValues != null && Object.hasOwnProperty.call(message, "enumValues")) + $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.encode(message.enumValues, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.IEntityType} message EntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @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.DocumentSchema.EntityType} EntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityType.decode = function decode(reader, 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.DocumentSchema.EntityType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 14: { + message.enumValues = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.decode(reader, reader.uint32()); + break; + } + case 13: { + message.displayName = reader.string(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.baseTypes && message.baseTypes.length)) + message.baseTypes = []; + message.baseTypes.push(reader.string()); + break; + } + case 6: { + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType} EntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityType message. + * @function verify + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enumValues != null && message.hasOwnProperty("enumValues")) { + properties.valueSource = 1; + { + var error = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.verify(message.enumValues); + if (error) + return "enumValues." + error; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.baseTypes != null && message.hasOwnProperty("baseTypes")) { + if (!Array.isArray(message.baseTypes)) + return "baseTypes: array expected"; + for (var i = 0; i < message.baseTypes.length; ++i) + if (!$util.isString(message.baseTypes[i])) + return "baseTypes: string[] 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.documentai.v1.DocumentSchema.EntityType.Property.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + return null; + }; + + /** + * Creates an EntityType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType} EntityType + */ + EntityType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DocumentSchema.EntityType) + return object; + var message = new $root.google.cloud.documentai.v1.DocumentSchema.EntityType(); + if (object.enumValues != null) { + if (typeof object.enumValues !== "object") + throw TypeError(".google.cloud.documentai.v1.DocumentSchema.EntityType.enumValues: object expected"); + message.enumValues = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.fromObject(object.enumValues); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.name != null) + message.name = String(object.name); + if (object.baseTypes) { + if (!Array.isArray(object.baseTypes)) + throw TypeError(".google.cloud.documentai.v1.DocumentSchema.EntityType.baseTypes: array expected"); + message.baseTypes = []; + for (var i = 0; i < object.baseTypes.length; ++i) + message.baseTypes[i] = String(object.baseTypes[i]); + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.documentai.v1.DocumentSchema.EntityType.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.DocumentSchema.EntityType.properties: object expected"); + message.properties[i] = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.fromObject(object.properties[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.EntityType} message EntityType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.baseTypes = []; + object.properties = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.baseTypes && message.baseTypes.length) { + object.baseTypes = []; + for (var j = 0; j < message.baseTypes.length; ++j) + object.baseTypes[j] = message.baseTypes[j]; + } + 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.DocumentSchema.EntityType.Property.toObject(message.properties[j], options); + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.enumValues != null && message.hasOwnProperty("enumValues")) { + object.enumValues = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.toObject(message.enumValues, options); + if (options.oneofs) + object.valueSource = "enumValues"; + } + return object; + }; + + /** + * Converts this EntityType to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @instance + * @returns {Object.} JSON object + */ + EntityType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityType + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DocumentSchema.EntityType"; + }; + + EntityType.EnumValues = (function() { + + /** + * Properties of an EnumValues. + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @interface IEnumValues + * @property {Array.|null} [values] EnumValues values + */ + + /** + * Constructs a new EnumValues. + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @classdesc Represents an EnumValues. + * @implements IEnumValues + * @constructor + * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues=} [properties] Properties to set + */ + function EnumValues(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]]; + } + + /** + * EnumValues values. + * @member {Array.} values + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + * @instance + */ + EnumValues.prototype.values = $util.emptyArray; + + /** + * Creates a new EnumValues instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues} EnumValues instance + */ + EnumValues.create = function create(properties) { + return new EnumValues(properties); + }; + + /** + * Encodes the specified EnumValues message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues} message EnumValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValues.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 EnumValues message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues} message EnumValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + * @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.DocumentSchema.EntityType.EnumValues} EnumValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValues.decode = function decode(reader, 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.DocumentSchema.EntityType.EnumValues(); + 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 EnumValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues} EnumValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValues message. + * @function verify + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValues.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 EnumValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues} EnumValues + */ + EnumValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) + return object; + var message = new $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.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 EnumValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues} message EnumValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValues.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 EnumValues to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + * @instance + * @returns {Object.} JSON object + */ + EnumValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValues + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues"; + }; + + return EnumValues; + })(); + + EntityType.Property = (function() { + + /** + * Properties of a Property. + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @interface IProperty + * @property {string|null} [name] Property name + * @property {string|null} [displayName] Property displayName + * @property {string|null} [valueType] Property valueType + * @property {google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType|null} [occurrenceType] Property occurrenceType + * @property {google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method|null} [method] Property method + */ + + /** + * Constructs a new Property. + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType + * @classdesc Represents a Property. + * @implements IProperty + * @constructor + * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.Property + * @instance + */ + Property.prototype.name = ""; + + /** + * Property displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property + * @instance + */ + Property.prototype.displayName = ""; + + /** + * Property valueType. + * @member {string} valueType + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property + * @instance + */ + Property.prototype.valueType = ""; + + /** + * Property occurrenceType. + * @member {google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType} occurrenceType + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property + * @instance + */ + Property.prototype.occurrenceType = 0; + + /** + * Property method. + * @member {google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method} method + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property + * @instance + */ + Property.prototype.method = 0; + + /** + * Creates a new Property instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.IProperty=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType.Property} Property instance + */ + Property.create = function create(properties) { + return new Property(properties); + }; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.Property.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.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.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.valueType); + if (message.occurrenceType != null && Object.hasOwnProperty.call(message, "occurrenceType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.occurrenceType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.method); + return writer; + }; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.Property.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.Property + * @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.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.Property(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 6: { + message.displayName = reader.string(); + break; + } + case 2: { + message.valueType = reader.string(); + break; + } + case 3: { + message.occurrenceType = reader.int32(); + break; + } + case 8: { + message.method = reader.int32(); + 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.documentai.v1.DocumentSchema.EntityType.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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"; + 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.valueType != null && message.hasOwnProperty("valueType")) + if (!$util.isString(message.valueType)) + return "valueType: string expected"; + if (message.occurrenceType != null && message.hasOwnProperty("occurrenceType")) + switch (message.occurrenceType) { + default: + return "occurrenceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + 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 a Property message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType.Property} Property + */ + Property.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property) + return object; + var message = new $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.valueType != null) + message.valueType = String(object.valueType); + switch (object.occurrenceType) { + default: + if (typeof object.occurrenceType === "number") { + message.occurrenceType = object.occurrenceType; + break; + } + break; + case "OCCURRENCE_TYPE_UNSPECIFIED": + case 0: + message.occurrenceType = 0; + break; + case "OPTIONAL_ONCE": + case 1: + message.occurrenceType = 1; + break; + case "OPTIONAL_MULTIPLE": + case 2: + message.occurrenceType = 2; + break; + case "REQUIRED_ONCE": + case 3: + message.occurrenceType = 3; + break; + case "REQUIRED_MULTIPLE": + case 4: + message.occurrenceType = 4; + break; + } + 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 a Property message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.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 = ""; + object.valueType = ""; + object.occurrenceType = options.enums === String ? "OCCURRENCE_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.method = options.enums === String ? "METHOD_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = message.valueType; + if (message.occurrenceType != null && message.hasOwnProperty("occurrenceType")) + object.occurrenceType = options.enums === String ? $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] === undefined ? message.occurrenceType : $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] : message.occurrenceType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.method != null && message.hasOwnProperty("method")) + object.method = options.enums === String ? $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method[message.method] === undefined ? message.method : $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method[message.method] : message.method; + return object; + }; + + /** + * Converts this Property to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.Property"; + }; + + /** + * OccurrenceType enum. + * @name google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType + * @enum {number} + * @property {number} OCCURRENCE_TYPE_UNSPECIFIED=0 OCCURRENCE_TYPE_UNSPECIFIED value + * @property {number} OPTIONAL_ONCE=1 OPTIONAL_ONCE value + * @property {number} OPTIONAL_MULTIPLE=2 OPTIONAL_MULTIPLE value + * @property {number} REQUIRED_ONCE=3 REQUIRED_ONCE value + * @property {number} REQUIRED_MULTIPLE=4 REQUIRED_MULTIPLE value + */ + Property.OccurrenceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OCCURRENCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL_ONCE"] = 1; + values[valuesById[2] = "OPTIONAL_MULTIPLE"] = 2; + values[valuesById[3] = "REQUIRED_ONCE"] = 3; + values[valuesById[4] = "REQUIRED_MULTIPLE"] = 4; + return values; + })(); + + /** + * Method enum. + * @name google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method + * @enum {number} + * @property {number} METHOD_UNSPECIFIED=0 METHOD_UNSPECIFIED value + * @property {number} EXTRACT=1 EXTRACT value + * @property {number} DERIVE=2 DERIVE value + */ + Property.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 Property; + })(); + + return EntityType; + })(); + + DocumentSchema.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof google.cloud.documentai.v1.DocumentSchema + * @interface IMetadata + * @property {boolean|null} [documentSplitter] Metadata documentSplitter + * @property {boolean|null} [documentAllowMultipleLabels] Metadata documentAllowMultipleLabels + * @property {boolean|null} [prefixedNamingOnProperties] Metadata prefixedNamingOnProperties + * @property {boolean|null} [skipNamingValidation] Metadata skipNamingValidation + */ + + /** + * Constructs a new Metadata. + * @memberof google.cloud.documentai.v1.DocumentSchema + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {google.cloud.documentai.v1.DocumentSchema.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metadata documentSplitter. + * @member {boolean} documentSplitter + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @instance + */ + Metadata.prototype.documentSplitter = false; + + /** + * Metadata documentAllowMultipleLabels. + * @member {boolean} documentAllowMultipleLabels + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @instance + */ + Metadata.prototype.documentAllowMultipleLabels = false; + + /** + * Metadata prefixedNamingOnProperties. + * @member {boolean} prefixedNamingOnProperties + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @instance + */ + Metadata.prototype.prefixedNamingOnProperties = false; + + /** + * Metadata skipNamingValidation. + * @member {boolean} skipNamingValidation + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @instance + */ + Metadata.prototype.skipNamingValidation = false; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.IMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.DocumentSchema.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.Metadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentSplitter != null && Object.hasOwnProperty.call(message, "documentSplitter")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.documentSplitter); + if (message.documentAllowMultipleLabels != null && Object.hasOwnProperty.call(message, "documentAllowMultipleLabels")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.documentAllowMultipleLabels); + if (message.prefixedNamingOnProperties != null && Object.hasOwnProperty.call(message, "prefixedNamingOnProperties")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prefixedNamingOnProperties); + if (message.skipNamingValidation != null && Object.hasOwnProperty.call(message, "skipNamingValidation")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.skipNamingValidation); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @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.DocumentSchema.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, 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.DocumentSchema.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.documentSplitter = reader.bool(); + break; + } + case 2: { + message.documentAllowMultipleLabels = reader.bool(); + break; + } + case 6: { + message.prefixedNamingOnProperties = reader.bool(); + break; + } + case 7: { + message.skipNamingValidation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.DocumentSchema.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentSplitter != null && message.hasOwnProperty("documentSplitter")) + if (typeof message.documentSplitter !== "boolean") + return "documentSplitter: boolean expected"; + if (message.documentAllowMultipleLabels != null && message.hasOwnProperty("documentAllowMultipleLabels")) + if (typeof message.documentAllowMultipleLabels !== "boolean") + return "documentAllowMultipleLabels: boolean expected"; + if (message.prefixedNamingOnProperties != null && message.hasOwnProperty("prefixedNamingOnProperties")) + if (typeof message.prefixedNamingOnProperties !== "boolean") + return "prefixedNamingOnProperties: boolean expected"; + if (message.skipNamingValidation != null && message.hasOwnProperty("skipNamingValidation")) + if (typeof message.skipNamingValidation !== "boolean") + return "skipNamingValidation: boolean expected"; + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.DocumentSchema.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.DocumentSchema.Metadata) + return object; + var message = new $root.google.cloud.documentai.v1.DocumentSchema.Metadata(); + if (object.documentSplitter != null) + message.documentSplitter = Boolean(object.documentSplitter); + if (object.documentAllowMultipleLabels != null) + message.documentAllowMultipleLabels = Boolean(object.documentAllowMultipleLabels); + if (object.prefixedNamingOnProperties != null) + message.prefixedNamingOnProperties = Boolean(object.prefixedNamingOnProperties); + if (object.skipNamingValidation != null) + message.skipNamingValidation = Boolean(object.skipNamingValidation); + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @static + * @param {google.cloud.documentai.v1.DocumentSchema.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.documentSplitter = false; + object.documentAllowMultipleLabels = false; + object.prefixedNamingOnProperties = false; + object.skipNamingValidation = false; + } + if (message.documentSplitter != null && message.hasOwnProperty("documentSplitter")) + object.documentSplitter = message.documentSplitter; + if (message.documentAllowMultipleLabels != null && message.hasOwnProperty("documentAllowMultipleLabels")) + object.documentAllowMultipleLabels = message.documentAllowMultipleLabels; + if (message.prefixedNamingOnProperties != null && message.hasOwnProperty("prefixedNamingOnProperties")) + object.prefixedNamingOnProperties = message.prefixedNamingOnProperties; + if (message.skipNamingValidation != null && message.hasOwnProperty("skipNamingValidation")) + object.skipNamingValidation = message.skipNamingValidation; + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.DocumentSchema.Metadata"; + }; + + return Metadata; + })(); + + return DocumentSchema; + })(); + + v1.EvaluationReference = (function() { + + /** + * Properties of an EvaluationReference. + * @memberof google.cloud.documentai.v1 + * @interface IEvaluationReference + * @property {string|null} [operation] EvaluationReference operation + * @property {string|null} [evaluation] EvaluationReference evaluation + * @property {google.cloud.documentai.v1.Evaluation.IMetrics|null} [aggregateMetrics] EvaluationReference aggregateMetrics + * @property {google.cloud.documentai.v1.Evaluation.IMetrics|null} [aggregateMetricsExact] EvaluationReference aggregateMetricsExact + */ + + /** + * Constructs a new EvaluationReference. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents an EvaluationReference. + * @implements IEvaluationReference + * @constructor + * @param {google.cloud.documentai.v1.IEvaluationReference=} [properties] Properties to set + */ + function EvaluationReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationReference operation. + * @member {string} operation + * @memberof google.cloud.documentai.v1.EvaluationReference + * @instance + */ + EvaluationReference.prototype.operation = ""; + + /** + * EvaluationReference evaluation. + * @member {string} evaluation + * @memberof google.cloud.documentai.v1.EvaluationReference + * @instance + */ + EvaluationReference.prototype.evaluation = ""; + + /** + * EvaluationReference aggregateMetrics. + * @member {google.cloud.documentai.v1.Evaluation.IMetrics|null|undefined} aggregateMetrics + * @memberof google.cloud.documentai.v1.EvaluationReference + * @instance + */ + EvaluationReference.prototype.aggregateMetrics = null; + + /** + * EvaluationReference aggregateMetricsExact. + * @member {google.cloud.documentai.v1.Evaluation.IMetrics|null|undefined} aggregateMetricsExact + * @memberof google.cloud.documentai.v1.EvaluationReference + * @instance + */ + EvaluationReference.prototype.aggregateMetricsExact = null; + + /** + * Creates a new EvaluationReference instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.EvaluationReference + * @static + * @param {google.cloud.documentai.v1.IEvaluationReference=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.EvaluationReference} EvaluationReference instance + */ + EvaluationReference.create = function create(properties) { + return new EvaluationReference(properties); + }; + + /** + * Encodes the specified EvaluationReference message. Does not implicitly {@link google.cloud.documentai.v1.EvaluationReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.EvaluationReference + * @static + * @param {google.cloud.documentai.v1.IEvaluationReference} message EvaluationReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); + if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluation); + if (message.aggregateMetrics != null && Object.hasOwnProperty.call(message, "aggregateMetrics")) + $root.google.cloud.documentai.v1.Evaluation.Metrics.encode(message.aggregateMetrics, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.aggregateMetricsExact != null && Object.hasOwnProperty.call(message, "aggregateMetricsExact")) + $root.google.cloud.documentai.v1.Evaluation.Metrics.encode(message.aggregateMetricsExact, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationReference message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluationReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.EvaluationReference + * @static + * @param {google.cloud.documentai.v1.IEvaluationReference} message EvaluationReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.EvaluationReference + * @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.EvaluationReference} EvaluationReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationReference.decode = function decode(reader, 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.EvaluationReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.operation = reader.string(); + break; + } + case 2: { + message.evaluation = reader.string(); + break; + } + case 4: { + message.aggregateMetrics = $root.google.cloud.documentai.v1.Evaluation.Metrics.decode(reader, reader.uint32()); + break; + } + case 5: { + message.aggregateMetricsExact = $root.google.cloud.documentai.v1.Evaluation.Metrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.EvaluationReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.EvaluationReference} EvaluationReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationReference message. + * @function verify + * @memberof google.cloud.documentai.v1.EvaluationReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) + if (!$util.isString(message.evaluation)) + return "evaluation: string expected"; + if (message.aggregateMetrics != null && message.hasOwnProperty("aggregateMetrics")) { + var error = $root.google.cloud.documentai.v1.Evaluation.Metrics.verify(message.aggregateMetrics); + if (error) + return "aggregateMetrics." + error; + } + if (message.aggregateMetricsExact != null && message.hasOwnProperty("aggregateMetricsExact")) { + var error = $root.google.cloud.documentai.v1.Evaluation.Metrics.verify(message.aggregateMetricsExact); + if (error) + return "aggregateMetricsExact." + error; + } + return null; + }; + + /** + * Creates an EvaluationReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.EvaluationReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.EvaluationReference} EvaluationReference + */ + EvaluationReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.EvaluationReference) + return object; + var message = new $root.google.cloud.documentai.v1.EvaluationReference(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.evaluation != null) + message.evaluation = String(object.evaluation); + if (object.aggregateMetrics != null) { + if (typeof object.aggregateMetrics !== "object") + throw TypeError(".google.cloud.documentai.v1.EvaluationReference.aggregateMetrics: object expected"); + message.aggregateMetrics = $root.google.cloud.documentai.v1.Evaluation.Metrics.fromObject(object.aggregateMetrics); + } + if (object.aggregateMetricsExact != null) { + if (typeof object.aggregateMetricsExact !== "object") + throw TypeError(".google.cloud.documentai.v1.EvaluationReference.aggregateMetricsExact: object expected"); + message.aggregateMetricsExact = $root.google.cloud.documentai.v1.Evaluation.Metrics.fromObject(object.aggregateMetricsExact); + } + return message; + }; + + /** + * Creates a plain object from an EvaluationReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.EvaluationReference + * @static + * @param {google.cloud.documentai.v1.EvaluationReference} message EvaluationReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operation = ""; + object.evaluation = ""; + object.aggregateMetrics = null; + object.aggregateMetricsExact = null; + } + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) + object.evaluation = message.evaluation; + if (message.aggregateMetrics != null && message.hasOwnProperty("aggregateMetrics")) + object.aggregateMetrics = $root.google.cloud.documentai.v1.Evaluation.Metrics.toObject(message.aggregateMetrics, options); + if (message.aggregateMetricsExact != null && message.hasOwnProperty("aggregateMetricsExact")) + object.aggregateMetricsExact = $root.google.cloud.documentai.v1.Evaluation.Metrics.toObject(message.aggregateMetricsExact, options); + return object; + }; + + /** + * Converts this EvaluationReference to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.EvaluationReference + * @instance + * @returns {Object.} JSON object + */ + EvaluationReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationReference + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.EvaluationReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.EvaluationReference"; + }; + + return EvaluationReference; + })(); + + v1.Evaluation = (function() { + + /** + * Properties of an Evaluation. + * @memberof google.cloud.documentai.v1 + * @interface IEvaluation + * @property {string|null} [name] Evaluation name + * @property {google.protobuf.ITimestamp|null} [createTime] Evaluation createTime + * @property {google.cloud.documentai.v1.Evaluation.ICounters|null} [documentCounters] Evaluation documentCounters + * @property {google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics|null} [allEntitiesMetrics] Evaluation allEntitiesMetrics + * @property {Object.|null} [entityMetrics] Evaluation entityMetrics + * @property {string|null} [kmsKeyName] Evaluation kmsKeyName + * @property {string|null} [kmsKeyVersionName] Evaluation kmsKeyVersionName + */ + + /** + * Constructs a new Evaluation. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents an Evaluation. + * @implements IEvaluation + * @constructor + * @param {google.cloud.documentai.v1.IEvaluation=} [properties] Properties to set + */ + function Evaluation(properties) { + this.entityMetrics = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evaluation name. + * @member {string} name + * @memberof google.cloud.documentai.v1.Evaluation + * @instance + */ + Evaluation.prototype.name = ""; + + /** + * Evaluation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1.Evaluation + * @instance + */ + Evaluation.prototype.createTime = null; + + /** + * Evaluation documentCounters. + * @member {google.cloud.documentai.v1.Evaluation.ICounters|null|undefined} documentCounters + * @memberof google.cloud.documentai.v1.Evaluation + * @instance + */ + Evaluation.prototype.documentCounters = null; + + /** + * Evaluation allEntitiesMetrics. + * @member {google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics|null|undefined} allEntitiesMetrics + * @memberof google.cloud.documentai.v1.Evaluation + * @instance + */ + Evaluation.prototype.allEntitiesMetrics = null; + + /** + * Evaluation entityMetrics. + * @member {Object.} entityMetrics + * @memberof google.cloud.documentai.v1.Evaluation + * @instance + */ + Evaluation.prototype.entityMetrics = $util.emptyObject; + + /** + * Evaluation kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.documentai.v1.Evaluation + * @instance + */ + Evaluation.prototype.kmsKeyName = ""; + + /** + * Evaluation kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.documentai.v1.Evaluation + * @instance + */ + Evaluation.prototype.kmsKeyVersionName = ""; + + /** + * Creates a new Evaluation instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Evaluation + * @static + * @param {google.cloud.documentai.v1.IEvaluation=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Evaluation} Evaluation instance + */ + Evaluation.create = function create(properties) { + return new Evaluation(properties); + }; + + /** + * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Evaluation + * @static + * @param {google.cloud.documentai.v1.IEvaluation} message Evaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.allEntitiesMetrics != null && Object.hasOwnProperty.call(message, "allEntitiesMetrics")) + $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.encode(message.allEntitiesMetrics, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.entityMetrics != null && Object.hasOwnProperty.call(message, "entityMetrics")) + for (var keys = Object.keys(message.entityMetrics), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.encode(message.entityMetrics[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.documentCounters != null && Object.hasOwnProperty.call(message, "documentCounters")) + $root.google.cloud.documentai.v1.Evaluation.Counters.encode(message.documentCounters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.kmsKeyName); + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.kmsKeyVersionName); + return writer; + }; + + /** + * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Evaluation + * @static + * @param {google.cloud.documentai.v1.IEvaluation} message Evaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Evaluation + * @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.Evaluation} Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluation.decode = function decode(reader, 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.Evaluation(), key, value; + 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.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.documentCounters = $root.google.cloud.documentai.v1.Evaluation.Counters.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allEntitiesMetrics = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.entityMetrics === $util.emptyObject) + message.entityMetrics = {}; + 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.documentai.v1.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.entityMetrics[key] = value; + break; + } + case 6: { + message.kmsKeyName = reader.string(); + break; + } + case 7: { + message.kmsKeyVersionName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Evaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Evaluation} Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evaluation message. + * @function verify + * @memberof google.cloud.documentai.v1.Evaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evaluation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.documentCounters != null && message.hasOwnProperty("documentCounters")) { + var error = $root.google.cloud.documentai.v1.Evaluation.Counters.verify(message.documentCounters); + if (error) + return "documentCounters." + error; + } + if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) { + var error = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.verify(message.allEntitiesMetrics); + if (error) + return "allEntitiesMetrics." + error; + } + if (message.entityMetrics != null && message.hasOwnProperty("entityMetrics")) { + if (!$util.isObject(message.entityMetrics)) + return "entityMetrics: object expected"; + var key = Object.keys(message.entityMetrics); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.verify(message.entityMetrics[key[i]]); + if (error) + return "entityMetrics." + error; + } + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (!$util.isString(message.kmsKeyVersionName)) + return "kmsKeyVersionName: string expected"; + return null; + }; + + /** + * Creates an Evaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Evaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Evaluation} Evaluation + */ + Evaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Evaluation) + return object; + var message = new $root.google.cloud.documentai.v1.Evaluation(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.documentai.v1.Evaluation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.documentCounters != null) { + if (typeof object.documentCounters !== "object") + throw TypeError(".google.cloud.documentai.v1.Evaluation.documentCounters: object expected"); + message.documentCounters = $root.google.cloud.documentai.v1.Evaluation.Counters.fromObject(object.documentCounters); + } + if (object.allEntitiesMetrics != null) { + if (typeof object.allEntitiesMetrics !== "object") + throw TypeError(".google.cloud.documentai.v1.Evaluation.allEntitiesMetrics: object expected"); + message.allEntitiesMetrics = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.fromObject(object.allEntitiesMetrics); + } + if (object.entityMetrics) { + if (typeof object.entityMetrics !== "object") + throw TypeError(".google.cloud.documentai.v1.Evaluation.entityMetrics: object expected"); + message.entityMetrics = {}; + for (var keys = Object.keys(object.entityMetrics), i = 0; i < keys.length; ++i) { + if (typeof object.entityMetrics[keys[i]] !== "object") + throw TypeError(".google.cloud.documentai.v1.Evaluation.entityMetrics: object expected"); + message.entityMetrics[keys[i]] = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.fromObject(object.entityMetrics[keys[i]]); + } + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyVersionName != null) + message.kmsKeyVersionName = String(object.kmsKeyVersionName); + return message; + }; + + /** + * Creates a plain object from an Evaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Evaluation + * @static + * @param {google.cloud.documentai.v1.Evaluation} message Evaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.entityMetrics = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.allEntitiesMetrics = null; + object.documentCounters = null; + object.kmsKeyName = ""; + object.kmsKeyVersionName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) + object.allEntitiesMetrics = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.toObject(message.allEntitiesMetrics, options); + var keys2; + if (message.entityMetrics && (keys2 = Object.keys(message.entityMetrics)).length) { + object.entityMetrics = {}; + for (var j = 0; j < keys2.length; ++j) + object.entityMetrics[keys2[j]] = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.toObject(message.entityMetrics[keys2[j]], options); + } + if (message.documentCounters != null && message.hasOwnProperty("documentCounters")) + object.documentCounters = $root.google.cloud.documentai.v1.Evaluation.Counters.toObject(message.documentCounters, options); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + object.kmsKeyVersionName = message.kmsKeyVersionName; + return object; + }; + + /** + * Converts this Evaluation to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Evaluation + * @instance + * @returns {Object.} JSON object + */ + Evaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Evaluation + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Evaluation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Evaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Evaluation"; + }; + + Evaluation.Counters = (function() { + + /** + * Properties of a Counters. + * @memberof google.cloud.documentai.v1.Evaluation + * @interface ICounters + * @property {number|null} [inputDocumentsCount] Counters inputDocumentsCount + * @property {number|null} [invalidDocumentsCount] Counters invalidDocumentsCount + * @property {number|null} [failedDocumentsCount] Counters failedDocumentsCount + * @property {number|null} [evaluatedDocumentsCount] Counters evaluatedDocumentsCount + */ + + /** + * Constructs a new Counters. + * @memberof google.cloud.documentai.v1.Evaluation + * @classdesc Represents a Counters. + * @implements ICounters + * @constructor + * @param {google.cloud.documentai.v1.Evaluation.ICounters=} [properties] Properties to set + */ + function Counters(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Counters inputDocumentsCount. + * @member {number} inputDocumentsCount + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @instance + */ + Counters.prototype.inputDocumentsCount = 0; + + /** + * Counters invalidDocumentsCount. + * @member {number} invalidDocumentsCount + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @instance + */ + Counters.prototype.invalidDocumentsCount = 0; + + /** + * Counters failedDocumentsCount. + * @member {number} failedDocumentsCount + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @instance + */ + Counters.prototype.failedDocumentsCount = 0; + + /** + * Counters evaluatedDocumentsCount. + * @member {number} evaluatedDocumentsCount + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @instance + */ + Counters.prototype.evaluatedDocumentsCount = 0; + + /** + * Creates a new Counters instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @static + * @param {google.cloud.documentai.v1.Evaluation.ICounters=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Evaluation.Counters} Counters instance + */ + Counters.create = function create(properties) { + return new Counters(properties); + }; + + /** + * Encodes the specified Counters message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Counters.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @static + * @param {google.cloud.documentai.v1.Evaluation.ICounters} message Counters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Counters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputDocumentsCount != null && Object.hasOwnProperty.call(message, "inputDocumentsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.inputDocumentsCount); + if (message.invalidDocumentsCount != null && Object.hasOwnProperty.call(message, "invalidDocumentsCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidDocumentsCount); + if (message.failedDocumentsCount != null && Object.hasOwnProperty.call(message, "failedDocumentsCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.failedDocumentsCount); + if (message.evaluatedDocumentsCount != null && Object.hasOwnProperty.call(message, "evaluatedDocumentsCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.evaluatedDocumentsCount); + return writer; + }; + + /** + * Encodes the specified Counters message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Counters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @static + * @param {google.cloud.documentai.v1.Evaluation.ICounters} message Counters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Counters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Counters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @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.Evaluation.Counters} Counters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Counters.decode = function decode(reader, 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.Evaluation.Counters(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputDocumentsCount = reader.int32(); + break; + } + case 2: { + message.invalidDocumentsCount = reader.int32(); + break; + } + case 3: { + message.failedDocumentsCount = reader.int32(); + break; + } + case 4: { + message.evaluatedDocumentsCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Counters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Evaluation.Counters} Counters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Counters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Counters message. + * @function verify + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Counters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputDocumentsCount != null && message.hasOwnProperty("inputDocumentsCount")) + if (!$util.isInteger(message.inputDocumentsCount)) + return "inputDocumentsCount: integer expected"; + if (message.invalidDocumentsCount != null && message.hasOwnProperty("invalidDocumentsCount")) + if (!$util.isInteger(message.invalidDocumentsCount)) + return "invalidDocumentsCount: integer expected"; + if (message.failedDocumentsCount != null && message.hasOwnProperty("failedDocumentsCount")) + if (!$util.isInteger(message.failedDocumentsCount)) + return "failedDocumentsCount: integer expected"; + if (message.evaluatedDocumentsCount != null && message.hasOwnProperty("evaluatedDocumentsCount")) + if (!$util.isInteger(message.evaluatedDocumentsCount)) + return "evaluatedDocumentsCount: integer expected"; + return null; + }; + + /** + * Creates a Counters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Evaluation.Counters} Counters + */ + Counters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Evaluation.Counters) + return object; + var message = new $root.google.cloud.documentai.v1.Evaluation.Counters(); + if (object.inputDocumentsCount != null) + message.inputDocumentsCount = object.inputDocumentsCount | 0; + if (object.invalidDocumentsCount != null) + message.invalidDocumentsCount = object.invalidDocumentsCount | 0; + if (object.failedDocumentsCount != null) + message.failedDocumentsCount = object.failedDocumentsCount | 0; + if (object.evaluatedDocumentsCount != null) + message.evaluatedDocumentsCount = object.evaluatedDocumentsCount | 0; + return message; + }; + + /** + * Creates a plain object from a Counters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @static + * @param {google.cloud.documentai.v1.Evaluation.Counters} message Counters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Counters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputDocumentsCount = 0; + object.invalidDocumentsCount = 0; + object.failedDocumentsCount = 0; + object.evaluatedDocumentsCount = 0; + } + if (message.inputDocumentsCount != null && message.hasOwnProperty("inputDocumentsCount")) + object.inputDocumentsCount = message.inputDocumentsCount; + if (message.invalidDocumentsCount != null && message.hasOwnProperty("invalidDocumentsCount")) + object.invalidDocumentsCount = message.invalidDocumentsCount; + if (message.failedDocumentsCount != null && message.hasOwnProperty("failedDocumentsCount")) + object.failedDocumentsCount = message.failedDocumentsCount; + if (message.evaluatedDocumentsCount != null && message.hasOwnProperty("evaluatedDocumentsCount")) + object.evaluatedDocumentsCount = message.evaluatedDocumentsCount; + return object; + }; + + /** + * Converts this Counters to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @instance + * @returns {Object.} JSON object + */ + Counters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Counters + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Evaluation.Counters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Counters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Evaluation.Counters"; + }; + + return Counters; + })(); + + Evaluation.Metrics = (function() { + + /** + * Properties of a Metrics. + * @memberof google.cloud.documentai.v1.Evaluation + * @interface IMetrics + * @property {number|null} [precision] Metrics precision + * @property {number|null} [recall] Metrics recall + * @property {number|null} [f1Score] Metrics f1Score + * @property {number|null} [predictedOccurrencesCount] Metrics predictedOccurrencesCount + * @property {number|null} [groundTruthOccurrencesCount] Metrics groundTruthOccurrencesCount + * @property {number|null} [predictedDocumentCount] Metrics predictedDocumentCount + * @property {number|null} [groundTruthDocumentCount] Metrics groundTruthDocumentCount + * @property {number|null} [truePositivesCount] Metrics truePositivesCount + * @property {number|null} [falsePositivesCount] Metrics falsePositivesCount + * @property {number|null} [falseNegativesCount] Metrics falseNegativesCount + * @property {number|null} [totalDocumentsCount] Metrics totalDocumentsCount + */ + + /** + * Constructs a new Metrics. + * @memberof google.cloud.documentai.v1.Evaluation + * @classdesc Represents a Metrics. + * @implements IMetrics + * @constructor + * @param {google.cloud.documentai.v1.Evaluation.IMetrics=} [properties] Properties to set + */ + function Metrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metrics precision. + * @member {number} precision + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @instance + */ + Metrics.prototype.precision = 0; + + /** + * Metrics recall. + * @member {number} recall + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @instance + */ + Metrics.prototype.recall = 0; + + /** + * Metrics f1Score. + * @member {number} f1Score + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @instance + */ + Metrics.prototype.f1Score = 0; + + /** + * Metrics predictedOccurrencesCount. + * @member {number} predictedOccurrencesCount + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @instance + */ + Metrics.prototype.predictedOccurrencesCount = 0; + + /** + * Metrics groundTruthOccurrencesCount. + * @member {number} groundTruthOccurrencesCount + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @instance + */ + Metrics.prototype.groundTruthOccurrencesCount = 0; + + /** + * Metrics predictedDocumentCount. + * @member {number} predictedDocumentCount + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @instance + */ + Metrics.prototype.predictedDocumentCount = 0; + + /** + * Metrics groundTruthDocumentCount. + * @member {number} groundTruthDocumentCount + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @instance + */ + Metrics.prototype.groundTruthDocumentCount = 0; + + /** + * Metrics truePositivesCount. + * @member {number} truePositivesCount + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @instance + */ + Metrics.prototype.truePositivesCount = 0; + + /** + * Metrics falsePositivesCount. + * @member {number} falsePositivesCount + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @instance + */ + Metrics.prototype.falsePositivesCount = 0; + + /** + * Metrics falseNegativesCount. + * @member {number} falseNegativesCount + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @instance + */ + Metrics.prototype.falseNegativesCount = 0; + + /** + * Metrics totalDocumentsCount. + * @member {number} totalDocumentsCount + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @instance + */ + Metrics.prototype.totalDocumentsCount = 0; + + /** + * Creates a new Metrics instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @static + * @param {google.cloud.documentai.v1.Evaluation.IMetrics=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Evaluation.Metrics} Metrics instance + */ + Metrics.create = function create(properties) { + return new Metrics(properties); + }; + + /** + * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Metrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @static + * @param {google.cloud.documentai.v1.Evaluation.IMetrics} message Metrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.precision); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.f1Score); + if (message.predictedOccurrencesCount != null && Object.hasOwnProperty.call(message, "predictedOccurrencesCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.predictedOccurrencesCount); + if (message.groundTruthOccurrencesCount != null && Object.hasOwnProperty.call(message, "groundTruthOccurrencesCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.groundTruthOccurrencesCount); + if (message.truePositivesCount != null && Object.hasOwnProperty.call(message, "truePositivesCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.truePositivesCount); + if (message.falsePositivesCount != null && Object.hasOwnProperty.call(message, "falsePositivesCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.falsePositivesCount); + if (message.falseNegativesCount != null && Object.hasOwnProperty.call(message, "falseNegativesCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.falseNegativesCount); + if (message.totalDocumentsCount != null && Object.hasOwnProperty.call(message, "totalDocumentsCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.totalDocumentsCount); + if (message.predictedDocumentCount != null && Object.hasOwnProperty.call(message, "predictedDocumentCount")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.predictedDocumentCount); + if (message.groundTruthDocumentCount != null && Object.hasOwnProperty.call(message, "groundTruthDocumentCount")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.groundTruthDocumentCount); + return writer; + }; + + /** + * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Metrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @static + * @param {google.cloud.documentai.v1.Evaluation.IMetrics} message Metrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @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.Evaluation.Metrics} Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metrics.decode = function decode(reader, 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.Evaluation.Metrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.precision = reader.float(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.f1Score = reader.float(); + break; + } + case 4: { + message.predictedOccurrencesCount = reader.int32(); + break; + } + case 5: { + message.groundTruthOccurrencesCount = reader.int32(); + break; + } + case 10: { + message.predictedDocumentCount = reader.int32(); + break; + } + case 11: { + message.groundTruthDocumentCount = reader.int32(); + break; + } + case 6: { + message.truePositivesCount = reader.int32(); + break; + } + case 7: { + message.falsePositivesCount = reader.int32(); + break; + } + case 8: { + message.falseNegativesCount = reader.int32(); + break; + } + case 9: { + message.totalDocumentsCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Evaluation.Metrics} Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metrics message. + * @function verify + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + if (message.predictedOccurrencesCount != null && message.hasOwnProperty("predictedOccurrencesCount")) + if (!$util.isInteger(message.predictedOccurrencesCount)) + return "predictedOccurrencesCount: integer expected"; + if (message.groundTruthOccurrencesCount != null && message.hasOwnProperty("groundTruthOccurrencesCount")) + if (!$util.isInteger(message.groundTruthOccurrencesCount)) + return "groundTruthOccurrencesCount: integer expected"; + if (message.predictedDocumentCount != null && message.hasOwnProperty("predictedDocumentCount")) + if (!$util.isInteger(message.predictedDocumentCount)) + return "predictedDocumentCount: integer expected"; + if (message.groundTruthDocumentCount != null && message.hasOwnProperty("groundTruthDocumentCount")) + if (!$util.isInteger(message.groundTruthDocumentCount)) + return "groundTruthDocumentCount: integer expected"; + if (message.truePositivesCount != null && message.hasOwnProperty("truePositivesCount")) + if (!$util.isInteger(message.truePositivesCount)) + return "truePositivesCount: integer expected"; + if (message.falsePositivesCount != null && message.hasOwnProperty("falsePositivesCount")) + if (!$util.isInteger(message.falsePositivesCount)) + return "falsePositivesCount: integer expected"; + if (message.falseNegativesCount != null && message.hasOwnProperty("falseNegativesCount")) + if (!$util.isInteger(message.falseNegativesCount)) + return "falseNegativesCount: integer expected"; + if (message.totalDocumentsCount != null && message.hasOwnProperty("totalDocumentsCount")) + if (!$util.isInteger(message.totalDocumentsCount)) + return "totalDocumentsCount: integer expected"; + return null; + }; + + /** + * Creates a Metrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Evaluation.Metrics} Metrics + */ + Metrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Evaluation.Metrics) + return object; + var message = new $root.google.cloud.documentai.v1.Evaluation.Metrics(); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + if (object.predictedOccurrencesCount != null) + message.predictedOccurrencesCount = object.predictedOccurrencesCount | 0; + if (object.groundTruthOccurrencesCount != null) + message.groundTruthOccurrencesCount = object.groundTruthOccurrencesCount | 0; + if (object.predictedDocumentCount != null) + message.predictedDocumentCount = object.predictedDocumentCount | 0; + if (object.groundTruthDocumentCount != null) + message.groundTruthDocumentCount = object.groundTruthDocumentCount | 0; + if (object.truePositivesCount != null) + message.truePositivesCount = object.truePositivesCount | 0; + if (object.falsePositivesCount != null) + message.falsePositivesCount = object.falsePositivesCount | 0; + if (object.falseNegativesCount != null) + message.falseNegativesCount = object.falseNegativesCount | 0; + if (object.totalDocumentsCount != null) + message.totalDocumentsCount = object.totalDocumentsCount | 0; + return message; + }; + + /** + * Creates a plain object from a Metrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @static + * @param {google.cloud.documentai.v1.Evaluation.Metrics} message Metrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.precision = 0; + object.recall = 0; + object.f1Score = 0; + object.predictedOccurrencesCount = 0; + object.groundTruthOccurrencesCount = 0; + object.truePositivesCount = 0; + object.falsePositivesCount = 0; + object.falseNegativesCount = 0; + object.totalDocumentsCount = 0; + object.predictedDocumentCount = 0; + object.groundTruthDocumentCount = 0; + } + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + if (message.predictedOccurrencesCount != null && message.hasOwnProperty("predictedOccurrencesCount")) + object.predictedOccurrencesCount = message.predictedOccurrencesCount; + if (message.groundTruthOccurrencesCount != null && message.hasOwnProperty("groundTruthOccurrencesCount")) + object.groundTruthOccurrencesCount = message.groundTruthOccurrencesCount; + if (message.truePositivesCount != null && message.hasOwnProperty("truePositivesCount")) + object.truePositivesCount = message.truePositivesCount; + if (message.falsePositivesCount != null && message.hasOwnProperty("falsePositivesCount")) + object.falsePositivesCount = message.falsePositivesCount; + if (message.falseNegativesCount != null && message.hasOwnProperty("falseNegativesCount")) + object.falseNegativesCount = message.falseNegativesCount; + if (message.totalDocumentsCount != null && message.hasOwnProperty("totalDocumentsCount")) + object.totalDocumentsCount = message.totalDocumentsCount; + if (message.predictedDocumentCount != null && message.hasOwnProperty("predictedDocumentCount")) + object.predictedDocumentCount = message.predictedDocumentCount; + if (message.groundTruthDocumentCount != null && message.hasOwnProperty("groundTruthDocumentCount")) + object.groundTruthDocumentCount = message.groundTruthDocumentCount; + return object; + }; + + /** + * Converts this Metrics to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @instance + * @returns {Object.} JSON object + */ + Metrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metrics + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Evaluation.Metrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Evaluation.Metrics"; + }; + + return Metrics; + })(); + + Evaluation.ConfidenceLevelMetrics = (function() { + + /** + * Properties of a ConfidenceLevelMetrics. + * @memberof google.cloud.documentai.v1.Evaluation + * @interface IConfidenceLevelMetrics + * @property {number|null} [confidenceLevel] ConfidenceLevelMetrics confidenceLevel + * @property {google.cloud.documentai.v1.Evaluation.IMetrics|null} [metrics] ConfidenceLevelMetrics metrics + */ + + /** + * Constructs a new ConfidenceLevelMetrics. + * @memberof google.cloud.documentai.v1.Evaluation + * @classdesc Represents a ConfidenceLevelMetrics. + * @implements IConfidenceLevelMetrics + * @constructor + * @param {google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics=} [properties] Properties to set + */ + function ConfidenceLevelMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceLevelMetrics confidenceLevel. + * @member {number} confidenceLevel + * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + * @instance + */ + ConfidenceLevelMetrics.prototype.confidenceLevel = 0; + + /** + * ConfidenceLevelMetrics metrics. + * @member {google.cloud.documentai.v1.Evaluation.IMetrics|null|undefined} metrics + * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + * @instance + */ + ConfidenceLevelMetrics.prototype.metrics = null; + + /** + * Creates a new ConfidenceLevelMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + * @static + * @param {google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics instance + */ + ConfidenceLevelMetrics.create = function create(properties) { + return new ConfidenceLevelMetrics(properties); + }; + + /** + * Encodes the specified ConfidenceLevelMetrics message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + * @static + * @param {google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics} message ConfidenceLevelMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceLevelMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceLevel != null && Object.hasOwnProperty.call(message, "confidenceLevel")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceLevel); + if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) + $root.google.cloud.documentai.v1.Evaluation.Metrics.encode(message.metrics, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConfidenceLevelMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + * @static + * @param {google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics} message ConfidenceLevelMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceLevelMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + * @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.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceLevelMetrics.decode = function decode(reader, 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.Evaluation.ConfidenceLevelMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.confidenceLevel = reader.float(); + break; + } + case 2: { + message.metrics = $root.google.cloud.documentai.v1.Evaluation.Metrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceLevelMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceLevelMetrics message. + * @function verify + * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceLevelMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceLevel != null && message.hasOwnProperty("confidenceLevel")) + if (typeof message.confidenceLevel !== "number") + return "confidenceLevel: number expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + var error = $root.google.cloud.documentai.v1.Evaluation.Metrics.verify(message.metrics); + if (error) + return "metrics." + error; + } + return null; + }; + + /** + * Creates a ConfidenceLevelMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics + */ + ConfidenceLevelMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics) + return object; + var message = new $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics(); + if (object.confidenceLevel != null) + message.confidenceLevel = Number(object.confidenceLevel); + if (object.metrics != null) { + if (typeof object.metrics !== "object") + throw TypeError(".google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.metrics: object expected"); + message.metrics = $root.google.cloud.documentai.v1.Evaluation.Metrics.fromObject(object.metrics); + } + return message; + }; + + /** + * Creates a plain object from a ConfidenceLevelMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + * @static + * @param {google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics} message ConfidenceLevelMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceLevelMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceLevel = 0; + object.metrics = null; + } + if (message.confidenceLevel != null && message.hasOwnProperty("confidenceLevel")) + object.confidenceLevel = options.json && !isFinite(message.confidenceLevel) ? String(message.confidenceLevel) : message.confidenceLevel; + if (message.metrics != null && message.hasOwnProperty("metrics")) + object.metrics = $root.google.cloud.documentai.v1.Evaluation.Metrics.toObject(message.metrics, options); + return object; + }; + + /** + * Converts this ConfidenceLevelMetrics to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + * @instance + * @returns {Object.} JSON object + */ + ConfidenceLevelMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidenceLevelMetrics + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidenceLevelMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics"; + }; + + return ConfidenceLevelMetrics; + })(); + + Evaluation.MultiConfidenceMetrics = (function() { + + /** + * Properties of a MultiConfidenceMetrics. + * @memberof google.cloud.documentai.v1.Evaluation + * @interface IMultiConfidenceMetrics + * @property {Array.|null} [confidenceLevelMetrics] MultiConfidenceMetrics confidenceLevelMetrics + * @property {Array.|null} [confidenceLevelMetricsExact] MultiConfidenceMetrics confidenceLevelMetricsExact + * @property {number|null} [auprc] MultiConfidenceMetrics auprc + * @property {number|null} [estimatedCalibrationError] MultiConfidenceMetrics estimatedCalibrationError + * @property {number|null} [auprcExact] MultiConfidenceMetrics auprcExact + * @property {number|null} [estimatedCalibrationErrorExact] MultiConfidenceMetrics estimatedCalibrationErrorExact + * @property {google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType|null} [metricsType] MultiConfidenceMetrics metricsType + */ + + /** + * Constructs a new MultiConfidenceMetrics. + * @memberof google.cloud.documentai.v1.Evaluation + * @classdesc Represents a MultiConfidenceMetrics. + * @implements IMultiConfidenceMetrics + * @constructor + * @param {google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics=} [properties] Properties to set + */ + function MultiConfidenceMetrics(properties) { + this.confidenceLevelMetrics = []; + this.confidenceLevelMetricsExact = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiConfidenceMetrics confidenceLevelMetrics. + * @member {Array.} confidenceLevelMetrics + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.confidenceLevelMetrics = $util.emptyArray; + + /** + * MultiConfidenceMetrics confidenceLevelMetricsExact. + * @member {Array.} confidenceLevelMetricsExact + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.confidenceLevelMetricsExact = $util.emptyArray; + + /** + * MultiConfidenceMetrics auprc. + * @member {number} auprc + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.auprc = 0; + + /** + * MultiConfidenceMetrics estimatedCalibrationError. + * @member {number} estimatedCalibrationError + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.estimatedCalibrationError = 0; + + /** + * MultiConfidenceMetrics auprcExact. + * @member {number} auprcExact + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.auprcExact = 0; + + /** + * MultiConfidenceMetrics estimatedCalibrationErrorExact. + * @member {number} estimatedCalibrationErrorExact + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.estimatedCalibrationErrorExact = 0; + + /** + * MultiConfidenceMetrics metricsType. + * @member {google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType} metricsType + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.metricsType = 0; + + /** + * Creates a new MultiConfidenceMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @static + * @param {google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics instance + */ + MultiConfidenceMetrics.create = function create(properties) { + return new MultiConfidenceMetrics(properties); + }; + + /** + * Encodes the specified MultiConfidenceMetrics message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @static + * @param {google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics} message MultiConfidenceMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiConfidenceMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceLevelMetrics != null && message.confidenceLevelMetrics.length) + for (var i = 0; i < message.confidenceLevelMetrics.length; ++i) + $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.encode(message.confidenceLevelMetrics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auprc != null && Object.hasOwnProperty.call(message, "auprc")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.auprc); + if (message.estimatedCalibrationError != null && Object.hasOwnProperty.call(message, "estimatedCalibrationError")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.estimatedCalibrationError); + if (message.confidenceLevelMetricsExact != null && message.confidenceLevelMetricsExact.length) + for (var i = 0; i < message.confidenceLevelMetricsExact.length; ++i) + $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.encode(message.confidenceLevelMetricsExact[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auprcExact != null && Object.hasOwnProperty.call(message, "auprcExact")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.auprcExact); + if (message.estimatedCalibrationErrorExact != null && Object.hasOwnProperty.call(message, "estimatedCalibrationErrorExact")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.estimatedCalibrationErrorExact); + if (message.metricsType != null && Object.hasOwnProperty.call(message, "metricsType")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.metricsType); + return writer; + }; + + /** + * Encodes the specified MultiConfidenceMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @static + * @param {google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics} message MultiConfidenceMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiConfidenceMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiConfidenceMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @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.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiConfidenceMetrics.decode = function decode(reader, 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.Evaluation.MultiConfidenceMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.confidenceLevelMetrics && message.confidenceLevelMetrics.length)) + message.confidenceLevelMetrics = []; + message.confidenceLevelMetrics.push($root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.confidenceLevelMetricsExact && message.confidenceLevelMetricsExact.length)) + message.confidenceLevelMetricsExact = []; + message.confidenceLevelMetricsExact.push($root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.decode(reader, reader.uint32())); + break; + } + case 2: { + message.auprc = reader.float(); + break; + } + case 3: { + message.estimatedCalibrationError = reader.float(); + break; + } + case 5: { + message.auprcExact = reader.float(); + break; + } + case 6: { + message.estimatedCalibrationErrorExact = reader.float(); + break; + } + case 7: { + message.metricsType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiConfidenceMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiConfidenceMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiConfidenceMetrics message. + * @function verify + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiConfidenceMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceLevelMetrics != null && message.hasOwnProperty("confidenceLevelMetrics")) { + if (!Array.isArray(message.confidenceLevelMetrics)) + return "confidenceLevelMetrics: array expected"; + for (var i = 0; i < message.confidenceLevelMetrics.length; ++i) { + var error = $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.verify(message.confidenceLevelMetrics[i]); + if (error) + return "confidenceLevelMetrics." + error; + } + } + if (message.confidenceLevelMetricsExact != null && message.hasOwnProperty("confidenceLevelMetricsExact")) { + if (!Array.isArray(message.confidenceLevelMetricsExact)) + return "confidenceLevelMetricsExact: array expected"; + for (var i = 0; i < message.confidenceLevelMetricsExact.length; ++i) { + var error = $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.verify(message.confidenceLevelMetricsExact[i]); + if (error) + return "confidenceLevelMetricsExact." + error; + } + } + if (message.auprc != null && message.hasOwnProperty("auprc")) + if (typeof message.auprc !== "number") + return "auprc: number expected"; + if (message.estimatedCalibrationError != null && message.hasOwnProperty("estimatedCalibrationError")) + if (typeof message.estimatedCalibrationError !== "number") + return "estimatedCalibrationError: number expected"; + if (message.auprcExact != null && message.hasOwnProperty("auprcExact")) + if (typeof message.auprcExact !== "number") + return "auprcExact: number expected"; + if (message.estimatedCalibrationErrorExact != null && message.hasOwnProperty("estimatedCalibrationErrorExact")) + if (typeof message.estimatedCalibrationErrorExact !== "number") + return "estimatedCalibrationErrorExact: number expected"; + if (message.metricsType != null && message.hasOwnProperty("metricsType")) + switch (message.metricsType) { + default: + return "metricsType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a MultiConfidenceMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics + */ + MultiConfidenceMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics) + return object; + var message = new $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics(); + if (object.confidenceLevelMetrics) { + if (!Array.isArray(object.confidenceLevelMetrics)) + throw TypeError(".google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.confidenceLevelMetrics: array expected"); + message.confidenceLevelMetrics = []; + for (var i = 0; i < object.confidenceLevelMetrics.length; ++i) { + if (typeof object.confidenceLevelMetrics[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.confidenceLevelMetrics: object expected"); + message.confidenceLevelMetrics[i] = $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.fromObject(object.confidenceLevelMetrics[i]); + } + } + if (object.confidenceLevelMetricsExact) { + if (!Array.isArray(object.confidenceLevelMetricsExact)) + throw TypeError(".google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.confidenceLevelMetricsExact: array expected"); + message.confidenceLevelMetricsExact = []; + for (var i = 0; i < object.confidenceLevelMetricsExact.length; ++i) { + if (typeof object.confidenceLevelMetricsExact[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.confidenceLevelMetricsExact: object expected"); + message.confidenceLevelMetricsExact[i] = $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.fromObject(object.confidenceLevelMetricsExact[i]); + } + } + if (object.auprc != null) + message.auprc = Number(object.auprc); + if (object.estimatedCalibrationError != null) + message.estimatedCalibrationError = Number(object.estimatedCalibrationError); + if (object.auprcExact != null) + message.auprcExact = Number(object.auprcExact); + if (object.estimatedCalibrationErrorExact != null) + message.estimatedCalibrationErrorExact = Number(object.estimatedCalibrationErrorExact); + switch (object.metricsType) { + default: + if (typeof object.metricsType === "number") { + message.metricsType = object.metricsType; + break; + } + break; + case "METRICS_TYPE_UNSPECIFIED": + case 0: + message.metricsType = 0; + break; + case "AGGREGATE": + case 1: + message.metricsType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a MultiConfidenceMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @static + * @param {google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics} message MultiConfidenceMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiConfidenceMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.confidenceLevelMetrics = []; + object.confidenceLevelMetricsExact = []; + } + if (options.defaults) { + object.auprc = 0; + object.estimatedCalibrationError = 0; + object.auprcExact = 0; + object.estimatedCalibrationErrorExact = 0; + object.metricsType = options.enums === String ? "METRICS_TYPE_UNSPECIFIED" : 0; + } + if (message.confidenceLevelMetrics && message.confidenceLevelMetrics.length) { + object.confidenceLevelMetrics = []; + for (var j = 0; j < message.confidenceLevelMetrics.length; ++j) + object.confidenceLevelMetrics[j] = $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.toObject(message.confidenceLevelMetrics[j], options); + } + if (message.auprc != null && message.hasOwnProperty("auprc")) + object.auprc = options.json && !isFinite(message.auprc) ? String(message.auprc) : message.auprc; + if (message.estimatedCalibrationError != null && message.hasOwnProperty("estimatedCalibrationError")) + object.estimatedCalibrationError = options.json && !isFinite(message.estimatedCalibrationError) ? String(message.estimatedCalibrationError) : message.estimatedCalibrationError; + if (message.confidenceLevelMetricsExact && message.confidenceLevelMetricsExact.length) { + object.confidenceLevelMetricsExact = []; + for (var j = 0; j < message.confidenceLevelMetricsExact.length; ++j) + object.confidenceLevelMetricsExact[j] = $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.toObject(message.confidenceLevelMetricsExact[j], options); + } + if (message.auprcExact != null && message.hasOwnProperty("auprcExact")) + object.auprcExact = options.json && !isFinite(message.auprcExact) ? String(message.auprcExact) : message.auprcExact; + if (message.estimatedCalibrationErrorExact != null && message.hasOwnProperty("estimatedCalibrationErrorExact")) + object.estimatedCalibrationErrorExact = options.json && !isFinite(message.estimatedCalibrationErrorExact) ? String(message.estimatedCalibrationErrorExact) : message.estimatedCalibrationErrorExact; + if (message.metricsType != null && message.hasOwnProperty("metricsType")) + object.metricsType = options.enums === String ? $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType[message.metricsType] === undefined ? message.metricsType : $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType[message.metricsType] : message.metricsType; + return object; + }; + + /** + * Converts this MultiConfidenceMetrics to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @instance + * @returns {Object.} JSON object + */ + MultiConfidenceMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiConfidenceMetrics + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiConfidenceMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics"; + }; + + /** + * MetricsType enum. + * @name google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType + * @enum {number} + * @property {number} METRICS_TYPE_UNSPECIFIED=0 METRICS_TYPE_UNSPECIFIED value + * @property {number} AGGREGATE=1 AGGREGATE value + */ + MultiConfidenceMetrics.MetricsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRICS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AGGREGATE"] = 1; + return values; + })(); + + return MultiConfidenceMetrics; + })(); + + return Evaluation; + })(); + + v1.CommonOperationMetadata = (function() { + + /** + * Properties of a CommonOperationMetadata. + * @memberof google.cloud.documentai.v1 + * @interface ICommonOperationMetadata + * @property {google.cloud.documentai.v1.CommonOperationMetadata.State|null} [state] CommonOperationMetadata state + * @property {string|null} [stateMessage] CommonOperationMetadata stateMessage + * @property {string|null} [resource] CommonOperationMetadata resource + * @property {google.protobuf.ITimestamp|null} [createTime] CommonOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CommonOperationMetadata updateTime + */ + + /** + * Constructs a new CommonOperationMetadata. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a CommonOperationMetadata. + * @implements ICommonOperationMetadata + * @constructor + * @param {google.cloud.documentai.v1.ICommonOperationMetadata=} [properties] Properties to set + */ + function CommonOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonOperationMetadata state. + * @member {google.cloud.documentai.v1.CommonOperationMetadata.State} state + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.state = 0; + + /** + * CommonOperationMetadata stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.stateMessage = ""; + + /** + * CommonOperationMetadata resource. + * @member {string} resource + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.resource = ""; + + /** + * CommonOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.createTime = null; + + /** + * CommonOperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.updateTime = null; + + /** + * Creates a new CommonOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @static + * @param {google.cloud.documentai.v1.ICommonOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.CommonOperationMetadata} CommonOperationMetadata instance + */ + CommonOperationMetadata.create = function create(properties) { + return new CommonOperationMetadata(properties); + }; + + /** + * Encodes the specified CommonOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1.CommonOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @static + * @param {google.cloud.documentai.v1.ICommonOperationMetadata} message CommonOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); + 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resource); + return writer; + }; + + /** + * Encodes the specified CommonOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.CommonOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @static + * @param {google.cloud.documentai.v1.ICommonOperationMetadata} message CommonOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @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.CommonOperationMetadata} CommonOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonOperationMetadata.decode = function decode(reader, 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.CommonOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.stateMessage = reader.string(); + break; + } + case 5: { + message.resource = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.CommonOperationMetadata} CommonOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonOperationMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a CommonOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.CommonOperationMetadata} CommonOperationMetadata + */ + CommonOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.CommonOperationMetadata) + return object; + var message = new $root.google.cloud.documentai.v1.CommonOperationMetadata(); + 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 "RUNNING": + case 1: + message.state = 1; + break; + case "CANCELLING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.resource != null) + message.resource = String(object.resource); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.documentai.v1.CommonOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.documentai.v1.CommonOperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a CommonOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @static + * @param {google.cloud.documentai.v1.CommonOperationMetadata} message CommonOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.createTime = null; + object.updateTime = null; + object.resource = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1.CommonOperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.CommonOperationMetadata.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + return object; + }; + + /** + * Converts this CommonOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CommonOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.CommonOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.CommonOperationMetadata"; + }; + + /** + * State enum. + * @name google.cloud.documentai.v1.CommonOperationMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} CANCELLING=2 CANCELLING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} CANCELLED=5 CANCELLED value + */ + CommonOperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "CANCELLING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return CommonOperationMetadata; + })(); + + v1.ProcessorVersion = (function() { + + /** + * Properties of a ProcessorVersion. + * @memberof google.cloud.documentai.v1 + * @interface IProcessorVersion + * @property {string|null} [name] ProcessorVersion name + * @property {string|null} [displayName] ProcessorVersion displayName + * @property {google.cloud.documentai.v1.IDocumentSchema|null} [documentSchema] ProcessorVersion documentSchema + * @property {google.cloud.documentai.v1.ProcessorVersion.State|null} [state] ProcessorVersion state + * @property {google.protobuf.ITimestamp|null} [createTime] ProcessorVersion createTime + * @property {google.cloud.documentai.v1.IEvaluationReference|null} [latestEvaluation] ProcessorVersion latestEvaluation + * @property {string|null} [kmsKeyName] ProcessorVersion kmsKeyName + * @property {string|null} [kmsKeyVersionName] ProcessorVersion kmsKeyVersionName + * @property {boolean|null} [googleManaged] ProcessorVersion googleManaged + * @property {google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo|null} [deprecationInfo] ProcessorVersion deprecationInfo + * @property {google.cloud.documentai.v1.ProcessorVersion.ModelType|null} [modelType] ProcessorVersion modelType + * @property {boolean|null} [satisfiesPzs] ProcessorVersion satisfiesPzs + * @property {boolean|null} [satisfiesPzi] ProcessorVersion satisfiesPzi + * @property {google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo|null} [genAiModelInfo] ProcessorVersion genAiModelInfo + */ + + /** + * Constructs a new ProcessorVersion. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ProcessorVersion. + * @implements IProcessorVersion + * @constructor + * @param {google.cloud.documentai.v1.IProcessorVersion=} [properties] Properties to set + */ + function ProcessorVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessorVersion name. + * @member {string} name + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.name = ""; + + /** + * ProcessorVersion displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.displayName = ""; + + /** + * ProcessorVersion documentSchema. + * @member {google.cloud.documentai.v1.IDocumentSchema|null|undefined} documentSchema + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.documentSchema = null; + + /** + * ProcessorVersion state. + * @member {google.cloud.documentai.v1.ProcessorVersion.State} state + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.state = 0; + + /** + * ProcessorVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.createTime = null; + + /** + * ProcessorVersion latestEvaluation. + * @member {google.cloud.documentai.v1.IEvaluationReference|null|undefined} latestEvaluation + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.latestEvaluation = null; + + /** + * ProcessorVersion kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.kmsKeyName = ""; + + /** + * ProcessorVersion kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.kmsKeyVersionName = ""; + + /** + * ProcessorVersion googleManaged. + * @member {boolean} googleManaged + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.googleManaged = false; + + /** + * ProcessorVersion deprecationInfo. + * @member {google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo|null|undefined} deprecationInfo + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.deprecationInfo = null; + + /** + * ProcessorVersion modelType. + * @member {google.cloud.documentai.v1.ProcessorVersion.ModelType} modelType + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.modelType = 0; + + /** + * ProcessorVersion satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.satisfiesPzs = false; + + /** + * ProcessorVersion satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.satisfiesPzi = false; + + /** + * ProcessorVersion genAiModelInfo. + * @member {google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo|null|undefined} genAiModelInfo + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.genAiModelInfo = null; + + /** + * Creates a new ProcessorVersion instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @static + * @param {google.cloud.documentai.v1.IProcessorVersion=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessorVersion} ProcessorVersion instance + */ + ProcessorVersion.create = function create(properties) { + return new ProcessorVersion(properties); + }; + + /** + * Encodes the specified ProcessorVersion message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @static + * @param {google.cloud.documentai.v1.IProcessorVersion} message ProcessorVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorVersion.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.latestEvaluation != null && Object.hasOwnProperty.call(message, "latestEvaluation")) + $root.google.cloud.documentai.v1.EvaluationReference.encode(message.latestEvaluation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.kmsKeyName); + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.kmsKeyVersionName); + if (message.googleManaged != null && Object.hasOwnProperty.call(message, "googleManaged")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.googleManaged); + if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) + $root.google.cloud.documentai.v1.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.deprecationInfo != null && Object.hasOwnProperty.call(message, "deprecationInfo")) + $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.encode(message.deprecationInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.modelType); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.satisfiesPzi); + if (message.genAiModelInfo != null && Object.hasOwnProperty.call(message, "genAiModelInfo")) + $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.encode(message.genAiModelInfo, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessorVersion message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @static + * @param {google.cloud.documentai.v1.IProcessorVersion} message ProcessorVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessorVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @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.ProcessorVersion} ProcessorVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorVersion.decode = function decode(reader, 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.ProcessorVersion(); + 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 12: { + message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.latestEvaluation = $root.google.cloud.documentai.v1.EvaluationReference.decode(reader, reader.uint32()); + break; + } + case 9: { + message.kmsKeyName = reader.string(); + break; + } + case 10: { + message.kmsKeyVersionName = reader.string(); + break; + } + case 11: { + message.googleManaged = reader.bool(); + break; + } + case 13: { + message.deprecationInfo = $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.decode(reader, reader.uint32()); + break; + } + case 15: { + message.modelType = reader.int32(); + break; + } + case 16: { + message.satisfiesPzs = reader.bool(); + break; + } + case 17: { + message.satisfiesPzi = reader.bool(); + break; + } + case 18: { + message.genAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessorVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessorVersion} ProcessorVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessorVersion message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessorVersion.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.documentSchema != null && message.hasOwnProperty("documentSchema")) { + var error = $root.google.cloud.documentai.v1.DocumentSchema.verify(message.documentSchema); + if (error) + return "documentSchema." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.latestEvaluation != null && message.hasOwnProperty("latestEvaluation")) { + var error = $root.google.cloud.documentai.v1.EvaluationReference.verify(message.latestEvaluation); + if (error) + return "latestEvaluation." + error; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (!$util.isString(message.kmsKeyVersionName)) + return "kmsKeyVersionName: string expected"; + if (message.googleManaged != null && message.hasOwnProperty("googleManaged")) + if (typeof message.googleManaged !== "boolean") + return "googleManaged: boolean expected"; + if (message.deprecationInfo != null && message.hasOwnProperty("deprecationInfo")) { + var error = $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.verify(message.deprecationInfo); + if (error) + return "deprecationInfo." + error; + } + if (message.modelType != null && message.hasOwnProperty("modelType")) + switch (message.modelType) { + default: + return "modelType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + if (message.genAiModelInfo != null && message.hasOwnProperty("genAiModelInfo")) { + var error = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.verify(message.genAiModelInfo); + if (error) + return "genAiModelInfo." + error; + } + return null; + }; + + /** + * Creates a ProcessorVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessorVersion} ProcessorVersion + */ + ProcessorVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersion) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessorVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.documentSchema != null) { + if (typeof object.documentSchema !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.documentSchema: object expected"); + message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.fromObject(object.documentSchema); + } + 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 "DEPLOYED": + case 1: + message.state = 1; + break; + case "DEPLOYING": + case 2: + message.state = 2; + break; + case "UNDEPLOYED": + case 3: + message.state = 3; + break; + case "UNDEPLOYING": + case 4: + message.state = 4; + break; + case "CREATING": + case 5: + message.state = 5; + break; + case "DELETING": + case 6: + message.state = 6; + break; + case "FAILED": + case 7: + message.state = 7; + break; + case "IMPORTING": + case 8: + message.state = 8; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.latestEvaluation != null) { + if (typeof object.latestEvaluation !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.latestEvaluation: object expected"); + message.latestEvaluation = $root.google.cloud.documentai.v1.EvaluationReference.fromObject(object.latestEvaluation); + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyVersionName != null) + message.kmsKeyVersionName = String(object.kmsKeyVersionName); + if (object.googleManaged != null) + message.googleManaged = Boolean(object.googleManaged); + if (object.deprecationInfo != null) { + if (typeof object.deprecationInfo !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.deprecationInfo: object expected"); + message.deprecationInfo = $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.fromObject(object.deprecationInfo); + } + switch (object.modelType) { + default: + if (typeof object.modelType === "number") { + message.modelType = object.modelType; + break; + } + break; + case "MODEL_TYPE_UNSPECIFIED": + case 0: + message.modelType = 0; + break; + case "MODEL_TYPE_GENERATIVE": + case 1: + message.modelType = 1; + break; + case "MODEL_TYPE_CUSTOM": + case 2: + message.modelType = 2; + break; + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + if (object.genAiModelInfo != null) { + if (typeof object.genAiModelInfo !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.genAiModelInfo: object expected"); + message.genAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.fromObject(object.genAiModelInfo); + } + return message; + }; + + /** + * Creates a plain object from a ProcessorVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion} message ProcessorVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessorVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.latestEvaluation = null; + object.kmsKeyName = ""; + object.kmsKeyVersionName = ""; + object.googleManaged = false; + object.documentSchema = null; + object.deprecationInfo = null; + object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; + object.satisfiesPzs = false; + object.satisfiesPzi = false; + object.genAiModelInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1.ProcessorVersion.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.ProcessorVersion.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.latestEvaluation != null && message.hasOwnProperty("latestEvaluation")) + object.latestEvaluation = $root.google.cloud.documentai.v1.EvaluationReference.toObject(message.latestEvaluation, options); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + object.kmsKeyVersionName = message.kmsKeyVersionName; + if (message.googleManaged != null && message.hasOwnProperty("googleManaged")) + object.googleManaged = message.googleManaged; + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) + object.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.toObject(message.documentSchema, options); + if (message.deprecationInfo != null && message.hasOwnProperty("deprecationInfo")) + object.deprecationInfo = $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.toObject(message.deprecationInfo, options); + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = options.enums === String ? $root.google.cloud.documentai.v1.ProcessorVersion.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.documentai.v1.ProcessorVersion.ModelType[message.modelType] : message.modelType; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + if (message.genAiModelInfo != null && message.hasOwnProperty("genAiModelInfo")) + object.genAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.toObject(message.genAiModelInfo, options); + return object; + }; + + /** + * Converts this ProcessorVersion to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @instance + * @returns {Object.} JSON object + */ + ProcessorVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessorVersion + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessorVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersion"; + }; + + ProcessorVersion.DeprecationInfo = (function() { + + /** + * Properties of a DeprecationInfo. + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @interface IDeprecationInfo + * @property {google.protobuf.ITimestamp|null} [deprecationTime] DeprecationInfo deprecationTime + * @property {string|null} [replacementProcessorVersion] DeprecationInfo replacementProcessorVersion + */ + + /** + * Constructs a new DeprecationInfo. + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @classdesc Represents a DeprecationInfo. + * @implements IDeprecationInfo + * @constructor + * @param {google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo=} [properties] Properties to set + */ + function DeprecationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeprecationInfo deprecationTime. + * @member {google.protobuf.ITimestamp|null|undefined} deprecationTime + * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + * @instance + */ + DeprecationInfo.prototype.deprecationTime = null; + + /** + * DeprecationInfo replacementProcessorVersion. + * @member {string} replacementProcessorVersion + * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + * @instance + */ + DeprecationInfo.prototype.replacementProcessorVersion = ""; + + /** + * Creates a new DeprecationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo} DeprecationInfo instance + */ + DeprecationInfo.create = function create(properties) { + return new DeprecationInfo(properties); + }; + + /** + * Encodes the specified DeprecationInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo} message DeprecationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeprecationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecationTime != null && Object.hasOwnProperty.call(message, "deprecationTime")) + $root.google.protobuf.Timestamp.encode(message.deprecationTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.replacementProcessorVersion != null && Object.hasOwnProperty.call(message, "replacementProcessorVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.replacementProcessorVersion); + return writer; + }; + + /** + * Encodes the specified DeprecationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo} message DeprecationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeprecationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeprecationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + * @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.ProcessorVersion.DeprecationInfo} DeprecationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeprecationInfo.decode = function decode(reader, 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.ProcessorVersion.DeprecationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.replacementProcessorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeprecationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo} DeprecationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeprecationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeprecationInfo message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeprecationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecationTime != null && message.hasOwnProperty("deprecationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deprecationTime); + if (error) + return "deprecationTime." + error; + } + if (message.replacementProcessorVersion != null && message.hasOwnProperty("replacementProcessorVersion")) + if (!$util.isString(message.replacementProcessorVersion)) + return "replacementProcessorVersion: string expected"; + return null; + }; + + /** + * Creates a DeprecationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo} DeprecationInfo + */ + DeprecationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo(); + if (object.deprecationTime != null) { + if (typeof object.deprecationTime !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.deprecationTime: object expected"); + message.deprecationTime = $root.google.protobuf.Timestamp.fromObject(object.deprecationTime); + } + if (object.replacementProcessorVersion != null) + message.replacementProcessorVersion = String(object.replacementProcessorVersion); + return message; + }; + + /** + * Creates a plain object from a DeprecationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo} message DeprecationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeprecationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deprecationTime = null; + object.replacementProcessorVersion = ""; + } + if (message.deprecationTime != null && message.hasOwnProperty("deprecationTime")) + object.deprecationTime = $root.google.protobuf.Timestamp.toObject(message.deprecationTime, options); + if (message.replacementProcessorVersion != null && message.hasOwnProperty("replacementProcessorVersion")) + object.replacementProcessorVersion = message.replacementProcessorVersion; + return object; + }; + + /** + * Converts this DeprecationInfo to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + * @instance + * @returns {Object.} JSON object + */ + DeprecationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeprecationInfo + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeprecationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo"; + }; + + return DeprecationInfo; + })(); + + ProcessorVersion.GenAiModelInfo = (function() { + + /** + * Properties of a GenAiModelInfo. + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @interface IGenAiModelInfo + * @property {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null} [foundationGenAiModelInfo] GenAiModelInfo foundationGenAiModelInfo + * @property {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null} [customGenAiModelInfo] GenAiModelInfo customGenAiModelInfo + */ + + /** + * Constructs a new GenAiModelInfo. + * @memberof google.cloud.documentai.v1.ProcessorVersion + * @classdesc Represents a GenAiModelInfo. + * @implements IGenAiModelInfo + * @constructor + * @param {google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo=} [properties] Properties to set + */ + function GenAiModelInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenAiModelInfo foundationGenAiModelInfo. + * @member {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null|undefined} foundationGenAiModelInfo + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @instance + */ + GenAiModelInfo.prototype.foundationGenAiModelInfo = null; + + /** + * GenAiModelInfo customGenAiModelInfo. + * @member {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null|undefined} customGenAiModelInfo + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @instance + */ + GenAiModelInfo.prototype.customGenAiModelInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenAiModelInfo modelInfo. + * @member {"foundationGenAiModelInfo"|"customGenAiModelInfo"|undefined} modelInfo + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @instance + */ + Object.defineProperty(GenAiModelInfo.prototype, "modelInfo", { + get: $util.oneOfGetter($oneOfFields = ["foundationGenAiModelInfo", "customGenAiModelInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenAiModelInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo} GenAiModelInfo instance + */ + GenAiModelInfo.create = function create(properties) { + return new GenAiModelInfo(properties); + }; + + /** + * Encodes the specified GenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo} message GenAiModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiModelInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.foundationGenAiModelInfo != null && Object.hasOwnProperty.call(message, "foundationGenAiModelInfo")) + $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.encode(message.foundationGenAiModelInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customGenAiModelInfo != null && Object.hasOwnProperty.call(message, "customGenAiModelInfo")) + $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.encode(message.customGenAiModelInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo} message GenAiModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiModelInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenAiModelInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @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.ProcessorVersion.GenAiModelInfo} GenAiModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiModelInfo.decode = function decode(reader, 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.ProcessorVersion.GenAiModelInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.foundationGenAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + message.customGenAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenAiModelInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo} GenAiModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiModelInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenAiModelInfo message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenAiModelInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.foundationGenAiModelInfo != null && message.hasOwnProperty("foundationGenAiModelInfo")) { + properties.modelInfo = 1; + { + var error = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify(message.foundationGenAiModelInfo); + if (error) + return "foundationGenAiModelInfo." + error; + } + } + if (message.customGenAiModelInfo != null && message.hasOwnProperty("customGenAiModelInfo")) { + if (properties.modelInfo === 1) + return "modelInfo: multiple values"; + properties.modelInfo = 1; + { + var error = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify(message.customGenAiModelInfo); + if (error) + return "customGenAiModelInfo." + error; + } + } + return null; + }; + + /** + * Creates a GenAiModelInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo} GenAiModelInfo + */ + GenAiModelInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo(); + if (object.foundationGenAiModelInfo != null) { + if (typeof object.foundationGenAiModelInfo !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.foundationGenAiModelInfo: object expected"); + message.foundationGenAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.fromObject(object.foundationGenAiModelInfo); + } + if (object.customGenAiModelInfo != null) { + if (typeof object.customGenAiModelInfo !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.customGenAiModelInfo: object expected"); + message.customGenAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.fromObject(object.customGenAiModelInfo); + } + return message; + }; + + /** + * Creates a plain object from a GenAiModelInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo} message GenAiModelInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenAiModelInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.foundationGenAiModelInfo != null && message.hasOwnProperty("foundationGenAiModelInfo")) { + object.foundationGenAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.toObject(message.foundationGenAiModelInfo, options); + if (options.oneofs) + object.modelInfo = "foundationGenAiModelInfo"; + } + if (message.customGenAiModelInfo != null && message.hasOwnProperty("customGenAiModelInfo")) { + object.customGenAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.toObject(message.customGenAiModelInfo, options); + if (options.oneofs) + object.modelInfo = "customGenAiModelInfo"; + } + return object; + }; + + /** + * Converts this GenAiModelInfo to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @instance + * @returns {Object.} JSON object + */ + GenAiModelInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenAiModelInfo + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenAiModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo"; + }; + + GenAiModelInfo.FoundationGenAiModelInfo = (function() { + + /** + * Properties of a FoundationGenAiModelInfo. + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @interface IFoundationGenAiModelInfo + * @property {boolean|null} [finetuningAllowed] FoundationGenAiModelInfo finetuningAllowed + * @property {number|null} [minTrainLabeledDocuments] FoundationGenAiModelInfo minTrainLabeledDocuments + */ + + /** + * Constructs a new FoundationGenAiModelInfo. + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @classdesc Represents a FoundationGenAiModelInfo. + * @implements IFoundationGenAiModelInfo + * @constructor + * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo=} [properties] Properties to set + */ + function FoundationGenAiModelInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FoundationGenAiModelInfo finetuningAllowed. + * @member {boolean} finetuningAllowed + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @instance + */ + FoundationGenAiModelInfo.prototype.finetuningAllowed = false; + + /** + * FoundationGenAiModelInfo minTrainLabeledDocuments. + * @member {number} minTrainLabeledDocuments + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @instance + */ + FoundationGenAiModelInfo.prototype.minTrainLabeledDocuments = 0; + + /** + * Creates a new FoundationGenAiModelInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo instance + */ + FoundationGenAiModelInfo.create = function create(properties) { + return new FoundationGenAiModelInfo(properties); + }; + + /** + * Encodes the specified FoundationGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo} message FoundationGenAiModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FoundationGenAiModelInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finetuningAllowed != null && Object.hasOwnProperty.call(message, "finetuningAllowed")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.finetuningAllowed); + if (message.minTrainLabeledDocuments != null && Object.hasOwnProperty.call(message, "minTrainLabeledDocuments")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minTrainLabeledDocuments); + return writer; + }; + + /** + * Encodes the specified FoundationGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo} message FoundationGenAiModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FoundationGenAiModelInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @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.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FoundationGenAiModelInfo.decode = function decode(reader, 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.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.finetuningAllowed = reader.bool(); + break; + } + case 2: { + message.minTrainLabeledDocuments = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FoundationGenAiModelInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FoundationGenAiModelInfo message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FoundationGenAiModelInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finetuningAllowed != null && message.hasOwnProperty("finetuningAllowed")) + if (typeof message.finetuningAllowed !== "boolean") + return "finetuningAllowed: boolean expected"; + if (message.minTrainLabeledDocuments != null && message.hasOwnProperty("minTrainLabeledDocuments")) + if (!$util.isInteger(message.minTrainLabeledDocuments)) + return "minTrainLabeledDocuments: integer expected"; + return null; + }; + + /** + * Creates a FoundationGenAiModelInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo + */ + FoundationGenAiModelInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo(); + if (object.finetuningAllowed != null) + message.finetuningAllowed = Boolean(object.finetuningAllowed); + if (object.minTrainLabeledDocuments != null) + message.minTrainLabeledDocuments = object.minTrainLabeledDocuments | 0; + return message; + }; + + /** + * Creates a plain object from a FoundationGenAiModelInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} message FoundationGenAiModelInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FoundationGenAiModelInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finetuningAllowed = false; + object.minTrainLabeledDocuments = 0; + } + if (message.finetuningAllowed != null && message.hasOwnProperty("finetuningAllowed")) + object.finetuningAllowed = message.finetuningAllowed; + if (message.minTrainLabeledDocuments != null && message.hasOwnProperty("minTrainLabeledDocuments")) + object.minTrainLabeledDocuments = message.minTrainLabeledDocuments; + return object; + }; + + /** + * Converts this FoundationGenAiModelInfo to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @instance + * @returns {Object.} JSON object + */ + FoundationGenAiModelInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FoundationGenAiModelInfo + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FoundationGenAiModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo"; + }; + + return FoundationGenAiModelInfo; + })(); + + GenAiModelInfo.CustomGenAiModelInfo = (function() { + + /** + * Properties of a CustomGenAiModelInfo. + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @interface ICustomGenAiModelInfo + * @property {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|null} [customModelType] CustomGenAiModelInfo customModelType + * @property {string|null} [baseProcessorVersionId] CustomGenAiModelInfo baseProcessorVersionId + */ + + /** + * Constructs a new CustomGenAiModelInfo. + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo + * @classdesc Represents a CustomGenAiModelInfo. + * @implements ICustomGenAiModelInfo + * @constructor + * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo=} [properties] Properties to set + */ + function CustomGenAiModelInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomGenAiModelInfo customModelType. + * @member {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType} customModelType + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @instance + */ + CustomGenAiModelInfo.prototype.customModelType = 0; + + /** + * CustomGenAiModelInfo baseProcessorVersionId. + * @member {string} baseProcessorVersionId + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @instance + */ + CustomGenAiModelInfo.prototype.baseProcessorVersionId = ""; + + /** + * Creates a new CustomGenAiModelInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo instance + */ + CustomGenAiModelInfo.create = function create(properties) { + return new CustomGenAiModelInfo(properties); + }; + + /** + * Encodes the specified CustomGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo} message CustomGenAiModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomGenAiModelInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customModelType != null && Object.hasOwnProperty.call(message, "customModelType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.customModelType); + if (message.baseProcessorVersionId != null && Object.hasOwnProperty.call(message, "baseProcessorVersionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseProcessorVersionId); + return writer; + }; + + /** + * Encodes the specified CustomGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo} message CustomGenAiModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomGenAiModelInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomGenAiModelInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @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.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomGenAiModelInfo.decode = function decode(reader, 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.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.customModelType = reader.int32(); + break; + } + case 2: { + message.baseProcessorVersionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomGenAiModelInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomGenAiModelInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomGenAiModelInfo message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomGenAiModelInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customModelType != null && message.hasOwnProperty("customModelType")) + switch (message.customModelType) { + default: + return "customModelType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.baseProcessorVersionId != null && message.hasOwnProperty("baseProcessorVersionId")) + if (!$util.isString(message.baseProcessorVersionId)) + return "baseProcessorVersionId: string expected"; + return null; + }; + + /** + * Creates a CustomGenAiModelInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo + */ + CustomGenAiModelInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo(); + switch (object.customModelType) { + default: + if (typeof object.customModelType === "number") { + message.customModelType = object.customModelType; + break; + } + break; + case "CUSTOM_MODEL_TYPE_UNSPECIFIED": + case 0: + message.customModelType = 0; + break; + case "VERSIONED_FOUNDATION": + case 1: + message.customModelType = 1; + break; + case "FINE_TUNED": + case 2: + message.customModelType = 2; + break; + } + if (object.baseProcessorVersionId != null) + message.baseProcessorVersionId = String(object.baseProcessorVersionId); + return message; + }; + + /** + * Creates a plain object from a CustomGenAiModelInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} message CustomGenAiModelInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomGenAiModelInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customModelType = options.enums === String ? "CUSTOM_MODEL_TYPE_UNSPECIFIED" : 0; + object.baseProcessorVersionId = ""; + } + if (message.customModelType != null && message.hasOwnProperty("customModelType")) + object.customModelType = options.enums === String ? $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType[message.customModelType] === undefined ? message.customModelType : $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType[message.customModelType] : message.customModelType; + if (message.baseProcessorVersionId != null && message.hasOwnProperty("baseProcessorVersionId")) + object.baseProcessorVersionId = message.baseProcessorVersionId; + return object; + }; + + /** + * Converts this CustomGenAiModelInfo to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @instance + * @returns {Object.} JSON object + */ + CustomGenAiModelInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomGenAiModelInfo + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomGenAiModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo"; + }; + + /** + * CustomModelType enum. + * @name google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType + * @enum {number} + * @property {number} CUSTOM_MODEL_TYPE_UNSPECIFIED=0 CUSTOM_MODEL_TYPE_UNSPECIFIED value + * @property {number} VERSIONED_FOUNDATION=1 VERSIONED_FOUNDATION value + * @property {number} FINE_TUNED=2 FINE_TUNED value + */ + CustomGenAiModelInfo.CustomModelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CUSTOM_MODEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERSIONED_FOUNDATION"] = 1; + values[valuesById[2] = "FINE_TUNED"] = 2; + return values; + })(); + + return CustomGenAiModelInfo; + })(); + + return GenAiModelInfo; + })(); + + /** + * State enum. + * @name google.cloud.documentai.v1.ProcessorVersion.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} DEPLOYED=1 DEPLOYED value + * @property {number} DEPLOYING=2 DEPLOYING value + * @property {number} UNDEPLOYED=3 UNDEPLOYED value + * @property {number} UNDEPLOYING=4 UNDEPLOYING value + * @property {number} CREATING=5 CREATING value + * @property {number} DELETING=6 DELETING value + * @property {number} FAILED=7 FAILED value + * @property {number} IMPORTING=8 IMPORTING value + */ + ProcessorVersion.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEPLOYED"] = 1; + values[valuesById[2] = "DEPLOYING"] = 2; + values[valuesById[3] = "UNDEPLOYED"] = 3; + values[valuesById[4] = "UNDEPLOYING"] = 4; + values[valuesById[5] = "CREATING"] = 5; + values[valuesById[6] = "DELETING"] = 6; + values[valuesById[7] = "FAILED"] = 7; + values[valuesById[8] = "IMPORTING"] = 8; + return values; + })(); + + /** + * ModelType enum. + * @name google.cloud.documentai.v1.ProcessorVersion.ModelType + * @enum {number} + * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value + * @property {number} MODEL_TYPE_GENERATIVE=1 MODEL_TYPE_GENERATIVE value + * @property {number} MODEL_TYPE_CUSTOM=2 MODEL_TYPE_CUSTOM value + */ + ProcessorVersion.ModelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODEL_TYPE_GENERATIVE"] = 1; + values[valuesById[2] = "MODEL_TYPE_CUSTOM"] = 2; + return values; + })(); + + return ProcessorVersion; + })(); + + v1.ProcessorVersionAlias = (function() { + + /** + * Properties of a ProcessorVersionAlias. + * @memberof google.cloud.documentai.v1 + * @interface IProcessorVersionAlias + * @property {string|null} [alias] ProcessorVersionAlias alias + * @property {string|null} [processorVersion] ProcessorVersionAlias processorVersion + */ + + /** + * Constructs a new ProcessorVersionAlias. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ProcessorVersionAlias. + * @implements IProcessorVersionAlias + * @constructor + * @param {google.cloud.documentai.v1.IProcessorVersionAlias=} [properties] Properties to set + */ + function ProcessorVersionAlias(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessorVersionAlias alias. + * @member {string} alias + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @instance + */ + ProcessorVersionAlias.prototype.alias = ""; + + /** + * ProcessorVersionAlias processorVersion. + * @member {string} processorVersion + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @instance + */ + ProcessorVersionAlias.prototype.processorVersion = ""; + + /** + * Creates a new ProcessorVersionAlias instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {google.cloud.documentai.v1.IProcessorVersionAlias=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessorVersionAlias} ProcessorVersionAlias instance + */ + ProcessorVersionAlias.create = function create(properties) { + return new ProcessorVersionAlias(properties); + }; + + /** + * Encodes the specified ProcessorVersionAlias message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersionAlias.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {google.cloud.documentai.v1.IProcessorVersionAlias} message ProcessorVersionAlias message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorVersionAlias.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.alias); + if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.processorVersion); + return writer; + }; + + /** + * Encodes the specified ProcessorVersionAlias message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersionAlias.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {google.cloud.documentai.v1.IProcessorVersionAlias} message ProcessorVersionAlias message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorVersionAlias.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessorVersionAlias message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @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.ProcessorVersionAlias} ProcessorVersionAlias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorVersionAlias.decode = function decode(reader, 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.ProcessorVersionAlias(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.alias = reader.string(); + break; + } + case 2: { + message.processorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessorVersionAlias message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessorVersionAlias} ProcessorVersionAlias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorVersionAlias.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessorVersionAlias message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessorVersionAlias.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alias != null && message.hasOwnProperty("alias")) + if (!$util.isString(message.alias)) + return "alias: string expected"; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + if (!$util.isString(message.processorVersion)) + return "processorVersion: string expected"; + return null; + }; + + /** + * Creates a ProcessorVersionAlias message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessorVersionAlias} ProcessorVersionAlias + */ + ProcessorVersionAlias.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersionAlias) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessorVersionAlias(); + if (object.alias != null) + message.alias = String(object.alias); + if (object.processorVersion != null) + message.processorVersion = String(object.processorVersion); + return message; + }; + + /** + * Creates a plain object from a ProcessorVersionAlias message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {google.cloud.documentai.v1.ProcessorVersionAlias} message ProcessorVersionAlias + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessorVersionAlias.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.alias = ""; + object.processorVersion = ""; + } + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = message.alias; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + object.processorVersion = message.processorVersion; + return object; + }; + + /** + * Converts this ProcessorVersionAlias to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @instance + * @returns {Object.} JSON object + */ + ProcessorVersionAlias.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessorVersionAlias + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessorVersionAlias + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessorVersionAlias.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersionAlias"; + }; + + return ProcessorVersionAlias; + })(); + + v1.Processor = (function() { + + /** + * Properties of a Processor. + * @memberof google.cloud.documentai.v1 + * @interface IProcessor + * @property {string|null} [name] Processor name + * @property {string|null} [type] Processor type + * @property {string|null} [displayName] Processor displayName + * @property {google.cloud.documentai.v1.Processor.State|null} [state] Processor state + * @property {string|null} [defaultProcessorVersion] Processor defaultProcessorVersion + * @property {Array.|null} [processorVersionAliases] Processor processorVersionAliases + * @property {string|null} [processEndpoint] Processor processEndpoint + * @property {google.protobuf.ITimestamp|null} [createTime] Processor createTime + * @property {string|null} [kmsKeyName] Processor kmsKeyName + * @property {boolean|null} [satisfiesPzs] Processor satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Processor satisfiesPzi + */ + + /** + * Constructs a new Processor. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a Processor. + * @implements IProcessor + * @constructor + * @param {google.cloud.documentai.v1.IProcessor=} [properties] Properties to set + */ + function Processor(properties) { + this.processorVersionAliases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Processor name. + * @member {string} name + * @memberof google.cloud.documentai.v1.Processor + * @instance + */ + Processor.prototype.name = ""; + + /** + * Processor type. + * @member {string} type + * @memberof google.cloud.documentai.v1.Processor + * @instance + */ + Processor.prototype.type = ""; + + /** + * Processor displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1.Processor + * @instance + */ + Processor.prototype.displayName = ""; + + /** + * Processor state. + * @member {google.cloud.documentai.v1.Processor.State} state + * @memberof google.cloud.documentai.v1.Processor + * @instance + */ + Processor.prototype.state = 0; + + /** + * Processor defaultProcessorVersion. + * @member {string} defaultProcessorVersion + * @memberof google.cloud.documentai.v1.Processor + * @instance + */ + Processor.prototype.defaultProcessorVersion = ""; + + /** + * Processor processorVersionAliases. + * @member {Array.} processorVersionAliases + * @memberof google.cloud.documentai.v1.Processor + * @instance + */ + Processor.prototype.processorVersionAliases = $util.emptyArray; + + /** + * Processor processEndpoint. + * @member {string} processEndpoint + * @memberof google.cloud.documentai.v1.Processor + * @instance + */ + Processor.prototype.processEndpoint = ""; + + /** + * Processor createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1.Processor + * @instance + */ + Processor.prototype.createTime = null; + + /** + * Processor kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.documentai.v1.Processor + * @instance + */ + Processor.prototype.kmsKeyName = ""; + + /** + * Processor satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.documentai.v1.Processor + * @instance + */ + Processor.prototype.satisfiesPzs = false; + + /** + * Processor satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.documentai.v1.Processor + * @instance + */ + Processor.prototype.satisfiesPzi = false; + + /** + * Creates a new Processor instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.Processor + * @static + * @param {google.cloud.documentai.v1.IProcessor=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.Processor} Processor instance + */ + Processor.create = function create(properties) { + return new Processor(properties); + }; + + /** + * Encodes the specified Processor message. Does not implicitly {@link google.cloud.documentai.v1.Processor.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.Processor + * @static + * @param {google.cloud.documentai.v1.IProcessor} message Processor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Processor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.processEndpoint != null && Object.hasOwnProperty.call(message, "processEndpoint")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.processEndpoint); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.kmsKeyName); + if (message.defaultProcessorVersion != null && Object.hasOwnProperty.call(message, "defaultProcessorVersion")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.defaultProcessorVersion); + if (message.processorVersionAliases != null && message.processorVersionAliases.length) + for (var i = 0; i < message.processorVersionAliases.length; ++i) + $root.google.cloud.documentai.v1.ProcessorVersionAlias.encode(message.processorVersionAliases[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.satisfiesPzi); + return writer; + }; + + /** + * Encodes the specified Processor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Processor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.Processor + * @static + * @param {google.cloud.documentai.v1.IProcessor} message Processor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Processor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Processor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.Processor + * @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.Processor} Processor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Processor.decode = function decode(reader, 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.Processor(); + 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.type = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 9: { + message.defaultProcessorVersion = reader.string(); + break; + } + case 10: { + if (!(message.processorVersionAliases && message.processorVersionAliases.length)) + message.processorVersionAliases = []; + message.processorVersionAliases.push($root.google.cloud.documentai.v1.ProcessorVersionAlias.decode(reader, reader.uint32())); + break; + } + case 6: { + message.processEndpoint = reader.string(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.kmsKeyName = reader.string(); + break; + } + case 12: { + message.satisfiesPzs = reader.bool(); + break; + } + case 13: { + message.satisfiesPzi = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Processor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.Processor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.Processor} Processor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Processor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Processor message. + * @function verify + * @memberof google.cloud.documentai.v1.Processor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Processor.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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) + if (!$util.isString(message.defaultProcessorVersion)) + return "defaultProcessorVersion: string expected"; + if (message.processorVersionAliases != null && message.hasOwnProperty("processorVersionAliases")) { + if (!Array.isArray(message.processorVersionAliases)) + return "processorVersionAliases: array expected"; + for (var i = 0; i < message.processorVersionAliases.length; ++i) { + var error = $root.google.cloud.documentai.v1.ProcessorVersionAlias.verify(message.processorVersionAliases[i]); + if (error) + return "processorVersionAliases." + error; + } + } + if (message.processEndpoint != null && message.hasOwnProperty("processEndpoint")) + if (!$util.isString(message.processEndpoint)) + return "processEndpoint: 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.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + return null; + }; + + /** + * Creates a Processor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.Processor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.Processor} Processor + */ + Processor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.Processor) + return object; + var message = new $root.google.cloud.documentai.v1.Processor(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.displayName != null) + message.displayName = String(object.displayName); + 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 "ENABLED": + case 1: + message.state = 1; + break; + case "DISABLED": + case 2: + message.state = 2; + break; + case "ENABLING": + case 3: + message.state = 3; + break; + case "DISABLING": + case 4: + message.state = 4; + break; + case "CREATING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "DELETING": + case 7: + message.state = 7; + break; + } + if (object.defaultProcessorVersion != null) + message.defaultProcessorVersion = String(object.defaultProcessorVersion); + if (object.processorVersionAliases) { + if (!Array.isArray(object.processorVersionAliases)) + throw TypeError(".google.cloud.documentai.v1.Processor.processorVersionAliases: array expected"); + message.processorVersionAliases = []; + for (var i = 0; i < object.processorVersionAliases.length; ++i) { + if (typeof object.processorVersionAliases[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.Processor.processorVersionAliases: object expected"); + message.processorVersionAliases[i] = $root.google.cloud.documentai.v1.ProcessorVersionAlias.fromObject(object.processorVersionAliases[i]); + } + } + if (object.processEndpoint != null) + message.processEndpoint = String(object.processEndpoint); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.documentai.v1.Processor.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + return message; + }; + + /** + * Creates a plain object from a Processor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.Processor + * @static + * @param {google.cloud.documentai.v1.Processor} message Processor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Processor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.processorVersionAliases = []; + if (options.defaults) { + object.name = ""; + object.type = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.processEndpoint = ""; + object.createTime = null; + object.kmsKeyName = ""; + object.defaultProcessorVersion = ""; + object.satisfiesPzs = false; + object.satisfiesPzi = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1.Processor.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.Processor.State[message.state] : message.state; + if (message.processEndpoint != null && message.hasOwnProperty("processEndpoint")) + object.processEndpoint = message.processEndpoint; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) + object.defaultProcessorVersion = message.defaultProcessorVersion; + if (message.processorVersionAliases && message.processorVersionAliases.length) { + object.processorVersionAliases = []; + for (var j = 0; j < message.processorVersionAliases.length; ++j) + object.processorVersionAliases[j] = $root.google.cloud.documentai.v1.ProcessorVersionAlias.toObject(message.processorVersionAliases[j], options); + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + return object; + }; + + /** + * Converts this Processor to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.Processor + * @instance + * @returns {Object.} JSON object + */ + Processor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Processor + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.Processor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Processor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.Processor"; + }; + + /** + * State enum. + * @name google.cloud.documentai.v1.Processor.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + * @property {number} ENABLING=3 ENABLING value + * @property {number} DISABLING=4 DISABLING value + * @property {number} CREATING=5 CREATING value + * @property {number} FAILED=6 FAILED value + * @property {number} DELETING=7 DELETING value + */ + Processor.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "ENABLING"] = 3; + values[valuesById[4] = "DISABLING"] = 4; + values[valuesById[5] = "CREATING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "DELETING"] = 7; + return values; + })(); + + return Processor; + })(); + + v1.ProcessorType = (function() { + + /** + * Properties of a ProcessorType. + * @memberof google.cloud.documentai.v1 + * @interface IProcessorType + * @property {string|null} [name] ProcessorType name + * @property {string|null} [type] ProcessorType type + * @property {string|null} [category] ProcessorType category + * @property {Array.|null} [availableLocations] ProcessorType availableLocations + * @property {boolean|null} [allowCreation] ProcessorType allowCreation + * @property {google.api.LaunchStage|null} [launchStage] ProcessorType launchStage + * @property {Array.|null} [sampleDocumentUris] ProcessorType sampleDocumentUris + */ + + /** + * Constructs a new ProcessorType. + * @memberof google.cloud.documentai.v1 + * @classdesc Represents a ProcessorType. + * @implements IProcessorType + * @constructor + * @param {google.cloud.documentai.v1.IProcessorType=} [properties] Properties to set + */ + function ProcessorType(properties) { + this.availableLocations = []; + this.sampleDocumentUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessorType name. + * @member {string} name + * @memberof google.cloud.documentai.v1.ProcessorType + * @instance + */ + ProcessorType.prototype.name = ""; + + /** + * ProcessorType type. + * @member {string} type + * @memberof google.cloud.documentai.v1.ProcessorType + * @instance + */ + ProcessorType.prototype.type = ""; + + /** + * ProcessorType category. + * @member {string} category + * @memberof google.cloud.documentai.v1.ProcessorType + * @instance + */ + ProcessorType.prototype.category = ""; + + /** + * ProcessorType availableLocations. + * @member {Array.} availableLocations + * @memberof google.cloud.documentai.v1.ProcessorType + * @instance + */ + ProcessorType.prototype.availableLocations = $util.emptyArray; + + /** + * ProcessorType allowCreation. + * @member {boolean} allowCreation + * @memberof google.cloud.documentai.v1.ProcessorType + * @instance + */ + ProcessorType.prototype.allowCreation = false; + + /** + * ProcessorType launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.cloud.documentai.v1.ProcessorType + * @instance + */ + ProcessorType.prototype.launchStage = 0; + + /** + * ProcessorType sampleDocumentUris. + * @member {Array.} sampleDocumentUris + * @memberof google.cloud.documentai.v1.ProcessorType + * @instance + */ + ProcessorType.prototype.sampleDocumentUris = $util.emptyArray; + + /** + * Creates a new ProcessorType instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessorType + * @static + * @param {google.cloud.documentai.v1.IProcessorType=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessorType} ProcessorType instance + */ + ProcessorType.create = function create(properties) { + return new ProcessorType(properties); + }; + + /** + * Encodes the specified ProcessorType message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessorType + * @static + * @param {google.cloud.documentai.v1.IProcessorType} message ProcessorType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.category); + if (message.availableLocations != null && message.availableLocations.length) + for (var i = 0; i < message.availableLocations.length; ++i) + $root.google.cloud.documentai.v1.ProcessorType.LocationInfo.encode(message.availableLocations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allowCreation != null && Object.hasOwnProperty.call(message, "allowCreation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowCreation); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.launchStage); + if (message.sampleDocumentUris != null && message.sampleDocumentUris.length) + for (var i = 0; i < message.sampleDocumentUris.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.sampleDocumentUris[i]); + return writer; + }; + + /** + * Encodes the specified ProcessorType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorType + * @static + * @param {google.cloud.documentai.v1.IProcessorType} message ProcessorType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessorType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessorType + * @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.ProcessorType} ProcessorType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorType.decode = function decode(reader, 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.ProcessorType(); + 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.type = reader.string(); + break; + } + case 3: { + message.category = reader.string(); + break; + } + case 4: { + if (!(message.availableLocations && message.availableLocations.length)) + message.availableLocations = []; + message.availableLocations.push($root.google.cloud.documentai.v1.ProcessorType.LocationInfo.decode(reader, reader.uint32())); + break; + } + case 6: { + message.allowCreation = reader.bool(); + break; + } + case 8: { + message.launchStage = reader.int32(); + break; + } + case 9: { + if (!(message.sampleDocumentUris && message.sampleDocumentUris.length)) + message.sampleDocumentUris = []; + message.sampleDocumentUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessorType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessorType} ProcessorType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessorType message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessorType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessorType.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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.availableLocations != null && message.hasOwnProperty("availableLocations")) { + if (!Array.isArray(message.availableLocations)) + return "availableLocations: array expected"; + for (var i = 0; i < message.availableLocations.length; ++i) { + var error = $root.google.cloud.documentai.v1.ProcessorType.LocationInfo.verify(message.availableLocations[i]); + if (error) + return "availableLocations." + error; + } + } + if (message.allowCreation != null && message.hasOwnProperty("allowCreation")) + if (typeof message.allowCreation !== "boolean") + return "allowCreation: boolean 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.sampleDocumentUris != null && message.hasOwnProperty("sampleDocumentUris")) { + if (!Array.isArray(message.sampleDocumentUris)) + return "sampleDocumentUris: array expected"; + for (var i = 0; i < message.sampleDocumentUris.length; ++i) + if (!$util.isString(message.sampleDocumentUris[i])) + return "sampleDocumentUris: string[] expected"; + } + return null; + }; + + /** + * Creates a ProcessorType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessorType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessorType} ProcessorType + */ + ProcessorType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessorType) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessorType(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.category != null) + message.category = String(object.category); + if (object.availableLocations) { + if (!Array.isArray(object.availableLocations)) + throw TypeError(".google.cloud.documentai.v1.ProcessorType.availableLocations: array expected"); + message.availableLocations = []; + for (var i = 0; i < object.availableLocations.length; ++i) { + if (typeof object.availableLocations[i] !== "object") + throw TypeError(".google.cloud.documentai.v1.ProcessorType.availableLocations: object expected"); + message.availableLocations[i] = $root.google.cloud.documentai.v1.ProcessorType.LocationInfo.fromObject(object.availableLocations[i]); + } + } + if (object.allowCreation != null) + message.allowCreation = Boolean(object.allowCreation); + 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.sampleDocumentUris) { + if (!Array.isArray(object.sampleDocumentUris)) + throw TypeError(".google.cloud.documentai.v1.ProcessorType.sampleDocumentUris: array expected"); + message.sampleDocumentUris = []; + for (var i = 0; i < object.sampleDocumentUris.length; ++i) + message.sampleDocumentUris[i] = String(object.sampleDocumentUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a ProcessorType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessorType + * @static + * @param {google.cloud.documentai.v1.ProcessorType} message ProcessorType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessorType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.availableLocations = []; + object.sampleDocumentUris = []; + } + if (options.defaults) { + object.name = ""; + object.type = ""; + object.category = ""; + object.allowCreation = false; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.availableLocations && message.availableLocations.length) { + object.availableLocations = []; + for (var j = 0; j < message.availableLocations.length; ++j) + object.availableLocations[j] = $root.google.cloud.documentai.v1.ProcessorType.LocationInfo.toObject(message.availableLocations[j], options); + } + if (message.allowCreation != null && message.hasOwnProperty("allowCreation")) + object.allowCreation = message.allowCreation; + 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.sampleDocumentUris && message.sampleDocumentUris.length) { + object.sampleDocumentUris = []; + for (var j = 0; j < message.sampleDocumentUris.length; ++j) + object.sampleDocumentUris[j] = message.sampleDocumentUris[j]; + } + return object; + }; + + /** + * Converts this ProcessorType to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessorType + * @instance + * @returns {Object.} JSON object + */ + ProcessorType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessorType + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessorType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessorType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorType"; + }; + + ProcessorType.LocationInfo = (function() { + + /** + * Properties of a LocationInfo. + * @memberof google.cloud.documentai.v1.ProcessorType + * @interface ILocationInfo + * @property {string|null} [locationId] LocationInfo locationId + */ + + /** + * Constructs a new LocationInfo. + * @memberof google.cloud.documentai.v1.ProcessorType + * @classdesc Represents a LocationInfo. + * @implements ILocationInfo + * @constructor + * @param {google.cloud.documentai.v1.ProcessorType.ILocationInfo=} [properties] Properties to set + */ + function LocationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationInfo locationId. + * @member {string} locationId + * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo + * @instance + */ + LocationInfo.prototype.locationId = ""; + + /** + * Creates a new LocationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorType.ILocationInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1.ProcessorType.LocationInfo} LocationInfo instance + */ + LocationInfo.create = function create(properties) { + return new LocationInfo(properties); + }; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.LocationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorType.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.LocationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorType.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo + * @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.ProcessorType.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.decode = function decode(reader, 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.ProcessorType.LocationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.locationId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1.ProcessorType.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationInfo message. + * @function verify + * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1.ProcessorType.LocationInfo} LocationInfo + */ + LocationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1.ProcessorType.LocationInfo) + return object; + var message = new $root.google.cloud.documentai.v1.ProcessorType.LocationInfo(); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo + * @static + * @param {google.cloud.documentai.v1.ProcessorType.LocationInfo} message LocationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.locationId = ""; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this LocationInfo to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo + * @instance + * @returns {Object.} JSON object + */ + LocationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationInfo + * @function getTypeUrl + * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorType.LocationInfo"; + }; + + return LocationInfo; + })(); + + return ProcessorType; + })(); + + return v1; + })(); + + documentai.v1beta3 = (function() { + + /** + * Namespace v1beta3. + * @memberof google.cloud.documentai + * @namespace + */ + var v1beta3 = {}; + + v1beta3.Barcode = (function() { + + /** + * Properties of a Barcode. + * @memberof google.cloud.documentai.v1beta3 + * @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.v1beta3 + * @classdesc Represents a Barcode. + * @implements IBarcode + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Barcode + * @instance + */ + Barcode.prototype.format = ""; + + /** + * Barcode valueFormat. + * @member {string} valueFormat + * @memberof google.cloud.documentai.v1beta3.Barcode + * @instance + */ + Barcode.prototype.valueFormat = ""; + + /** + * Barcode rawValue. + * @member {string} rawValue + * @memberof google.cloud.documentai.v1beta3.Barcode + * @instance + */ + Barcode.prototype.rawValue = ""; + + /** + * Creates a new Barcode instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Barcode + * @static + * @param {google.cloud.documentai.v1beta3.IBarcode=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Barcode} Barcode instance + */ + Barcode.create = function create(properties) { + return new Barcode(properties); + }; + + /** + * Encodes the specified Barcode message. Does not implicitly {@link google.cloud.documentai.v1beta3.Barcode.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Barcode + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Barcode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Barcode + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Barcode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Barcode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Barcode} Barcode + */ + Barcode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Barcode) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Barcode + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Barcode"; + }; + + return Barcode; + })(); + + v1beta3.Dataset = (function() { + + /** + * Properties of a Dataset. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDataset + * @property {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig|null} [gcsManagedConfig] Dataset gcsManagedConfig + * @property {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig|null} [documentWarehouseConfig] Dataset documentWarehouseConfig + * @property {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null} [unmanagedDatasetConfig] Dataset unmanagedDatasetConfig + * @property {string|null} [name] Dataset name + * @property {google.cloud.documentai.v1beta3.Dataset.State|null} [state] Dataset state + * @property {boolean|null} [satisfiesPzs] Dataset satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Dataset satisfiesPzi + */ + + /** + * Constructs a new Dataset. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a Dataset. + * @implements IDataset + * @constructor + * @param {google.cloud.documentai.v1beta3.IDataset=} [properties] Properties to set + */ + function Dataset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dataset gcsManagedConfig. + * @member {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig|null|undefined} gcsManagedConfig + * @memberof google.cloud.documentai.v1beta3.Dataset + * @instance + */ + Dataset.prototype.gcsManagedConfig = null; + + /** + * Dataset documentWarehouseConfig. + * @member {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig|null|undefined} documentWarehouseConfig + * @memberof google.cloud.documentai.v1beta3.Dataset + * @instance + */ + Dataset.prototype.documentWarehouseConfig = null; + + /** + * Dataset unmanagedDatasetConfig. + * @member {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null|undefined} unmanagedDatasetConfig + * @memberof google.cloud.documentai.v1beta3.Dataset + * @instance + */ + Dataset.prototype.unmanagedDatasetConfig = null; + + /** + * Dataset name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.Dataset + * @instance + */ + Dataset.prototype.name = ""; + + /** + * Dataset state. + * @member {google.cloud.documentai.v1beta3.Dataset.State} state + * @memberof google.cloud.documentai.v1beta3.Dataset + * @instance + */ + Dataset.prototype.state = 0; + + /** + * Dataset satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.documentai.v1beta3.Dataset + * @instance + */ + Dataset.prototype.satisfiesPzs = false; + + /** + * Dataset satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.documentai.v1beta3.Dataset + * @instance + */ + Dataset.prototype.satisfiesPzi = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Dataset storageSource. + * @member {"gcsManagedConfig"|"documentWarehouseConfig"|"unmanagedDatasetConfig"|undefined} storageSource + * @memberof google.cloud.documentai.v1beta3.Dataset + * @instance + */ + Object.defineProperty(Dataset.prototype, "storageSource", { + get: $util.oneOfGetter($oneOfFields = ["gcsManagedConfig", "documentWarehouseConfig", "unmanagedDatasetConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Dataset instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Dataset + * @static + * @param {google.cloud.documentai.v1beta3.IDataset=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Dataset} Dataset instance + */ + Dataset.create = function create(properties) { + return new Dataset(properties); + }; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Dataset + * @static + * @param {google.cloud.documentai.v1beta3.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.gcsManagedConfig != null && Object.hasOwnProperty.call(message, "gcsManagedConfig")) + $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.encode(message.gcsManagedConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentWarehouseConfig != null && Object.hasOwnProperty.call(message, "documentWarehouseConfig")) + $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.encode(message.documentWarehouseConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.unmanagedDatasetConfig != null && Object.hasOwnProperty.call(message, "unmanagedDatasetConfig")) + $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.encode(message.unmanagedDatasetConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.satisfiesPzi); + return writer; + }; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Dataset + * @static + * @param {google.cloud.documentai.v1beta3.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decode = function decode(reader, 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.v1beta3.Dataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.gcsManagedConfig = $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.documentWarehouseConfig = $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.unmanagedDatasetConfig = $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 8: { + message.satisfiesPzs = reader.bool(); + break; + } + case 9: { + message.satisfiesPzi = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dataset message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Dataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dataset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsManagedConfig != null && message.hasOwnProperty("gcsManagedConfig")) { + properties.storageSource = 1; + { + var error = $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.verify(message.gcsManagedConfig); + if (error) + return "gcsManagedConfig." + error; + } + } + if (message.documentWarehouseConfig != null && message.hasOwnProperty("documentWarehouseConfig")) { + if (properties.storageSource === 1) + return "storageSource: multiple values"; + properties.storageSource = 1; + { + var error = $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.verify(message.documentWarehouseConfig); + if (error) + return "documentWarehouseConfig." + error; + } + } + if (message.unmanagedDatasetConfig != null && message.hasOwnProperty("unmanagedDatasetConfig")) { + if (properties.storageSource === 1) + return "storageSource: multiple values"; + properties.storageSource = 1; + { + var error = $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.verify(message.unmanagedDatasetConfig); + if (error) + return "unmanagedDatasetConfig." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + return null; + }; + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Dataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Dataset} Dataset + */ + Dataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Dataset) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Dataset(); + if (object.gcsManagedConfig != null) { + if (typeof object.gcsManagedConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Dataset.gcsManagedConfig: object expected"); + message.gcsManagedConfig = $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.fromObject(object.gcsManagedConfig); + } + if (object.documentWarehouseConfig != null) { + if (typeof object.documentWarehouseConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Dataset.documentWarehouseConfig: object expected"); + message.documentWarehouseConfig = $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.fromObject(object.documentWarehouseConfig); + } + if (object.unmanagedDatasetConfig != null) { + if (typeof object.unmanagedDatasetConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Dataset.unmanagedDatasetConfig: object expected"); + message.unmanagedDatasetConfig = $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.fromObject(object.unmanagedDatasetConfig); + } + if (object.name != null) + message.name = String(object.name); + 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 "UNINITIALIZED": + case 1: + message.state = 1; + break; + case "INITIALIZING": + case 2: + message.state = 2; + break; + case "INITIALIZED": + case 3: + message.state = 3; + break; + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + return message; + }; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Dataset + * @static + * @param {google.cloud.documentai.v1beta3.Dataset} message Dataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.satisfiesPzs = false; + object.satisfiesPzi = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.Dataset.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.Dataset.State[message.state] : message.state; + if (message.gcsManagedConfig != null && message.hasOwnProperty("gcsManagedConfig")) { + object.gcsManagedConfig = $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.toObject(message.gcsManagedConfig, options); + if (options.oneofs) + object.storageSource = "gcsManagedConfig"; + } + if (message.documentWarehouseConfig != null && message.hasOwnProperty("documentWarehouseConfig")) { + object.documentWarehouseConfig = $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.toObject(message.documentWarehouseConfig, options); + if (options.oneofs) + object.storageSource = "documentWarehouseConfig"; + } + if (message.unmanagedDatasetConfig != null && message.hasOwnProperty("unmanagedDatasetConfig")) { + object.unmanagedDatasetConfig = $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.toObject(message.unmanagedDatasetConfig, options); + if (options.oneofs) + object.storageSource = "unmanagedDatasetConfig"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + return object; + }; + + /** + * Converts this Dataset to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Dataset + * @instance + * @returns {Object.} JSON object + */ + Dataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dataset + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Dataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset"; + }; + + Dataset.GCSManagedConfig = (function() { + + /** + * Properties of a GCSManagedConfig. + * @memberof google.cloud.documentai.v1beta3.Dataset + * @interface IGCSManagedConfig + * @property {google.cloud.documentai.v1beta3.IGcsPrefix|null} [gcsPrefix] GCSManagedConfig gcsPrefix + */ + + /** + * Constructs a new GCSManagedConfig. + * @memberof google.cloud.documentai.v1beta3.Dataset + * @classdesc Represents a GCSManagedConfig. + * @implements IGCSManagedConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig=} [properties] Properties to set + */ + function GCSManagedConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GCSManagedConfig gcsPrefix. + * @member {google.cloud.documentai.v1beta3.IGcsPrefix|null|undefined} gcsPrefix + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig + * @instance + */ + GCSManagedConfig.prototype.gcsPrefix = null; + + /** + * Creates a new GCSManagedConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig + * @static + * @param {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} GCSManagedConfig instance + */ + GCSManagedConfig.create = function create(properties) { + return new GCSManagedConfig(properties); + }; + + /** + * Encodes the specified GCSManagedConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig + * @static + * @param {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig} message GCSManagedConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCSManagedConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) + $root.google.cloud.documentai.v1beta3.GcsPrefix.encode(message.gcsPrefix, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GCSManagedConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig + * @static + * @param {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig} message GCSManagedConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCSManagedConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GCSManagedConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} GCSManagedConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCSManagedConfig.decode = function decode(reader, 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.v1beta3.Dataset.GCSManagedConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GCSManagedConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} GCSManagedConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCSManagedConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GCSManagedConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GCSManagedConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + var error = $root.google.cloud.documentai.v1beta3.GcsPrefix.verify(message.gcsPrefix); + if (error) + return "gcsPrefix." + error; + } + return null; + }; + + /** + * Creates a GCSManagedConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} GCSManagedConfig + */ + GCSManagedConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig(); + if (object.gcsPrefix != null) { + if (typeof object.gcsPrefix !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.gcsPrefix: object expected"); + message.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.fromObject(object.gcsPrefix); + } + return message; + }; + + /** + * Creates a plain object from a GCSManagedConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig + * @static + * @param {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} message GCSManagedConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GCSManagedConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsPrefix = null; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) + object.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.toObject(message.gcsPrefix, options); + return object; + }; + + /** + * Converts this GCSManagedConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig + * @instance + * @returns {Object.} JSON object + */ + GCSManagedConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GCSManagedConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GCSManagedConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig"; + }; + + return GCSManagedConfig; + })(); + + Dataset.DocumentWarehouseConfig = (function() { + + /** + * Properties of a DocumentWarehouseConfig. + * @memberof google.cloud.documentai.v1beta3.Dataset + * @interface IDocumentWarehouseConfig + * @property {string|null} [collection] DocumentWarehouseConfig collection + * @property {string|null} [schema] DocumentWarehouseConfig schema + */ + + /** + * Constructs a new DocumentWarehouseConfig. + * @memberof google.cloud.documentai.v1beta3.Dataset + * @classdesc Represents a DocumentWarehouseConfig. + * @implements IDocumentWarehouseConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig=} [properties] Properties to set + */ + function DocumentWarehouseConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentWarehouseConfig collection. + * @member {string} collection + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig + * @instance + */ + DocumentWarehouseConfig.prototype.collection = ""; + + /** + * DocumentWarehouseConfig schema. + * @member {string} schema + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig + * @instance + */ + DocumentWarehouseConfig.prototype.schema = ""; + + /** + * Creates a new DocumentWarehouseConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig + * @static + * @param {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} DocumentWarehouseConfig instance + */ + DocumentWarehouseConfig.create = function create(properties) { + return new DocumentWarehouseConfig(properties); + }; + + /** + * Encodes the specified DocumentWarehouseConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig + * @static + * @param {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig} message DocumentWarehouseConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentWarehouseConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collection != null && Object.hasOwnProperty.call(message, "collection")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.collection); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.schema); + return writer; + }; + + /** + * Encodes the specified DocumentWarehouseConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig + * @static + * @param {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig} message DocumentWarehouseConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentWarehouseConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentWarehouseConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} DocumentWarehouseConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentWarehouseConfig.decode = function decode(reader, 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.v1beta3.Dataset.DocumentWarehouseConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.collection = reader.string(); + break; + } + case 2: { + message.schema = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentWarehouseConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} DocumentWarehouseConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentWarehouseConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentWarehouseConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentWarehouseConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collection != null && message.hasOwnProperty("collection")) + if (!$util.isString(message.collection)) + return "collection: string expected"; + if (message.schema != null && message.hasOwnProperty("schema")) + if (!$util.isString(message.schema)) + return "schema: string expected"; + return null; + }; + + /** + * Creates a DocumentWarehouseConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} DocumentWarehouseConfig + */ + DocumentWarehouseConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig(); + if (object.collection != null) + message.collection = String(object.collection); + if (object.schema != null) + message.schema = String(object.schema); + return message; + }; + + /** + * Creates a plain object from a DocumentWarehouseConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig + * @static + * @param {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} message DocumentWarehouseConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentWarehouseConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.collection = ""; + object.schema = ""; + } + if (message.collection != null && message.hasOwnProperty("collection")) + object.collection = message.collection; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = message.schema; + return object; + }; + + /** + * Converts this DocumentWarehouseConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig + * @instance + * @returns {Object.} JSON object + */ + DocumentWarehouseConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentWarehouseConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentWarehouseConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig"; + }; + + return DocumentWarehouseConfig; + })(); + + Dataset.UnmanagedDatasetConfig = (function() { + + /** + * Properties of an UnmanagedDatasetConfig. + * @memberof google.cloud.documentai.v1beta3.Dataset + * @interface IUnmanagedDatasetConfig + */ + + /** + * Constructs a new UnmanagedDatasetConfig. + * @memberof google.cloud.documentai.v1beta3.Dataset + * @classdesc Represents an UnmanagedDatasetConfig. + * @implements IUnmanagedDatasetConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig=} [properties] Properties to set + */ + function UnmanagedDatasetConfig(properties) { + if (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 UnmanagedDatasetConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig + * @static + * @param {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig} UnmanagedDatasetConfig instance + */ + UnmanagedDatasetConfig.create = function create(properties) { + return new UnmanagedDatasetConfig(properties); + }; + + /** + * Encodes the specified UnmanagedDatasetConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig + * @static + * @param {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig} message UnmanagedDatasetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnmanagedDatasetConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UnmanagedDatasetConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig + * @static + * @param {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig} message UnmanagedDatasetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnmanagedDatasetConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnmanagedDatasetConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig} UnmanagedDatasetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnmanagedDatasetConfig.decode = function decode(reader, 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.v1beta3.Dataset.UnmanagedDatasetConfig(); + 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 UnmanagedDatasetConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig} UnmanagedDatasetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnmanagedDatasetConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnmanagedDatasetConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnmanagedDatasetConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UnmanagedDatasetConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig} UnmanagedDatasetConfig + */ + UnmanagedDatasetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig) + return object; + return new $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig(); + }; + + /** + * Creates a plain object from an UnmanagedDatasetConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig + * @static + * @param {google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig} message UnmanagedDatasetConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnmanagedDatasetConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UnmanagedDatasetConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig + * @instance + * @returns {Object.} JSON object + */ + UnmanagedDatasetConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnmanagedDatasetConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnmanagedDatasetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig"; + }; + + return UnmanagedDatasetConfig; + })(); + + /** + * State enum. + * @name google.cloud.documentai.v1beta3.Dataset.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} UNINITIALIZED=1 UNINITIALIZED value + * @property {number} INITIALIZING=2 INITIALIZING value + * @property {number} INITIALIZED=3 INITIALIZED value + */ + Dataset.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNINITIALIZED"] = 1; + values[valuesById[2] = "INITIALIZING"] = 2; + values[valuesById[3] = "INITIALIZED"] = 3; + return values; + })(); + + return Dataset; + })(); + + v1beta3.DocumentId = (function() { + + /** + * Properties of a DocumentId. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDocumentId + * @property {google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId|null} [gcsManagedDocId] DocumentId gcsManagedDocId + * @property {google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId|null} [unmanagedDocId] DocumentId unmanagedDocId + * @property {google.cloud.documentai.v1beta3.IRevisionRef|null} [revisionRef] DocumentId revisionRef + */ + + /** + * Constructs a new DocumentId. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DocumentId. + * @implements IDocumentId + * @constructor + * @param {google.cloud.documentai.v1beta3.IDocumentId=} [properties] Properties to set + */ + function DocumentId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentId gcsManagedDocId. + * @member {google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId|null|undefined} gcsManagedDocId + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @instance + */ + DocumentId.prototype.gcsManagedDocId = null; + + /** + * DocumentId unmanagedDocId. + * @member {google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId|null|undefined} unmanagedDocId + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @instance + */ + DocumentId.prototype.unmanagedDocId = null; + + /** + * DocumentId revisionRef. + * @member {google.cloud.documentai.v1beta3.IRevisionRef|null|undefined} revisionRef + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @instance + */ + DocumentId.prototype.revisionRef = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DocumentId type. + * @member {"gcsManagedDocId"|"unmanagedDocId"|undefined} type + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @instance + */ + Object.defineProperty(DocumentId.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["gcsManagedDocId", "unmanagedDocId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DocumentId instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentId=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentId} DocumentId instance + */ + DocumentId.create = function create(properties) { + return new DocumentId(properties); + }; + + /** + * Encodes the specified DocumentId message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentId} message DocumentId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsManagedDocId != null && Object.hasOwnProperty.call(message, "gcsManagedDocId")) + $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.encode(message.gcsManagedDocId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.revisionRef != null && Object.hasOwnProperty.call(message, "revisionRef")) + $root.google.cloud.documentai.v1beta3.RevisionRef.encode(message.revisionRef, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.unmanagedDocId != null && Object.hasOwnProperty.call(message, "unmanagedDocId")) + $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.encode(message.unmanagedDocId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentId message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentId} message DocumentId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentId message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DocumentId} DocumentId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentId.decode = function decode(reader, 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.v1beta3.DocumentId(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsManagedDocId = $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.decode(reader, reader.uint32()); + break; + } + case 4: { + message.unmanagedDocId = $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.decode(reader, reader.uint32()); + break; + } + case 3: { + message.revisionRef = $root.google.cloud.documentai.v1beta3.RevisionRef.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DocumentId} DocumentId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentId message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsManagedDocId != null && message.hasOwnProperty("gcsManagedDocId")) { + properties.type = 1; + { + var error = $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.verify(message.gcsManagedDocId); + if (error) + return "gcsManagedDocId." + error; + } + } + if (message.unmanagedDocId != null && message.hasOwnProperty("unmanagedDocId")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.verify(message.unmanagedDocId); + if (error) + return "unmanagedDocId." + error; + } + } + if (message.revisionRef != null && message.hasOwnProperty("revisionRef")) { + var error = $root.google.cloud.documentai.v1beta3.RevisionRef.verify(message.revisionRef); + if (error) + return "revisionRef." + error; + } + return null; + }; + + /** + * Creates a DocumentId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentId} DocumentId + */ + DocumentId.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentId) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentId(); + if (object.gcsManagedDocId != null) { + if (typeof object.gcsManagedDocId !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DocumentId.gcsManagedDocId: object expected"); + message.gcsManagedDocId = $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.fromObject(object.gcsManagedDocId); + } + if (object.unmanagedDocId != null) { + if (typeof object.unmanagedDocId !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DocumentId.unmanagedDocId: object expected"); + message.unmanagedDocId = $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.fromObject(object.unmanagedDocId); + } + if (object.revisionRef != null) { + if (typeof object.revisionRef !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DocumentId.revisionRef: object expected"); + message.revisionRef = $root.google.cloud.documentai.v1beta3.RevisionRef.fromObject(object.revisionRef); + } + return message; + }; + + /** + * Creates a plain object from a DocumentId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @static + * @param {google.cloud.documentai.v1beta3.DocumentId} message DocumentId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.revisionRef = null; + if (message.gcsManagedDocId != null && message.hasOwnProperty("gcsManagedDocId")) { + object.gcsManagedDocId = $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.toObject(message.gcsManagedDocId, options); + if (options.oneofs) + object.type = "gcsManagedDocId"; + } + if (message.revisionRef != null && message.hasOwnProperty("revisionRef")) + object.revisionRef = $root.google.cloud.documentai.v1beta3.RevisionRef.toObject(message.revisionRef, options); + if (message.unmanagedDocId != null && message.hasOwnProperty("unmanagedDocId")) { + object.unmanagedDocId = $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.toObject(message.unmanagedDocId, options); + if (options.oneofs) + object.type = "unmanagedDocId"; + } + return object; + }; + + /** + * Converts this DocumentId to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @instance + * @returns {Object.} JSON object + */ + DocumentId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentId + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentId"; + }; + + DocumentId.GCSManagedDocumentId = (function() { + + /** + * Properties of a GCSManagedDocumentId. + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @interface IGCSManagedDocumentId + * @property {string|null} [gcsUri] GCSManagedDocumentId gcsUri + * @property {string|null} [cwDocId] GCSManagedDocumentId cwDocId + */ + + /** + * Constructs a new GCSManagedDocumentId. + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @classdesc Represents a GCSManagedDocumentId. + * @implements IGCSManagedDocumentId + * @constructor + * @param {google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId=} [properties] Properties to set + */ + function GCSManagedDocumentId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GCSManagedDocumentId gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId + * @instance + */ + GCSManagedDocumentId.prototype.gcsUri = ""; + + /** + * GCSManagedDocumentId cwDocId. + * @member {string} cwDocId + * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId + * @instance + */ + GCSManagedDocumentId.prototype.cwDocId = ""; + + /** + * Creates a new GCSManagedDocumentId instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId + * @static + * @param {google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId} GCSManagedDocumentId instance + */ + GCSManagedDocumentId.create = function create(properties) { + return new GCSManagedDocumentId(properties); + }; + + /** + * Encodes the specified GCSManagedDocumentId message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId + * @static + * @param {google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId} message GCSManagedDocumentId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCSManagedDocumentId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); + if (message.cwDocId != null && Object.hasOwnProperty.call(message, "cwDocId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cwDocId); + return writer; + }; + + /** + * Encodes the specified GCSManagedDocumentId message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId + * @static + * @param {google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId} message GCSManagedDocumentId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCSManagedDocumentId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GCSManagedDocumentId message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId} GCSManagedDocumentId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCSManagedDocumentId.decode = function decode(reader, 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.v1beta3.DocumentId.GCSManagedDocumentId(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsUri = reader.string(); + break; + } + case 2: { + message.cwDocId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GCSManagedDocumentId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId} GCSManagedDocumentId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCSManagedDocumentId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GCSManagedDocumentId message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GCSManagedDocumentId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + if (message.cwDocId != null && message.hasOwnProperty("cwDocId")) + if (!$util.isString(message.cwDocId)) + return "cwDocId: string expected"; + return null; + }; + + /** + * Creates a GCSManagedDocumentId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId} GCSManagedDocumentId + */ + GCSManagedDocumentId.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.cwDocId != null) + message.cwDocId = String(object.cwDocId); + return message; + }; + + /** + * Creates a plain object from a GCSManagedDocumentId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId + * @static + * @param {google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId} message GCSManagedDocumentId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GCSManagedDocumentId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsUri = ""; + object.cwDocId = ""; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + object.gcsUri = message.gcsUri; + if (message.cwDocId != null && message.hasOwnProperty("cwDocId")) + object.cwDocId = message.cwDocId; + return object; + }; + + /** + * Converts this GCSManagedDocumentId to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId + * @instance + * @returns {Object.} JSON object + */ + GCSManagedDocumentId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GCSManagedDocumentId + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GCSManagedDocumentId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId"; + }; + + return GCSManagedDocumentId; + })(); + + DocumentId.UnmanagedDocumentId = (function() { + + /** + * Properties of an UnmanagedDocumentId. + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @interface IUnmanagedDocumentId + * @property {string|null} [docId] UnmanagedDocumentId docId + */ + + /** + * Constructs a new UnmanagedDocumentId. + * @memberof google.cloud.documentai.v1beta3.DocumentId + * @classdesc Represents an UnmanagedDocumentId. + * @implements IUnmanagedDocumentId + * @constructor + * @param {google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId=} [properties] Properties to set + */ + function UnmanagedDocumentId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnmanagedDocumentId docId. + * @member {string} docId + * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId + * @instance + */ + UnmanagedDocumentId.prototype.docId = ""; + + /** + * Creates a new UnmanagedDocumentId instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId + * @static + * @param {google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId} UnmanagedDocumentId instance + */ + UnmanagedDocumentId.create = function create(properties) { + return new UnmanagedDocumentId(properties); + }; + + /** + * Encodes the specified UnmanagedDocumentId message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId + * @static + * @param {google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId} message UnmanagedDocumentId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnmanagedDocumentId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.docId != null && Object.hasOwnProperty.call(message, "docId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.docId); + return writer; + }; + + /** + * Encodes the specified UnmanagedDocumentId message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId + * @static + * @param {google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId} message UnmanagedDocumentId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnmanagedDocumentId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnmanagedDocumentId message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId} UnmanagedDocumentId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnmanagedDocumentId.decode = function decode(reader, 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.v1beta3.DocumentId.UnmanagedDocumentId(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.docId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnmanagedDocumentId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId} UnmanagedDocumentId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnmanagedDocumentId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnmanagedDocumentId message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnmanagedDocumentId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.docId != null && message.hasOwnProperty("docId")) + if (!$util.isString(message.docId)) + return "docId: string expected"; + return null; + }; + + /** + * Creates an UnmanagedDocumentId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId} UnmanagedDocumentId + */ + UnmanagedDocumentId.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId(); + if (object.docId != null) + message.docId = String(object.docId); + return message; + }; + + /** + * Creates a plain object from an UnmanagedDocumentId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId + * @static + * @param {google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId} message UnmanagedDocumentId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnmanagedDocumentId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.docId = ""; + if (message.docId != null && message.hasOwnProperty("docId")) + object.docId = message.docId; + return object; + }; + + /** + * Converts this UnmanagedDocumentId to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId + * @instance + * @returns {Object.} JSON object + */ + UnmanagedDocumentId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnmanagedDocumentId + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnmanagedDocumentId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId"; + }; + + return UnmanagedDocumentId; + })(); + + return DocumentId; + })(); + + v1beta3.DatasetSchema = (function() { + + /** + * Properties of a DatasetSchema. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDatasetSchema + * @property {string|null} [name] DatasetSchema name + * @property {google.cloud.documentai.v1beta3.IDocumentSchema|null} [documentSchema] DatasetSchema documentSchema + * @property {boolean|null} [satisfiesPzs] DatasetSchema satisfiesPzs + * @property {boolean|null} [satisfiesPzi] DatasetSchema satisfiesPzi + */ + + /** + * Constructs a new DatasetSchema. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DatasetSchema. + * @implements IDatasetSchema + * @constructor + * @param {google.cloud.documentai.v1beta3.IDatasetSchema=} [properties] Properties to set + */ + function DatasetSchema(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatasetSchema name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @instance + */ + DatasetSchema.prototype.name = ""; + + /** + * DatasetSchema documentSchema. + * @member {google.cloud.documentai.v1beta3.IDocumentSchema|null|undefined} documentSchema + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @instance + */ + DatasetSchema.prototype.documentSchema = null; + + /** + * DatasetSchema satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @instance + */ + DatasetSchema.prototype.satisfiesPzs = false; + + /** + * DatasetSchema satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @instance + */ + DatasetSchema.prototype.satisfiesPzi = false; + + /** + * Creates a new DatasetSchema instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @static + * @param {google.cloud.documentai.v1beta3.IDatasetSchema=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DatasetSchema} DatasetSchema instance + */ + DatasetSchema.create = function create(properties) { + return new DatasetSchema(properties); + }; + + /** + * Encodes the specified DatasetSchema message. Does not implicitly {@link google.cloud.documentai.v1beta3.DatasetSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @static + * @param {google.cloud.documentai.v1beta3.IDatasetSchema} message DatasetSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetSchema.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.documentai.v1beta3.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.satisfiesPzi); + return writer; + }; + + /** + * Encodes the specified DatasetSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DatasetSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @static + * @param {google.cloud.documentai.v1beta3.IDatasetSchema} message DatasetSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatasetSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DatasetSchema} DatasetSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetSchema.decode = function decode(reader, 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.v1beta3.DatasetSchema(); + 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.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.satisfiesPzs = reader.bool(); + break; + } + case 5: { + message.satisfiesPzi = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatasetSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DatasetSchema} DatasetSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatasetSchema message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatasetSchema.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.documentai.v1beta3.DocumentSchema.verify(message.documentSchema); + if (error) + return "documentSchema." + error; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + return null; + }; + + /** + * Creates a DatasetSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DatasetSchema} DatasetSchema + */ + DatasetSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DatasetSchema) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DatasetSchema(); + if (object.name != null) + message.name = String(object.name); + if (object.documentSchema != null) { + if (typeof object.documentSchema !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DatasetSchema.documentSchema: object expected"); + message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.fromObject(object.documentSchema); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + return message; + }; + + /** + * Creates a plain object from a DatasetSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @static + * @param {google.cloud.documentai.v1beta3.DatasetSchema} message DatasetSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatasetSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.documentSchema = null; + object.satisfiesPzs = false; + object.satisfiesPzi = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) + object.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.toObject(message.documentSchema, options); + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + return object; + }; + + /** + * Converts this DatasetSchema to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @instance + * @returns {Object.} JSON object + */ + DatasetSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatasetSchema + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DatasetSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatasetSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DatasetSchema"; + }; + + return DatasetSchema; + })(); + + v1beta3.BatchDatasetDocuments = (function() { + + /** + * Properties of a BatchDatasetDocuments. + * @memberof google.cloud.documentai.v1beta3 + * @interface IBatchDatasetDocuments + * @property {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds|null} [individualDocumentIds] BatchDatasetDocuments individualDocumentIds + * @property {string|null} [filter] BatchDatasetDocuments filter + */ + + /** + * Constructs a new BatchDatasetDocuments. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a BatchDatasetDocuments. + * @implements IBatchDatasetDocuments + * @constructor + * @param {google.cloud.documentai.v1beta3.IBatchDatasetDocuments=} [properties] Properties to set + */ + function BatchDatasetDocuments(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDatasetDocuments individualDocumentIds. + * @member {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds|null|undefined} individualDocumentIds + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @instance + */ + BatchDatasetDocuments.prototype.individualDocumentIds = null; + + /** + * BatchDatasetDocuments filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @instance + */ + BatchDatasetDocuments.prototype.filter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchDatasetDocuments criteria. + * @member {"individualDocumentIds"|"filter"|undefined} criteria + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @instance + */ + Object.defineProperty(BatchDatasetDocuments.prototype, "criteria", { + get: $util.oneOfGetter($oneOfFields = ["individualDocumentIds", "filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchDatasetDocuments instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDatasetDocuments=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments} BatchDatasetDocuments instance + */ + BatchDatasetDocuments.create = function create(properties) { + return new BatchDatasetDocuments(properties); + }; + + /** + * Encodes the specified BatchDatasetDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDatasetDocuments} message BatchDatasetDocuments message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDatasetDocuments.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.individualDocumentIds != null && Object.hasOwnProperty.call(message, "individualDocumentIds")) + $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.encode(message.individualDocumentIds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + return writer; + }; + + /** + * Encodes the specified BatchDatasetDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDatasetDocuments} message BatchDatasetDocuments message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDatasetDocuments.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDatasetDocuments message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments} BatchDatasetDocuments + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDatasetDocuments.decode = function decode(reader, 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.v1beta3.BatchDatasetDocuments(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.individualDocumentIds = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.decode(reader, reader.uint32()); + break; + } + case 2: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDatasetDocuments message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments} BatchDatasetDocuments + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDatasetDocuments.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDatasetDocuments message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDatasetDocuments.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.individualDocumentIds != null && message.hasOwnProperty("individualDocumentIds")) { + properties.criteria = 1; + { + var error = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.verify(message.individualDocumentIds); + if (error) + return "individualDocumentIds." + error; + } + } + if (message.filter != null && message.hasOwnProperty("filter")) { + if (properties.criteria === 1) + return "criteria: multiple values"; + properties.criteria = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + return null; + }; + + /** + * Creates a BatchDatasetDocuments message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments} BatchDatasetDocuments + */ + BatchDatasetDocuments.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments) + return object; + var message = new $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments(); + if (object.individualDocumentIds != null) { + if (typeof object.individualDocumentIds !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchDatasetDocuments.individualDocumentIds: object expected"); + message.individualDocumentIds = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.fromObject(object.individualDocumentIds); + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a BatchDatasetDocuments message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @static + * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments} message BatchDatasetDocuments + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDatasetDocuments.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.individualDocumentIds != null && message.hasOwnProperty("individualDocumentIds")) { + object.individualDocumentIds = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.toObject(message.individualDocumentIds, options); + if (options.oneofs) + object.criteria = "individualDocumentIds"; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object.criteria = "filter"; + } + return object; + }; + + /** + * Converts this BatchDatasetDocuments to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @instance + * @returns {Object.} JSON object + */ + BatchDatasetDocuments.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDatasetDocuments + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDatasetDocuments.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDatasetDocuments"; + }; + + BatchDatasetDocuments.IndividualDocumentIds = (function() { + + /** + * Properties of an IndividualDocumentIds. + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @interface IIndividualDocumentIds + * @property {Array.|null} [documentIds] IndividualDocumentIds documentIds + */ + + /** + * Constructs a new IndividualDocumentIds. + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments + * @classdesc Represents an IndividualDocumentIds. + * @implements IIndividualDocumentIds + * @constructor + * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds=} [properties] Properties to set + */ + function IndividualDocumentIds(properties) { + this.documentIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndividualDocumentIds documentIds. + * @member {Array.} documentIds + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds + * @instance + */ + IndividualDocumentIds.prototype.documentIds = $util.emptyArray; + + /** + * Creates a new IndividualDocumentIds instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds + * @static + * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds} IndividualDocumentIds instance + */ + IndividualDocumentIds.create = function create(properties) { + return new IndividualDocumentIds(properties); + }; + + /** + * Encodes the specified IndividualDocumentIds message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds + * @static + * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds} message IndividualDocumentIds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualDocumentIds.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentIds != null && message.documentIds.length) + for (var i = 0; i < message.documentIds.length; ++i) + $root.google.cloud.documentai.v1beta3.DocumentId.encode(message.documentIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IndividualDocumentIds message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds + * @static + * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds} message IndividualDocumentIds message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualDocumentIds.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndividualDocumentIds message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds} IndividualDocumentIds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualDocumentIds.decode = function decode(reader, 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.v1beta3.BatchDatasetDocuments.IndividualDocumentIds(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.documentIds && message.documentIds.length)) + message.documentIds = []; + message.documentIds.push($root.google.cloud.documentai.v1beta3.DocumentId.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndividualDocumentIds message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds} IndividualDocumentIds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualDocumentIds.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndividualDocumentIds message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndividualDocumentIds.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentIds != null && message.hasOwnProperty("documentIds")) { + if (!Array.isArray(message.documentIds)) + return "documentIds: array expected"; + for (var i = 0; i < message.documentIds.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.DocumentId.verify(message.documentIds[i]); + if (error) + return "documentIds." + error; + } + } + return null; + }; + + /** + * Creates an IndividualDocumentIds message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds} IndividualDocumentIds + */ + IndividualDocumentIds.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds) + return object; + var message = new $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds(); + if (object.documentIds) { + if (!Array.isArray(object.documentIds)) + throw TypeError(".google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.documentIds: array expected"); + message.documentIds = []; + for (var i = 0; i < object.documentIds.length; ++i) { + if (typeof object.documentIds[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.documentIds: object expected"); + message.documentIds[i] = $root.google.cloud.documentai.v1beta3.DocumentId.fromObject(object.documentIds[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IndividualDocumentIds message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds + * @static + * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds} message IndividualDocumentIds + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndividualDocumentIds.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documentIds = []; + if (message.documentIds && message.documentIds.length) { + object.documentIds = []; + for (var j = 0; j < message.documentIds.length; ++j) + object.documentIds[j] = $root.google.cloud.documentai.v1beta3.DocumentId.toObject(message.documentIds[j], options); + } + return object; + }; + + /** + * Converts this IndividualDocumentIds to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds + * @instance + * @returns {Object.} JSON object + */ + IndividualDocumentIds.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndividualDocumentIds + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndividualDocumentIds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds"; + }; + + return IndividualDocumentIds; + })(); + + return BatchDatasetDocuments; + })(); + + v1beta3.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.documentai.v1beta3 + * @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.v1beta3.Document.IShardInfo|null} [shardInfo] Document shardInfo + * @property {google.rpc.IStatus|null} [error] Document error + * @property {Array.|null} [revisions] Document revisions + * @property {google.cloud.documentai.v1beta3.Document.IDocumentLayout|null} [documentLayout] Document documentLayout + * @property {google.cloud.documentai.v1beta3.Document.IChunkedDocument|null} [chunkedDocument] Document chunkedDocument + * @property {Array.|null} [blobAssets] Document blobAssets + * @property {google.cloud.documentai.v1beta3.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.v1beta3 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.documentai.v1beta3.IDocument=} [properties] Properties to set + */ + function Document(properties) { + this.textStyles = []; + this.pages = []; + this.entities = []; + this.entityRelations = []; + this.textChanges = []; + this.revisions = []; + this.blobAssets = []; + 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.v1beta3.Document + * @instance + */ + Document.prototype.uri = null; + + /** + * Document content. + * @member {Uint8Array|null|undefined} content + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.content = null; + + /** + * Document docid. + * @member {string} docid + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.docid = ""; + + /** + * Document mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.mimeType = ""; + + /** + * Document text. + * @member {string} text + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.text = ""; + + /** + * Document textStyles. + * @member {Array.} textStyles + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.textStyles = $util.emptyArray; + + /** + * Document pages. + * @member {Array.} pages + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.pages = $util.emptyArray; + + /** + * Document entities. + * @member {Array.} entities + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.entities = $util.emptyArray; + + /** + * Document entityRelations. + * @member {Array.} entityRelations + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.entityRelations = $util.emptyArray; + + /** + * Document textChanges. + * @member {Array.} textChanges + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.textChanges = $util.emptyArray; + + /** + * Document shardInfo. + * @member {google.cloud.documentai.v1beta3.Document.IShardInfo|null|undefined} shardInfo + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.shardInfo = null; + + /** + * Document error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.error = null; + + /** + * Document revisions. + * @member {Array.} revisions + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.revisions = $util.emptyArray; + + /** + * Document documentLayout. + * @member {google.cloud.documentai.v1beta3.Document.IDocumentLayout|null|undefined} documentLayout + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.documentLayout = null; + + /** + * Document chunkedDocument. + * @member {google.cloud.documentai.v1beta3.Document.IChunkedDocument|null|undefined} chunkedDocument + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.chunkedDocument = null; + + /** + * Document blobAssets. + * @member {Array.} blobAssets + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.blobAssets = $util.emptyArray; + + /** + * Document entityValidationOutput. + * @member {google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null|undefined} entityValidationOutput + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.entityValidationOutput = null; + + /** + * Document entitiesRevisions. + * @member {Array.} entitiesRevisions + * @memberof google.cloud.documentai.v1beta3.Document + * @instance + */ + Document.prototype.entitiesRevisions = $util.emptyArray; + + /** + * Document entitiesRevisionId. + * @member {string} entitiesRevisionId + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document + * @static + * @param {google.cloud.documentai.v1beta3.IDocument=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.encode(message.chunkedDocument, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.blobAssets != null && message.blobAssets.length) + for (var i = 0; i < message.blobAssets.length; ++i) + $root.google.cloud.documentai.v1beta3.Document.BlobAsset.encode(message.blobAssets[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.entityValidationOutput != null && Object.hasOwnProperty.call(message, "entityValidationOutput")) + $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.pages && message.pages.length)) + message.pages = []; + message.pages.push($root.google.cloud.documentai.v1beta3.Document.Page.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.documentai.v1beta3.Document.Entity.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.entityRelations && message.entityRelations.length)) + message.entityRelations = []; + message.entityRelations.push($root.google.cloud.documentai.v1beta3.Document.EntityRelation.decode(reader, reader.uint32())); + break; + } + case 14: { + if (!(message.textChanges && message.textChanges.length)) + message.textChanges = []; + message.textChanges.push($root.google.cloud.documentai.v1beta3.Document.TextChange.decode(reader, reader.uint32())); + break; + } + case 9: { + message.shardInfo = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.decode(reader, reader.uint32())); + break; + } + case 17: { + message.documentLayout = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.decode(reader, reader.uint32()); + break; + } + case 18: { + message.chunkedDocument = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.decode(reader, reader.uint32()); + break; + } + case 19: { + if (!(message.blobAssets && message.blobAssets.length)) + message.blobAssets = []; + message.blobAssets.push($root.google.cloud.documentai.v1beta3.Document.BlobAsset.decode(reader, reader.uint32())); + break; + } + case 21: { + message.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.decode(reader, reader.uint32()); + break; + } + case 22: { + if (!(message.entitiesRevisions && message.entitiesRevisions.length)) + message.entitiesRevisions = []; + message.entitiesRevisions.push($root.google.cloud.documentai.v1beta3.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.v1beta3.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextChange.verify(message.textChanges[i]); + if (error) + return "textChanges." + error; + } + } + if (message.shardInfo != null && message.hasOwnProperty("shardInfo")) { + var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.verify(message.revisions[i]); + if (error) + return "revisions." + error; + } + } + if (message.documentLayout != null && message.hasOwnProperty("documentLayout")) { + var error = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.verify(message.documentLayout); + if (error) + return "documentLayout." + error; + } + if (message.chunkedDocument != null && message.hasOwnProperty("chunkedDocument")) { + var error = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.verify(message.chunkedDocument); + if (error) + return "chunkedDocument." + error; + } + if (message.blobAssets != null && message.hasOwnProperty("blobAssets")) { + if (!Array.isArray(message.blobAssets)) + return "blobAssets: array expected"; + for (var i = 0; i < message.blobAssets.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.Document.BlobAsset.verify(message.blobAssets[i]); + if (error) + return "blobAssets." + error; + } + } + if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) { + var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.textStyles: object expected"); + message.textStyles[i] = $root.google.cloud.documentai.v1beta3.Document.Style.fromObject(object.textStyles[i]); + } + } + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.pages: object expected"); + message.pages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.fromObject(object.pages[i]); + } + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.entities: object expected"); + message.entities[i] = $root.google.cloud.documentai.v1beta3.Document.Entity.fromObject(object.entities[i]); + } + } + if (object.entityRelations) { + if (!Array.isArray(object.entityRelations)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.entityRelations: object expected"); + message.entityRelations[i] = $root.google.cloud.documentai.v1beta3.Document.EntityRelation.fromObject(object.entityRelations[i]); + } + } + if (object.textChanges) { + if (!Array.isArray(object.textChanges)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.textChanges: object expected"); + message.textChanges[i] = $root.google.cloud.documentai.v1beta3.Document.TextChange.fromObject(object.textChanges[i]); + } + } + if (object.shardInfo != null) { + if (typeof object.shardInfo !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.shardInfo: object expected"); + message.shardInfo = $root.google.cloud.documentai.v1beta3.Document.ShardInfo.fromObject(object.shardInfo); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.revisions: object expected"); + message.revisions[i] = $root.google.cloud.documentai.v1beta3.Document.Revision.fromObject(object.revisions[i]); + } + } + if (object.documentLayout != null) { + if (typeof object.documentLayout !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.documentLayout: object expected"); + message.documentLayout = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.fromObject(object.documentLayout); + } + if (object.chunkedDocument != null) { + if (typeof object.chunkedDocument !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.chunkedDocument: object expected"); + message.chunkedDocument = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.fromObject(object.chunkedDocument); + } + if (object.blobAssets) { + if (!Array.isArray(object.blobAssets)) + throw TypeError(".google.cloud.documentai.v1beta3.Document.blobAssets: array expected"); + message.blobAssets = []; + for (var i = 0; i < object.blobAssets.length; ++i) { + if (typeof object.blobAssets[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.blobAssets: object expected"); + message.blobAssets[i] = $root.google.cloud.documentai.v1beta3.Document.BlobAsset.fromObject(object.blobAssets[i]); + } + } + if (object.entityValidationOutput != null) { + if (typeof object.entityValidationOutput !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.entityValidationOutput: object expected"); + message.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.fromObject(object.entityValidationOutput); + } + if (object.entitiesRevisions) { + if (!Array.isArray(object.entitiesRevisions)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.entitiesRevisions: object expected"); + message.entitiesRevisions[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document + * @static + * @param {google.cloud.documentai.v1beta3.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.blobAssets = []; + 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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityRelation.toObject(message.entityRelations[j], options); + } + if (message.shardInfo != null && message.hasOwnProperty("shardInfo")) + object.shardInfo = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.toObject(message.documentLayout, options); + if (message.chunkedDocument != null && message.hasOwnProperty("chunkedDocument")) + object.chunkedDocument = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.toObject(message.chunkedDocument, options); + if (message.blobAssets && message.blobAssets.length) { + object.blobAssets = []; + for (var j = 0; j < message.blobAssets.length; ++j) + object.blobAssets[j] = $root.google.cloud.documentai.v1beta3.Document.BlobAsset.toObject(message.blobAssets[j], options); + } + if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) + object.entityValidationOutput = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document"; + }; + + Document.ShardInfo = (function() { + + /** + * Properties of a ShardInfo. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document + * @classdesc Represents a ShardInfo. + * @implements IShardInfo + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ShardInfo + * @static + * @param {google.cloud.documentai.v1beta3.Document.IShardInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.ShardInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ShardInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ShardInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ShardInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.ShardInfo} ShardInfo + */ + ShardInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ShardInfo) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ShardInfo + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ShardInfo"; + }; + + return ShardInfo; + })(); + + Document.Style = (function() { + + /** + * Properties of a Style. + * @memberof google.cloud.documentai.v1beta3.Document + * @interface IStyle + * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.IFontSize|null} [fontSize] Style fontSize + * @property {string|null} [fontFamily] Style fontFamily + */ + + /** + * Constructs a new Style. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents a Style. + * @implements IStyle + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextAnchor|null|undefined} textAnchor + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @instance + */ + Style.prototype.textAnchor = null; + + /** + * Style color. + * @member {google.type.IColor|null|undefined} color + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @instance + */ + Style.prototype.color = null; + + /** + * Style backgroundColor. + * @member {google.type.IColor|null|undefined} backgroundColor + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @instance + */ + Style.prototype.backgroundColor = null; + + /** + * Style fontWeight. + * @member {string} fontWeight + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @instance + */ + Style.prototype.fontWeight = ""; + + /** + * Style textStyle. + * @member {string} textStyle + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @instance + */ + Style.prototype.textStyle = ""; + + /** + * Style textDecoration. + * @member {string} textDecoration + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @instance + */ + Style.prototype.textDecoration = ""; + + /** + * Style fontSize. + * @member {google.cloud.documentai.v1beta3.Document.Style.IFontSize|null|undefined} fontSize + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @instance + */ + Style.prototype.fontSize = null; + + /** + * Style fontFamily. + * @member {string} fontFamily + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @instance + */ + Style.prototype.fontFamily = ""; + + /** + * Creates a new Style instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @static + * @param {google.cloud.documentai.v1beta3.Document.IStyle=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Style} Style + */ + Style.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Style) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Style(); + if (object.textAnchor != null) { + if (typeof object.textAnchor !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Style.textAnchor: object expected"); + message.textAnchor = $root.google.cloud.documentai.v1beta3.Document.TextAnchor.fromObject(object.textAnchor); + } + if (object.color != null) { + if (typeof object.color !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Style.fontSize: object expected"); + message.fontSize = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Style + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style"; + }; + + Style.FontSize = (function() { + + /** + * Properties of a FontSize. + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @interface IFontSize + * @property {number|null} [size] FontSize size + * @property {string|null} [unit] FontSize unit + */ + + /** + * Constructs a new FontSize. + * @memberof google.cloud.documentai.v1beta3.Document.Style + * @classdesc Represents a FontSize. + * @implements IFontSize + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.FontSize + * @instance + */ + FontSize.prototype.size = 0; + + /** + * FontSize unit. + * @member {string} unit + * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize + * @instance + */ + FontSize.prototype.unit = ""; + + /** + * Creates a new FontSize instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize + * @static + * @param {google.cloud.documentai.v1beta3.Document.Style.IFontSize=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.FontSize.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.FontSize.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style.FontSize + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Style.FontSize + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Style.FontSize} FontSize + */ + FontSize.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Style.FontSize) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.FontSize + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style.FontSize"; + }; + + return FontSize; + })(); + + return Style; + })(); + + Document.Page = (function() { + + /** + * Properties of a Page. + * @memberof google.cloud.documentai.v1beta3.Document + * @interface IPage + * @property {number|null} [pageNumber] Page pageNumber + * @property {google.cloud.documentai.v1beta3.Document.Page.IImage|null} [image] Page image + * @property {Array.|null} [transforms] Page transforms + * @property {google.cloud.documentai.v1beta3.Document.Page.IDimension|null} [dimension] Page dimension + * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IImageQualityScores|null} [imageQualityScores] Page imageQualityScores + * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] Page provenance + */ + + /** + * Constructs a new Page. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents a Page. + * @implements IPage + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page + * @instance + */ + Page.prototype.pageNumber = 0; + + /** + * Page image. + * @member {google.cloud.documentai.v1beta3.Document.Page.IImage|null|undefined} image + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.image = null; + + /** + * Page transforms. + * @member {Array.} transforms + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.transforms = $util.emptyArray; + + /** + * Page dimension. + * @member {google.cloud.documentai.v1beta3.Document.Page.IDimension|null|undefined} dimension + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.dimension = null; + + /** + * Page layout. + * @member {google.cloud.documentai.v1beta3.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.layout = null; + + /** + * Page detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.detectedLanguages = $util.emptyArray; + + /** + * Page blocks. + * @member {Array.} blocks + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.blocks = $util.emptyArray; + + /** + * Page paragraphs. + * @member {Array.} paragraphs + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.paragraphs = $util.emptyArray; + + /** + * Page lines. + * @member {Array.} lines + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.lines = $util.emptyArray; + + /** + * Page tokens. + * @member {Array.} tokens + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.tokens = $util.emptyArray; + + /** + * Page visualElements. + * @member {Array.} visualElements + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.visualElements = $util.emptyArray; + + /** + * Page tables. + * @member {Array.} tables + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.tables = $util.emptyArray; + + /** + * Page formFields. + * @member {Array.} formFields + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.formFields = $util.emptyArray; + + /** + * Page symbols. + * @member {Array.} symbols + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.symbols = $util.emptyArray; + + /** + * Page detectedBarcodes. + * @member {Array.} detectedBarcodes + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.detectedBarcodes = $util.emptyArray; + + /** + * Page imageQualityScores. + * @member {google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores|null|undefined} imageQualityScores + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.imageQualityScores = null; + + /** + * Page provenance. + * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @instance + */ + Page.prototype.provenance = null; + + /** + * Creates a new Page instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @static + * @param {google.cloud.documentai.v1beta3.Document.IPage=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Matrix.decode(reader, reader.uint32())); + break; + } + case 2: { + message.dimension = $root.google.cloud.documentai.v1beta3.Document.Page.Dimension.decode(reader, reader.uint32()); + break; + } + case 3: { + message.layout = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedBarcode.decode(reader, reader.uint32())); + break; + } + case 17: { + message.imageQualityScores = $root.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.decode(reader, reader.uint32()); + break; + } + case 16: { + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Dimension.verify(message.dimension); + if (error) + return "dimension." + error; + } + if (message.layout != null && message.hasOwnProperty("layout")) { + var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.verify(message.imageQualityScores); + if (error) + return "imageQualityScores." + error; + } + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page} Page + */ + Page.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.image: object expected"); + message.image = $root.google.cloud.documentai.v1beta3.Document.Page.Image.fromObject(object.image); + } + if (object.transforms) { + if (!Array.isArray(object.transforms)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.transforms: object expected"); + message.transforms[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Matrix.fromObject(object.transforms[i]); + } + } + if (object.dimension != null) { + if (typeof object.dimension !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.dimension: object expected"); + message.dimension = $root.google.cloud.documentai.v1beta3.Document.Page.Dimension.fromObject(object.dimension); + } + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.blocks: object expected"); + message.blocks[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Block.fromObject(object.blocks[i]); + } + } + if (object.paragraphs) { + if (!Array.isArray(object.paragraphs)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.paragraphs: object expected"); + message.paragraphs[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Paragraph.fromObject(object.paragraphs[i]); + } + } + if (object.lines) { + if (!Array.isArray(object.lines)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.lines: object expected"); + message.lines[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Line.fromObject(object.lines[i]); + } + } + if (object.tokens) { + if (!Array.isArray(object.tokens)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.tokens: object expected"); + message.tokens[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Token.fromObject(object.tokens[i]); + } + } + if (object.visualElements) { + if (!Array.isArray(object.visualElements)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.visualElements: object expected"); + message.visualElements[i] = $root.google.cloud.documentai.v1beta3.Document.Page.VisualElement.fromObject(object.visualElements[i]); + } + } + if (object.tables) { + if (!Array.isArray(object.tables)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.tables: object expected"); + message.tables[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Table.fromObject(object.tables[i]); + } + } + if (object.formFields) { + if (!Array.isArray(object.formFields)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.formFields: object expected"); + message.formFields[i] = $root.google.cloud.documentai.v1beta3.Document.Page.FormField.fromObject(object.formFields[i]); + } + } + if (object.symbols) { + if (!Array.isArray(object.symbols)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.symbols: object expected"); + message.symbols[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Symbol.fromObject(object.symbols[i]); + } + } + if (object.detectedBarcodes) { + if (!Array.isArray(object.detectedBarcodes)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.detectedBarcodes: object expected"); + message.detectedBarcodes[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.fromObject(object.detectedBarcodes[i]); + } + } + if (object.imageQualityScores != null) { + if (typeof object.imageQualityScores !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.imageQualityScores: object expected"); + message.imageQualityScores = $root.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.fromObject(object.imageQualityScores); + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Dimension.toObject(message.dimension, options); + if (message.layout != null && message.hasOwnProperty("layout")) + object.layout = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Symbol.toObject(message.symbols[j], options); + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedBarcode.toObject(message.detectedBarcodes[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); + if (message.imageQualityScores != null && message.hasOwnProperty("imageQualityScores")) + object.imageQualityScores = $root.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.toObject(message.imageQualityScores, options); + return object; + }; + + /** + * Converts this Page to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page"; + }; + + Page.Dimension = (function() { + + /** + * Properties of a Dimension. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page + * @classdesc Represents a Dimension. + * @implements IDimension + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Dimension + * @instance + */ + Dimension.prototype.width = 0; + + /** + * Dimension height. + * @member {number} height + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension + * @instance + */ + Dimension.prototype.height = 0; + + /** + * Dimension unit. + * @member {string} unit + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension + * @instance + */ + Dimension.prototype.unit = ""; + + /** + * Creates a new Dimension instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.IDimension=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Dimension.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Dimension.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Dimension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Dimension + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Dimension} Dimension + */ + Dimension.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Dimension) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Dimension + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Dimension"; + }; + + return Dimension; + })(); + + Page.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Image + * @instance + */ + Image.prototype.content = $util.newBuffer([]); + + /** + * Image mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image + * @instance + */ + Image.prototype.mimeType = ""; + + /** + * Image width. + * @member {number} width + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image + * @instance + */ + Image.prototype.width = 0; + + /** + * Image height. + * @member {number} height + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image + * @instance + */ + Image.prototype.height = 0; + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.IImage=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Image + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Image) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Image + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Image"; + }; + + return Image; + })(); + + Page.Matrix = (function() { + + /** + * Properties of a Matrix. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page + * @classdesc Represents a Matrix. + * @implements IMatrix + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Matrix + * @instance + */ + Matrix.prototype.rows = 0; + + /** + * Matrix cols. + * @member {number} cols + * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix + * @instance + */ + Matrix.prototype.cols = 0; + + /** + * Matrix type. + * @member {number} type + * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix + * @instance + */ + Matrix.prototype.type = 0; + + /** + * Matrix data. + * @member {Uint8Array} data + * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix + * @instance + */ + Matrix.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Matrix instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.IMatrix=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Matrix.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Matrix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Matrix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Matrix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Matrix} Matrix + */ + Matrix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Matrix) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Matrix + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Matrix"; + }; + + return Matrix; + })(); + + Page.Layout = (function() { + + /** + * Properties of a Layout. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @interface ILayout + * @property {google.cloud.documentai.v1beta3.Document.ITextAnchor|null} [textAnchor] Layout textAnchor + * @property {number|null} [confidence] Layout confidence + * @property {google.cloud.documentai.v1beta3.IBoundingPoly|null} [boundingPoly] Layout boundingPoly + * @property {google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation|null} [orientation] Layout orientation + */ + + /** + * Constructs a new Layout. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a Layout. + * @implements ILayout + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextAnchor|null|undefined} textAnchor + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout + * @instance + */ + Layout.prototype.textAnchor = null; + + /** + * Layout confidence. + * @member {number} confidence + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout + * @instance + */ + Layout.prototype.confidence = 0; + + /** + * Layout boundingPoly. + * @member {google.cloud.documentai.v1beta3.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout + * @instance + */ + Layout.prototype.boundingPoly = null; + + /** + * Layout orientation. + * @member {google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation} orientation + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout + * @instance + */ + Layout.prototype.orientation = 0; + + /** + * Creates a new Layout instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.ILayout=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.decode(reader, reader.uint32()); + break; + } + case 2: { + message.confidence = reader.float(); + break; + } + case 3: { + message.boundingPoly = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Layout} Layout + */ + Layout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Layout) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Layout(); + if (object.textAnchor != null) { + if (typeof object.textAnchor !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Layout.textAnchor: object expected"); + message.textAnchor = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.BoundingPoly.toObject(message.boundingPoly, options); + if (message.orientation != null && message.hasOwnProperty("orientation")) + object.orientation = options.enums === String ? $root.google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation[message.orientation] === undefined ? message.orientation : $root.google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation[message.orientation] : message.orientation; + return object; + }; + + /** + * Converts this Layout to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout"; + }; + + /** + * Orientation enum. + * @name google.cloud.documentai.v1beta3.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.v1beta3.Document.Page + * @interface IBlock + * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [layout] Block layout + * @property {Array.|null} [detectedLanguages] Block detectedLanguages + * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] Block provenance + */ + + /** + * Constructs a new Block. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a Block. + * @implements IBlock + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1beta3.Document.Page.Block + * @instance + */ + Block.prototype.layout = null; + + /** + * Block detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.Block + * @instance + */ + Block.prototype.detectedLanguages = $util.emptyArray; + + /** + * Block provenance. + * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1beta3.Document.Page.Block + * @instance + */ + Block.prototype.provenance = null; + + /** + * Creates a new Block instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.Block + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.IBlock=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Block.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Block + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Block.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Block + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 3: { + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Block + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Block + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Block} Block + */ + Block.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Block) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Block(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Block.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Block.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Block.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Block + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); + return object; + }; + + /** + * Converts this Block to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Block"; + }; + + return Block; + })(); + + Page.Paragraph = (function() { + + /** + * Properties of a Paragraph. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @interface IParagraph + * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [layout] Paragraph layout + * @property {Array.|null} [detectedLanguages] Paragraph detectedLanguages + * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] Paragraph provenance + */ + + /** + * Constructs a new Paragraph. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a Paragraph. + * @implements IParagraph + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph + * @instance + */ + Paragraph.prototype.layout = null; + + /** + * Paragraph detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph + * @instance + */ + Paragraph.prototype.detectedLanguages = $util.emptyArray; + + /** + * Paragraph provenance. + * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph + * @instance + */ + Paragraph.prototype.provenance = null; + + /** + * Creates a new Paragraph instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.IParagraph=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Paragraph.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Paragraph.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 3: { + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Paragraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Paragraph + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Paragraph} Paragraph + */ + Paragraph.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Paragraph) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Paragraph(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Paragraph.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Paragraph.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Paragraph.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Paragraph + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); + return object; + }; + + /** + * Converts this Paragraph to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Paragraph"; + }; + + return Paragraph; + })(); + + Page.Line = (function() { + + /** + * Properties of a Line. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @interface ILine + * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [layout] Line layout + * @property {Array.|null} [detectedLanguages] Line detectedLanguages + * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] Line provenance + */ + + /** + * Constructs a new Line. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a Line. + * @implements ILine + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1beta3.Document.Page.Line + * @instance + */ + Line.prototype.layout = null; + + /** + * Line detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.Line + * @instance + */ + Line.prototype.detectedLanguages = $util.emptyArray; + + /** + * Line provenance. + * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1beta3.Document.Page.Line + * @instance + */ + Line.prototype.provenance = null; + + /** + * Creates a new Line instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.Line + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.ILine=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Line.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Line + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Line.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Line + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 3: { + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Line + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Line + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Line} Line + */ + Line.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Line) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Line(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Line.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Line.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Line.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Line + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); + return object; + }; + + /** + * Converts this Line to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Line"; + }; + + return Line; + })(); + + Page.Token = (function() { + + /** + * Properties of a Token. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @interface IToken + * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [layout] Token layout + * @property {google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak|null} [detectedBreak] Token detectedBreak + * @property {Array.|null} [detectedLanguages] Token detectedLanguages + * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] Token provenance + * @property {google.cloud.documentai.v1beta3.Document.Page.Token.IStyleInfo|null} [styleInfo] Token styleInfo + */ + + /** + * Constructs a new Token. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a Token. + * @implements IToken + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @instance + */ + Token.prototype.layout = null; + + /** + * Token detectedBreak. + * @member {google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak|null|undefined} detectedBreak + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @instance + */ + Token.prototype.detectedBreak = null; + + /** + * Token detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @instance + */ + Token.prototype.detectedLanguages = $util.emptyArray; + + /** + * Token provenance. + * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @instance + */ + Token.prototype.provenance = null; + + /** + * Token styleInfo. + * @member {google.cloud.documentai.v1beta3.Document.Page.Token.IStyleInfo|null|undefined} styleInfo + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @instance + */ + Token.prototype.styleInfo = null; + + /** + * Creates a new Token instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.IToken=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + message.detectedBreak = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 4: { + message.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.decode(reader, reader.uint32()); + break; + } + case 5: { + message.styleInfo = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.verify(message.layout); + if (error) + return "layout." + error; + } + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) { + var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.verify(message.provenance); + if (error) + return "provenance." + error; + } + if (message.styleInfo != null && message.hasOwnProperty("styleInfo")) { + var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Token} Token + */ + Token.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Token) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Token(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Token.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); + } + if (object.detectedBreak != null) { + if (typeof object.detectedBreak !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Token.detectedBreak: object expected"); + message.detectedBreak = $root.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.fromObject(object.detectedBreak); + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Token.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.fromObject(object.provenance); + } + if (object.styleInfo != null) { + if (typeof object.styleInfo !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Token.styleInfo: object expected"); + message.styleInfo = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout.toObject(message.layout, options); + if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) + object.detectedBreak = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); + if (message.styleInfo != null && message.hasOwnProperty("styleInfo")) + object.styleInfo = $root.google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo.toObject(message.styleInfo, options); + return object; + }; + + /** + * Converts this Token to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token"; + }; + + Token.DetectedBreak = (function() { + + /** + * Properties of a DetectedBreak. + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @interface IDetectedBreak + * @property {google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type|null} [type] DetectedBreak type + */ + + /** + * Constructs a new DetectedBreak. + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token + * @classdesc Represents a DetectedBreak. + * @implements IDetectedBreak + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak.Type} type + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak + * @instance + */ + DetectedBreak.prototype.type = 0; + + /** + * Creates a new DetectedBreak instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak} DetectedBreak + */ + DetectedBreak.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak.Type[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this DetectedBreak to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak"; + }; + + /** + * Type enum. + * @name google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token + * @classdesc Represents a StyleInfo. + * @implements IStyleInfo + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.fontSize = 0; + + /** + * StyleInfo pixelFontSize. + * @member {number} pixelFontSize + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.pixelFontSize = 0; + + /** + * StyleInfo letterSpacing. + * @member {number} letterSpacing + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.letterSpacing = 0; + + /** + * StyleInfo fontType. + * @member {string} fontType + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.fontType = ""; + + /** + * StyleInfo bold. + * @member {boolean} bold + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.bold = false; + + /** + * StyleInfo italic. + * @member {boolean} italic + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.italic = false; + + /** + * StyleInfo underlined. + * @member {boolean} underlined + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.underlined = false; + + /** + * StyleInfo strikeout. + * @member {boolean} strikeout + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.strikeout = false; + + /** + * StyleInfo subscript. + * @member {boolean} subscript + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.subscript = false; + + /** + * StyleInfo superscript. + * @member {boolean} superscript + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.superscript = false; + + /** + * StyleInfo smallcaps. + * @member {boolean} smallcaps + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.smallcaps = false; + + /** + * StyleInfo fontWeight. + * @member {number} fontWeight + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.fontWeight = 0; + + /** + * StyleInfo handwritten. + * @member {boolean} handwritten + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.handwritten = false; + + /** + * StyleInfo textColor. + * @member {google.type.IColor|null|undefined} textColor + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.textColor = null; + + /** + * StyleInfo backgroundColor. + * @member {google.type.IColor|null|undefined} backgroundColor + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @instance + */ + StyleInfo.prototype.backgroundColor = null; + + /** + * Creates a new StyleInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.Token.IStyleInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo} StyleInfo + */ + StyleInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo"; + }; + + return StyleInfo; + })(); + + return Token; + })(); + + Page.Symbol = (function() { + + /** + * Properties of a Symbol. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @interface ISymbol + * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [layout] Symbol layout + * @property {Array.|null} [detectedLanguages] Symbol detectedLanguages + */ + + /** + * Constructs a new Symbol. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a Symbol. + * @implements ISymbol + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1beta3.Document.Page.Symbol + * @instance + */ + Symbol.prototype.layout = null; + + /** + * Symbol detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.Symbol + * @instance + */ + Symbol.prototype.detectedLanguages = $util.emptyArray; + + /** + * Creates a new Symbol instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.Symbol + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.ISymbol=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Symbol.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Symbol + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Symbol.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Symbol + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Symbol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Symbol + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Symbol} Symbol + */ + Symbol.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Symbol) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Symbol(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Symbol.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Symbol.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Symbol + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + return object; + }; + + /** + * Converts this Symbol to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Symbol"; + }; + + return Symbol; + })(); + + Page.VisualElement = (function() { + + /** + * Properties of a VisualElement. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @interface IVisualElement + * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page + * @classdesc Represents a VisualElement. + * @implements IVisualElement + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement + * @instance + */ + VisualElement.prototype.layout = null; + + /** + * VisualElement type. + * @member {string} type + * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement + * @instance + */ + VisualElement.prototype.type = ""; + + /** + * VisualElement detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement + * @instance + */ + VisualElement.prototype.detectedLanguages = $util.emptyArray; + + /** + * Creates a new VisualElement instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.IVisualElement=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.VisualElement.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.VisualElement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.VisualElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.VisualElement + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.VisualElement} VisualElement + */ + VisualElement.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.VisualElement) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Page.VisualElement(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.VisualElement.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.VisualElement.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.VisualElement + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + return object; + }; + + /** + * Converts this VisualElement to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.VisualElement"; + }; + + return VisualElement; + })(); + + Page.Table = (function() { + + /** + * Properties of a Table. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @interface ITable + * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.IProvenance|null} [provenance] Table provenance + */ + + /** + * Constructs a new Table. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a Table. + * @implements ITable + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table + * @instance + */ + Table.prototype.layout = null; + + /** + * Table headerRows. + * @member {Array.} headerRows + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table + * @instance + */ + Table.prototype.headerRows = $util.emptyArray; + + /** + * Table bodyRows. + * @member {Array.} bodyRows + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table + * @instance + */ + Table.prototype.bodyRows = $util.emptyArray; + + /** + * Table detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table + * @instance + */ + Table.prototype.detectedLanguages = $util.emptyArray; + + /** + * Table provenance. + * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table + * @instance + */ + Table.prototype.provenance = null; + + /** + * Creates a new Table instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.ITable=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); + break; + } + case 5: { + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Table} Table + */ + Table.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Table) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Table(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Table.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); + } + if (object.headerRows) { + if (!Array.isArray(object.headerRows)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.headerRows: object expected"); + message.headerRows[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow.fromObject(object.headerRows[i]); + } + } + if (object.bodyRows) { + if (!Array.isArray(object.bodyRows)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.bodyRows: object expected"); + message.bodyRows[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow.fromObject(object.bodyRows[i]); + } + } + if (object.detectedLanguages) { + if (!Array.isArray(object.detectedLanguages)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); + } + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Table.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); + return object; + }; + + /** + * Converts this Table to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table"; + }; + + Table.TableRow = (function() { + + /** + * Properties of a TableRow. + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table + * @interface ITableRow + * @property {Array.|null} [cells] TableRow cells + */ + + /** + * Constructs a new TableRow. + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table + * @classdesc Represents a TableRow. + * @implements ITableRow + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableRow + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableRow.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableRow + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableRow + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableRow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Table.TableRow} TableRow + */ + TableRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow(); + if (object.cells) { + if (!Array.isArray(object.cells)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableRow.cells: object expected"); + message.cells[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableRow + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableCell.toObject(message.cells[j], options); + } + return object; + }; + + /** + * Converts this TableRow to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableRow"; + }; + + return TableRow; + })(); + + Table.TableCell = (function() { + + /** + * Properties of a TableCell. + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table + * @interface ITableCell + * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table + * @classdesc Represents a TableCell. + * @implements ITableCell + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell + * @instance + */ + TableCell.prototype.layout = null; + + /** + * TableCell rowSpan. + * @member {number} rowSpan + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell + * @instance + */ + TableCell.prototype.rowSpan = 0; + + /** + * TableCell colSpan. + * @member {number} colSpan + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell + * @instance + */ + TableCell.prototype.colSpan = 0; + + /** + * TableCell detectedLanguages. + * @member {Array.} detectedLanguages + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableCell + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.Table.ITableCell=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableCell.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableCell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableCell + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.Table.TableCell} TableCell + */ + TableCell.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Table.TableCell) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Table.TableCell(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Table.TableCell.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableCell.detectedLanguages: object expected"); + message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableCell + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); + } + return object; + }; + + /** + * Converts this TableCell to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableCell"; + }; + + return TableCell; + })(); + + return Table; + })(); + + Page.FormField = (function() { + + /** + * Properties of a FormField. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @interface IFormField + * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [fieldName] FormField fieldName + * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.IProvenance|null} [provenance] FormField provenance + */ + + /** + * Constructs a new FormField. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a FormField. + * @implements IFormField + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} fieldName + * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @instance + */ + FormField.prototype.fieldName = null; + + /** + * FormField fieldValue. + * @member {google.cloud.documentai.v1beta3.Document.Page.ILayout|null|undefined} fieldValue + * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @instance + */ + FormField.prototype.fieldValue = null; + + /** + * FormField nameDetectedLanguages. + * @member {Array.} nameDetectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @instance + */ + FormField.prototype.nameDetectedLanguages = $util.emptyArray; + + /** + * FormField valueDetectedLanguages. + * @member {Array.} valueDetectedLanguages + * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @instance + */ + FormField.prototype.valueDetectedLanguages = $util.emptyArray; + + /** + * FormField valueType. + * @member {string} valueType + * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @instance + */ + FormField.prototype.valueType = ""; + + /** + * FormField correctedKeyText. + * @member {string} correctedKeyText + * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @instance + */ + FormField.prototype.correctedKeyText = ""; + + /** + * FormField correctedValueText. + * @member {string} correctedValueText + * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @instance + */ + FormField.prototype.correctedValueText = ""; + + /** + * FormField provenance. + * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @instance + */ + FormField.prototype.provenance = null; + + /** + * Creates a new FormField instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.IFormField=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.FormField.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.FormField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + message.fieldValue = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.FormField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.verify(message.fieldName); + if (error) + return "fieldName." + error; + } + if (message.fieldValue != null && message.hasOwnProperty("fieldValue")) { + var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.FormField + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.FormField} FormField + */ + FormField.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.FormField) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Page.FormField(); + if (object.fieldName != null) { + if (typeof object.fieldName !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.FormField.fieldName: object expected"); + message.fieldName = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.fieldName); + } + if (object.fieldValue != null) { + if (typeof object.fieldValue !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.FormField.fieldValue: object expected"); + message.fieldValue = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.fieldValue); + } + if (object.nameDetectedLanguages) { + if (!Array.isArray(object.nameDetectedLanguages)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.FormField.nameDetectedLanguages: object expected"); + message.nameDetectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.nameDetectedLanguages[i]); + } + } + if (object.valueDetectedLanguages) { + if (!Array.isArray(object.valueDetectedLanguages)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.FormField.valueDetectedLanguages: object expected"); + message.valueDetectedLanguages[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.FormField.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.FormField + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout.toObject(message.fieldName, options); + if (message.fieldValue != null && message.hasOwnProperty("fieldValue")) + object.fieldValue = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.toObject(message.provenance, options); + return object; + }; + + /** + * Converts this FormField to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.FormField"; + }; + + return FormField; + })(); + + Page.DetectedBarcode = (function() { + + /** + * Properties of a DetectedBarcode. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @interface IDetectedBarcode + * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [layout] DetectedBarcode layout + * @property {google.cloud.documentai.v1beta3.IBarcode|null} [barcode] DetectedBarcode barcode + */ + + /** + * Constructs a new DetectedBarcode. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a DetectedBarcode. + * @implements IDetectedBarcode + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout + * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * @instance + */ + DetectedBarcode.prototype.layout = null; + + /** + * DetectedBarcode barcode. + * @member {google.cloud.documentai.v1beta3.IBarcode|null|undefined} barcode + * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * @instance + */ + DetectedBarcode.prototype.barcode = null; + + /** + * Creates a new DetectedBarcode instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedBarcode.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedBarcode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.decode(reader, reader.uint32()); + break; + } + case 2: { + message.barcode = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedBarcode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.verify(message.layout); + if (error) + return "layout." + error; + } + if (message.barcode != null && message.hasOwnProperty("barcode")) { + var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedBarcode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode} DetectedBarcode + */ + DetectedBarcode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode(); + if (object.layout != null) { + if (typeof object.layout !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.layout: object expected"); + message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); + } + if (object.barcode != null) { + if (typeof object.barcode !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.barcode: object expected"); + message.barcode = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedBarcode + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout.toObject(message.layout, options); + if (message.barcode != null && message.hasOwnProperty("barcode")) + object.barcode = $root.google.cloud.documentai.v1beta3.Barcode.toObject(message.barcode, options); + return object; + }; + + /** + * Converts this DetectedBarcode to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedBarcode"; + }; + + return DetectedBarcode; + })(); + + Page.DetectedLanguage = (function() { + + /** + * Properties of a DetectedLanguage. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @interface IDetectedLanguage + * @property {string|null} [languageCode] DetectedLanguage languageCode + * @property {number|null} [confidence] DetectedLanguage confidence + */ + + /** + * Constructs a new DetectedLanguage. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents a DetectedLanguage. + * @implements IDetectedLanguage + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.languageCode = ""; + + /** + * DetectedLanguage confidence. + * @member {number} confidence + * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage + * @instance + */ + DetectedLanguage.prototype.confidence = 0; + + /** + * Creates a new DetectedLanguage instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage} DetectedLanguage + */ + DetectedLanguage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedLanguage + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage"; + }; + + return DetectedLanguage; + })(); + + Page.ImageQualityScores = (function() { + + /** + * Properties of an ImageQualityScores. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @interface IImageQualityScores + * @property {number|null} [qualityScore] ImageQualityScores qualityScore + * @property {Array.|null} [detectedDefects] ImageQualityScores detectedDefects + */ + + /** + * Constructs a new ImageQualityScores. + * @memberof google.cloud.documentai.v1beta3.Document.Page + * @classdesc Represents an ImageQualityScores. + * @implements IImageQualityScores + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores + * @instance + */ + ImageQualityScores.prototype.qualityScore = 0; + + /** + * ImageQualityScores detectedDefects. + * @member {Array.} detectedDefects + * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores + * @instance + */ + ImageQualityScores.prototype.detectedDefects = $util.emptyArray; + + /** + * Creates a new ImageQualityScores instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores} ImageQualityScores + */ + ImageQualityScores.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.detectedDefects: object expected"); + message.detectedDefects[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect.toObject(message.detectedDefects[j], options); + } + return object; + }; + + /** + * Converts this ImageQualityScores to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores"; + }; + + ImageQualityScores.DetectedDefect = (function() { + + /** + * Properties of a DetectedDefect. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores + * @classdesc Represents a DetectedDefect. + * @implements IDetectedDefect + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect + * @instance + */ + DetectedDefect.prototype.type = ""; + + /** + * DetectedDefect confidence. + * @member {number} confidence + * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect + * @instance + */ + DetectedDefect.prototype.confidence = 0; + + /** + * Creates a new DetectedDefect instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.IDetectedDefect=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect + */ + DetectedDefect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect"; + }; + + return DetectedDefect; + })(); + + return ImageQualityScores; + })(); + + return Page; + })(); + + Document.Entity = (function() { + + /** + * Properties of an Entity. + * @memberof google.cloud.documentai.v1beta3.Document + * @interface IEntity + * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.IPageAnchor|null} [pageAnchor] Entity pageAnchor + * @property {string|null} [id] Entity id + * @property {google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue|null} [normalizedValue] Entity normalizedValue + * @property {Array.|null} [properties] Entity properties + * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] Entity provenance + * @property {boolean|null} [redacted] Entity redacted + * @property {google.cloud.documentai.v1beta3.Document.Entity.Method|null} [method] Entity method + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextAnchor|null|undefined} textAnchor + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @instance + */ + Entity.prototype.textAnchor = null; + + /** + * Entity type. + * @member {string} type + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @instance + */ + Entity.prototype.type = ""; + + /** + * Entity mentionText. + * @member {string} mentionText + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @instance + */ + Entity.prototype.mentionText = ""; + + /** + * Entity mentionId. + * @member {string} mentionId + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @instance + */ + Entity.prototype.mentionId = ""; + + /** + * Entity confidence. + * @member {number} confidence + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @instance + */ + Entity.prototype.confidence = 0; + + /** + * Entity pageAnchor. + * @member {google.cloud.documentai.v1beta3.Document.IPageAnchor|null|undefined} pageAnchor + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @instance + */ + Entity.prototype.pageAnchor = null; + + /** + * Entity id. + * @member {string} id + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @instance + */ + Entity.prototype.id = ""; + + /** + * Entity normalizedValue. + * @member {google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue|null|undefined} normalizedValue + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @instance + */ + Entity.prototype.normalizedValue = null; + + /** + * Entity properties. + * @member {Array.} properties + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @instance + */ + Entity.prototype.properties = $util.emptyArray; + + /** + * Entity provenance. + * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @instance + */ + Entity.prototype.provenance = null; + + /** + * Entity redacted. + * @member {boolean} redacted + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @instance + */ + Entity.prototype.redacted = false; + + /** + * Entity method. + * @member {google.cloud.documentai.v1beta3.Document.Entity.Method} method + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @instance + */ + Entity.prototype.method = 0; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @static + * @param {google.cloud.documentai.v1beta3.Document.IEntity=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Entity + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.decode(reader, reader.uint32()); + break; + } + case 7: { + message.id = reader.string(); + break; + } + case 9: { + message.normalizedValue = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.decode(reader, reader.uint32())); + break; + } + case 11: { + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Entity) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Entity(); + if (object.textAnchor != null) { + if (typeof object.textAnchor !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Entity.textAnchor: object expected"); + message.textAnchor = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.pageAnchor: object expected"); + message.pageAnchor = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.normalizedValue: object expected"); + message.normalizedValue = $root.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.fromObject(object.normalizedValue); + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.properties: object expected"); + message.properties[i] = $root.google.cloud.documentai.v1beta3.Document.Entity.fromObject(object.properties[i]); + } + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.Entity.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.toObject(message.properties[j], options); + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.Method[message.method] === undefined ? message.method : $root.google.cloud.documentai.v1beta3.Document.Entity.Method[message.method] : message.method; + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Entity"; + }; + + Entity.NormalizedValue = (function() { + + /** + * Properties of a NormalizedValue. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity + * @classdesc Represents a NormalizedValue. + * @implements INormalizedValue + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.moneyValue = null; + + /** + * NormalizedValue dateValue. + * @member {google.type.IDate|null|undefined} dateValue + * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.dateValue = null; + + /** + * NormalizedValue datetimeValue. + * @member {google.type.IDateTime|null|undefined} datetimeValue + * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.datetimeValue = null; + + /** + * NormalizedValue addressValue. + * @member {google.type.IPostalAddress|null|undefined} addressValue + * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.addressValue = null; + + /** + * NormalizedValue booleanValue. + * @member {boolean|null|undefined} booleanValue + * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.booleanValue = null; + + /** + * NormalizedValue integerValue. + * @member {number|null|undefined} integerValue + * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.integerValue = null; + + /** + * NormalizedValue floatValue. + * @member {number|null|undefined} floatValue + * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.floatValue = null; + + /** + * NormalizedValue signatureValue. + * @member {boolean|null|undefined} signatureValue + * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @instance + */ + NormalizedValue.prototype.signatureValue = null; + + /** + * NormalizedValue text. + * @member {string} text + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.NormalizedValue + * @static + * @param {google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.NormalizedValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.NormalizedValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.NormalizedValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.NormalizedValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue} NormalizedValue + */ + NormalizedValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue(); + if (object.moneyValue != null) { + if (typeof object.moneyValue !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.NormalizedValue + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.NormalizedValue"; + }; + + return NormalizedValue; + })(); + + /** + * Method enum. + * @name google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document + * @classdesc Represents an EntityRelation. + * @implements IEntityRelation + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityRelation + * @instance + */ + EntityRelation.prototype.subjectId = ""; + + /** + * EntityRelation objectId. + * @member {string} objectId + * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation + * @instance + */ + EntityRelation.prototype.objectId = ""; + + /** + * EntityRelation relation. + * @member {string} relation + * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation + * @instance + */ + EntityRelation.prototype.relation = ""; + + /** + * Creates a new EntityRelation instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation + * @static + * @param {google.cloud.documentai.v1beta3.Document.IEntityRelation=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityRelation.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityRelation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityRelation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.EntityRelation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.EntityRelation} EntityRelation + */ + EntityRelation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.EntityRelation) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityRelation + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityRelation"; + }; + + return EntityRelation; + })(); + + Document.TextAnchor = (function() { + + /** + * Properties of a TextAnchor. + * @memberof google.cloud.documentai.v1beta3.Document + * @interface ITextAnchor + * @property {Array.|null} [textSegments] TextAnchor textSegments + * @property {string|null} [content] TextAnchor content + */ + + /** + * Constructs a new TextAnchor. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents a TextAnchor. + * @implements ITextAnchor + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor + * @instance + */ + TextAnchor.prototype.textSegments = $util.emptyArray; + + /** + * TextAnchor content. + * @member {string} content + * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * @instance + */ + TextAnchor.prototype.content = ""; + + /** + * Creates a new TextAnchor instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * @static + * @param {google.cloud.documentai.v1beta3.Document.ITextAnchor=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.TextAnchor} TextAnchor + */ + TextAnchor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.TextAnchor) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.TextAnchor(); + if (object.textSegments) { + if (!Array.isArray(object.textSegments)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor.textSegments: object expected"); + message.textSegments[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor"; + }; + + TextAnchor.TextSegment = (function() { + + /** + * Properties of a TextSegment. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor + * @classdesc Represents a TextSegment. + * @implements ITextSegment + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment + * @static + * @param {google.cloud.documentai.v1beta3.Document.TextAnchor.ITextSegment=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment} TextSegment + */ + TextSegment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment"; + }; + + return TextSegment; + })(); + + return TextAnchor; + })(); + + Document.PageAnchor = (function() { + + /** + * Properties of a PageAnchor. + * @memberof google.cloud.documentai.v1beta3.Document + * @interface IPageAnchor + * @property {Array.|null} [pageRefs] PageAnchor pageRefs + */ + + /** + * Constructs a new PageAnchor. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents a PageAnchor. + * @implements IPageAnchor + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor + * @instance + */ + PageAnchor.prototype.pageRefs = $util.emptyArray; + + /** + * Creates a new PageAnchor instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor + * @static + * @param {google.cloud.documentai.v1beta3.Document.IPageAnchor=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.PageAnchor} PageAnchor + */ + PageAnchor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.PageAnchor) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.PageAnchor(); + if (object.pageRefs) { + if (!Array.isArray(object.pageRefs)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.pageRefs: object expected"); + message.pageRefs[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.PageRef.toObject(message.pageRefs[j], options); + } + return object; + }; + + /** + * Converts this PageAnchor to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor"; + }; + + PageAnchor.PageRef = (function() { + + /** + * Properties of a PageRef. + * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor + * @interface IPageRef + * @property {number|Long|null} [page] PageRef page + * @property {google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType|null} [layoutType] PageRef layoutType + * @property {string|null} [layoutId] PageRef layoutId + * @property {google.cloud.documentai.v1beta3.IBoundingPoly|null} [boundingPoly] PageRef boundingPoly + * @property {number|null} [confidence] PageRef confidence + */ + + /** + * Constructs a new PageRef. + * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor + * @classdesc Represents a PageRef. + * @implements IPageRef + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.PageRef + * @instance + */ + PageRef.prototype.page = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PageRef layoutType. + * @member {google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType} layoutType + * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @instance + */ + PageRef.prototype.layoutType = 0; + + /** + * PageRef layoutId. + * @member {string} layoutId + * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @instance + */ + PageRef.prototype.layoutId = ""; + + /** + * PageRef boundingPoly. + * @member {google.cloud.documentai.v1beta3.IBoundingPoly|null|undefined} boundingPoly + * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @instance + */ + PageRef.prototype.boundingPoly = null; + + /** + * PageRef confidence. + * @member {number} confidence + * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @instance + */ + PageRef.prototype.confidence = 0; + + /** + * Creates a new PageRef instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @static + * @param {google.cloud.documentai.v1beta3.Document.PageAnchor.IPageRef=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.PageRef.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.PageRef.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.PageRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.PageRef + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef} PageRef + */ + PageRef.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.PageRef.boundingPoly: object expected"); + message.boundingPoly = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.PageRef + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.PageRef.LayoutType[message.layoutType] === undefined ? message.layoutType : $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.PageRef"; + }; + + /** + * LayoutType enum. + * @name google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.OperationType|null} [type] Provenance type + */ + + /** + * Constructs a new Provenance. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents a Provenance. + * @implements IProvenance + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance + * @instance + */ + Provenance.prototype.revision = 0; + + /** + * Provenance id. + * @member {number} id + * @memberof google.cloud.documentai.v1beta3.Document.Provenance + * @instance + */ + Provenance.prototype.id = 0; + + /** + * Provenance parents. + * @member {Array.} parents + * @memberof google.cloud.documentai.v1beta3.Document.Provenance + * @instance + */ + Provenance.prototype.parents = $util.emptyArray; + + /** + * Provenance type. + * @member {google.cloud.documentai.v1beta3.Document.Provenance.OperationType} type + * @memberof google.cloud.documentai.v1beta3.Document.Provenance + * @instance + */ + Provenance.prototype.type = 0; + + /** + * Creates a new Provenance instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Provenance + * @static + * @param {google.cloud.documentai.v1beta3.Document.IProvenance=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Provenance + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Provenance + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Provenance} Provenance + */ + Provenance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Provenance) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.parents: object expected"); + message.parents[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.Parent.toObject(message.parents[j], options); + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.documentai.v1beta3.Document.Provenance.OperationType[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1beta3.Document.Provenance.OperationType[message.type] : message.type; + return object; + }; + + /** + * Converts this Provenance to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance"; + }; + + Provenance.Parent = (function() { + + /** + * Properties of a Parent. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance + * @classdesc Represents a Parent. + * @implements IParent + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.Parent + * @instance + */ + Parent.prototype.revision = 0; + + /** + * Parent index. + * @member {number} index + * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @instance + */ + Parent.prototype.index = 0; + + /** + * Parent id. + * @member {number} id + * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @instance + */ + Parent.prototype.id = 0; + + /** + * Creates a new Parent instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @static + * @param {google.cloud.documentai.v1beta3.Document.Provenance.IParent=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.Parent.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.Parent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.Parent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.Parent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Provenance.Parent} Parent + */ + Parent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Provenance.Parent) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.Parent + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.Parent"; + }; + + return Parent; + })(); + + /** + * OperationType enum. + * @name google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.IHumanReview|null} [humanReview] Revision humanReview + */ + + /** + * Constructs a new Revision. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents a Revision. + * @implements IRevision + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision + * @instance + */ + Revision.prototype.agent = null; + + /** + * Revision processor. + * @member {string|null|undefined} processor + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @instance + */ + Revision.prototype.processor = null; + + /** + * Revision id. + * @member {string} id + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @instance + */ + Revision.prototype.id = ""; + + /** + * Revision parent. + * @member {Array.} parent + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @instance + */ + Revision.prototype.parent = $util.emptyArray; + + /** + * Revision parentIds. + * @member {Array.} parentIds + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @instance + */ + Revision.prototype.parentIds = $util.emptyArray; + + /** + * Revision createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @instance + */ + Revision.prototype.createTime = null; + + /** + * Revision humanReview. + * @member {google.cloud.documentai.v1beta3.Document.Revision.IHumanReview|null|undefined} humanReview + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Revision + * @static + * @param {google.cloud.documentai.v1beta3.Document.IRevision=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Revision} Revision + */ + Revision.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Revision) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.humanReview: object expected"); + message.humanReview = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision"; + }; + + Revision.HumanReview = (function() { + + /** + * Properties of a HumanReview. + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @interface IHumanReview + * @property {string|null} [state] HumanReview state + * @property {string|null} [stateMessage] HumanReview stateMessage + */ + + /** + * Constructs a new HumanReview. + * @memberof google.cloud.documentai.v1beta3.Document.Revision + * @classdesc Represents a HumanReview. + * @implements IHumanReview + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.HumanReview + * @instance + */ + HumanReview.prototype.state = ""; + + /** + * HumanReview stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @instance + */ + HumanReview.prototype.stateMessage = ""; + + /** + * Creates a new HumanReview instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @static + * @param {google.cloud.documentai.v1beta3.Document.Revision.IHumanReview=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.HumanReview.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.HumanReview.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.HumanReview + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.HumanReview + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Revision.HumanReview} HumanReview + */ + HumanReview.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Revision.HumanReview) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.HumanReview + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.HumanReview"; + }; + + return HumanReview; + })(); + + return Revision; + })(); + + Document.TextChange = (function() { + + /** + * Properties of a TextChange. + * @memberof google.cloud.documentai.v1beta3.Document + * @interface ITextChange + * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document + * @classdesc Represents a TextChange. + * @implements ITextChange + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextAnchor|null|undefined} textAnchor + * @memberof google.cloud.documentai.v1beta3.Document.TextChange + * @instance + */ + TextChange.prototype.textAnchor = null; + + /** + * TextChange changedText. + * @member {string} changedText + * @memberof google.cloud.documentai.v1beta3.Document.TextChange + * @instance + */ + TextChange.prototype.changedText = ""; + + /** + * TextChange provenance. + * @member {Array.} provenance + * @memberof google.cloud.documentai.v1beta3.Document.TextChange + * @instance + */ + TextChange.prototype.provenance = $util.emptyArray; + + /** + * Creates a new TextChange instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.TextChange + * @static + * @param {google.cloud.documentai.v1beta3.Document.ITextChange=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.TextChange.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.TextChange + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextChange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.TextChange + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextChange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.TextChange} TextChange + */ + TextChange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.TextChange) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.TextChange(); + if (object.textAnchor != null) { + if (typeof object.textAnchor !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.TextChange.textAnchor: object expected"); + message.textAnchor = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.TextChange.provenance: object expected"); + message.provenance[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.TextChange + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.toObject(message.provenance[j], options); + } + return object; + }; + + /** + * Converts this TextChange to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.TextChange"; + }; + + return TextChange; + })(); + + Document.Annotations = (function() { + + /** + * Properties of an Annotations. + * @memberof google.cloud.documentai.v1beta3.Document + * @interface IAnnotations + * @property {string|null} [description] Annotations description + */ + + /** + * Constructs a new Annotations. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents an Annotations. + * @implements IAnnotations + * @constructor + * @param {google.cloud.documentai.v1beta3.Document.IAnnotations=} [properties] Properties to set + */ + function Annotations(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotations description. + * @member {string} description + * @memberof google.cloud.documentai.v1beta3.Document.Annotations + * @instance + */ + Annotations.prototype.description = ""; + + /** + * Creates a new Annotations instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.Annotations + * @static + * @param {google.cloud.documentai.v1beta3.Document.IAnnotations=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.Annotations} Annotations instance + */ + Annotations.create = function create(properties) { + return new Annotations(properties); + }; + + /** + * Encodes the specified Annotations message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Annotations.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.Annotations + * @static + * @param {google.cloud.documentai.v1beta3.Document.IAnnotations} message Annotations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotations.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); + return writer; + }; + + /** + * Encodes the specified Annotations message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Annotations.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Annotations + * @static + * @param {google.cloud.documentai.v1beta3.Document.IAnnotations} message Annotations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotations message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Document.Annotations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Document.Annotations} Annotations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotations.decode = function decode(reader, 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.v1beta3.Document.Annotations(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.Annotations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Document.Annotations} Annotations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotations message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Document.Annotations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotations.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"; + return null; + }; + + /** + * Creates an Annotations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Document.Annotations + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.Annotations} Annotations + */ + Annotations.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Annotations) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.Annotations(); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an Annotations message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Document.Annotations + * @static + * @param {google.cloud.documentai.v1beta3.Document.Annotations} message Annotations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.description = ""; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Annotations to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Document.Annotations + * @instance + * @returns {Object.} JSON object + */ + Annotations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotations + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Document.Annotations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Annotations"; + }; + + return Annotations; + })(); + + Document.DocumentLayout = (function() { + + /** + * Properties of a DocumentLayout. + * @memberof google.cloud.documentai.v1beta3.Document + * @interface IDocumentLayout + * @property {Array.|null} [blocks] DocumentLayout blocks + */ + + /** + * Constructs a new DocumentLayout. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents a DocumentLayout. + * @implements IDocumentLayout + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout + * @instance + */ + DocumentLayout.prototype.blocks = $util.emptyArray; + + /** + * Creates a new DocumentLayout instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout + * @static + * @param {google.cloud.documentai.v1beta3.Document.IDocumentLayout=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout} DocumentLayout + */ + DocumentLayout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout(); + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.blocks: object expected"); + message.blocks[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); + } + return object; + }; + + /** + * Converts this DocumentLayout to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout"; + }; + + DocumentLayout.DocumentLayoutBlock = (function() { + + /** + * Properties of a DocumentLayoutBlock. + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout + * @interface IDocumentLayoutBlock + * @property {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null} [textBlock] DocumentLayoutBlock textBlock + * @property {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null} [tableBlock] DocumentLayoutBlock tableBlock + * @property {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null} [listBlock] DocumentLayoutBlock listBlock + * @property {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock|null} [imageBlock] DocumentLayoutBlock imageBlock + * @property {string|null} [blockId] DocumentLayoutBlock blockId + * @property {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null} [pageSpan] DocumentLayoutBlock pageSpan + * @property {google.cloud.documentai.v1beta3.IBoundingPoly|null} [boundingBox] DocumentLayoutBlock boundingBox + */ + + /** + * Constructs a new DocumentLayoutBlock. + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout + * @classdesc Represents a DocumentLayoutBlock. + * @implements IDocumentLayoutBlock + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null|undefined} textBlock + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + DocumentLayoutBlock.prototype.textBlock = null; + + /** + * DocumentLayoutBlock tableBlock. + * @member {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null|undefined} tableBlock + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + DocumentLayoutBlock.prototype.tableBlock = null; + + /** + * DocumentLayoutBlock listBlock. + * @member {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null|undefined} listBlock + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + DocumentLayoutBlock.prototype.listBlock = null; + + /** + * DocumentLayoutBlock imageBlock. + * @member {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock|null|undefined} imageBlock + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + DocumentLayoutBlock.prototype.imageBlock = null; + + /** + * DocumentLayoutBlock blockId. + * @member {string} blockId + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + DocumentLayoutBlock.prototype.blockId = ""; + + /** + * DocumentLayoutBlock pageSpan. + * @member {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null|undefined} pageSpan + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + DocumentLayoutBlock.prototype.pageSpan = null; + + /** + * DocumentLayoutBlock boundingBox. + * @member {google.cloud.documentai.v1beta3.IBoundingPoly|null|undefined} boundingBox + * @memberof google.cloud.documentai.v1beta3.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"|"imageBlock"|undefined} block + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @instance + */ + Object.defineProperty(DocumentLayoutBlock.prototype, "block", { + get: $util.oneOfGetter($oneOfFields = ["textBlock", "tableBlock", "listBlock", "imageBlock"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DocumentLayoutBlock instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.IDocumentLayoutBlock=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.imageBlock != null && Object.hasOwnProperty.call(message, "imageBlock")) + $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.encode(message.imageBlock, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentLayoutBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.decode(reader, reader.uint32()); + break; + } + case 3: { + message.tableBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.decode(reader, reader.uint32()); + break; + } + case 4: { + message.listBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.decode(reader, reader.uint32()); + break; + } + case 7: { + message.imageBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.decode(reader, reader.uint32()); + break; + } + case 1: { + message.blockId = reader.string(); + break; + } + case 5: { + message.pageSpan = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.decode(reader, reader.uint32()); + break; + } + case 6: { + message.boundingBox = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify(message.listBlock); + if (error) + return "listBlock." + error; + } + } + if (message.imageBlock != null && message.hasOwnProperty("imageBlock")) { + if (properties.block === 1) + return "block: multiple values"; + properties.block = 1; + { + var error = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.verify(message.imageBlock); + if (error) + return "imageBlock." + 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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock} DocumentLayoutBlock + */ + DocumentLayoutBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock(); + if (object.textBlock != null) { + if (typeof object.textBlock !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.textBlock: object expected"); + message.textBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.fromObject(object.textBlock); + } + if (object.tableBlock != null) { + if (typeof object.tableBlock !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.tableBlock: object expected"); + message.tableBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.fromObject(object.tableBlock); + } + if (object.listBlock != null) { + if (typeof object.listBlock !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.listBlock: object expected"); + message.listBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.fromObject(object.listBlock); + } + if (object.imageBlock != null) { + if (typeof object.imageBlock !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.imageBlock: object expected"); + message.imageBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.fromObject(object.imageBlock); + } + if (object.blockId != null) + message.blockId = String(object.blockId); + if (object.pageSpan != null) { + if (typeof object.pageSpan !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.pageSpan: object expected"); + message.pageSpan = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.fromObject(object.pageSpan); + } + if (object.boundingBox != null) { + if (typeof object.boundingBox !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.boundingBox: object expected"); + message.boundingBox = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.toObject(message.pageSpan, options); + if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) + object.boundingBox = $root.google.cloud.documentai.v1beta3.BoundingPoly.toObject(message.boundingBox, options); + if (message.imageBlock != null && message.hasOwnProperty("imageBlock")) { + object.imageBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.toObject(message.imageBlock, options); + if (options.oneofs) + object.block = "imageBlock"; + } + return object; + }; + + /** + * Converts this DocumentLayoutBlock to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock"; + }; + + DocumentLayoutBlock.LayoutPageSpan = (function() { + + /** + * Properties of a LayoutPageSpan. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutPageSpan. + * @implements ILayoutPageSpan + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @instance + */ + LayoutPageSpan.prototype.pageStart = 0; + + /** + * LayoutPageSpan pageEnd. + * @member {number} pageEnd + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @instance + */ + LayoutPageSpan.prototype.pageEnd = 0; + + /** + * Creates a new LayoutPageSpan instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan} LayoutPageSpan + */ + LayoutPageSpan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan"; + }; + + return LayoutPageSpan; + })(); + + DocumentLayoutBlock.LayoutTextBlock = (function() { + + /** + * Properties of a LayoutTextBlock. + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @interface ILayoutTextBlock + * @property {string|null} [text] LayoutTextBlock text + * @property {string|null} [type] LayoutTextBlock type + * @property {Array.|null} [blocks] LayoutTextBlock blocks + * @property {google.cloud.documentai.v1beta3.Document.IAnnotations|null} [annotations] LayoutTextBlock annotations + */ + + /** + * Constructs a new LayoutTextBlock. + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutTextBlock. + * @implements ILayoutTextBlock + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @instance + */ + LayoutTextBlock.prototype.text = ""; + + /** + * LayoutTextBlock type. + * @member {string} type + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @instance + */ + LayoutTextBlock.prototype.type = ""; + + /** + * LayoutTextBlock blocks. + * @member {Array.} blocks + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @instance + */ + LayoutTextBlock.prototype.blocks = $util.emptyArray; + + /** + * LayoutTextBlock annotations. + * @member {google.cloud.documentai.v1beta3.Document.IAnnotations|null|undefined} annotations + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @instance + */ + LayoutTextBlock.prototype.annotations = null; + + /** + * Creates a new LayoutTextBlock instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.encode(message.blocks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + $root.google.cloud.documentai.v1beta3.Document.Annotations.encode(message.annotations, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LayoutTextBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.decode(reader, reader.uint32())); + break; + } + case 4: { + message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.verify(message.blocks[i]); + if (error) + return "blocks." + error; + } + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + var error = $root.google.cloud.documentai.v1beta3.Document.Annotations.verify(message.annotations); + if (error) + return "annotations." + 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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock} LayoutTextBlock + */ + LayoutTextBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.blocks: object expected"); + message.blocks[i] = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.fromObject(object.blocks[i]); + } + } + if (object.annotations != null) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.annotations: object expected"); + message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.fromObject(object.annotations); + } + return message; + }; + + /** + * Creates a plain object from a LayoutTextBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock + * @static + * @param {google.cloud.documentai.v1beta3.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 = ""; + object.annotations = null; + } + 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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); + } + if (message.annotations != null && message.hasOwnProperty("annotations")) + object.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.toObject(message.annotations, options); + return object; + }; + + /** + * Converts this LayoutTextBlock to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock"; + }; + + return LayoutTextBlock; + })(); + + DocumentLayoutBlock.LayoutTableBlock = (function() { + + /** + * Properties of a LayoutTableBlock. + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @interface ILayoutTableBlock + * @property {Array.|null} [headerRows] LayoutTableBlock headerRows + * @property {Array.|null} [bodyRows] LayoutTableBlock bodyRows + * @property {string|null} [caption] LayoutTableBlock caption + * @property {google.cloud.documentai.v1beta3.Document.IAnnotations|null} [annotations] LayoutTableBlock annotations + */ + + /** + * Constructs a new LayoutTableBlock. + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutTableBlock. + * @implements ILayoutTableBlock + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @instance + */ + LayoutTableBlock.prototype.headerRows = $util.emptyArray; + + /** + * LayoutTableBlock bodyRows. + * @member {Array.} bodyRows + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @instance + */ + LayoutTableBlock.prototype.bodyRows = $util.emptyArray; + + /** + * LayoutTableBlock caption. + * @member {string} caption + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @instance + */ + LayoutTableBlock.prototype.caption = ""; + + /** + * LayoutTableBlock annotations. + * @member {google.cloud.documentai.v1beta3.Document.IAnnotations|null|undefined} annotations + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @instance + */ + LayoutTableBlock.prototype.annotations = null; + + /** + * Creates a new LayoutTableBlock instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + $root.google.cloud.documentai.v1beta3.Document.Annotations.encode(message.annotations, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LayoutTableBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.decode(reader, reader.uint32())); + break; + } + case 3: { + message.caption = reader.string(); + break; + } + case 4: { + message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.decode(reader, reader.uint32()); + 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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + var error = $root.google.cloud.documentai.v1beta3.Document.Annotations.verify(message.annotations); + if (error) + return "annotations." + error; + } + return null; + }; + + /** + * Creates a LayoutTableBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock} LayoutTableBlock + */ + LayoutTableBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock(); + if (object.headerRows) { + if (!Array.isArray(object.headerRows)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.headerRows: object expected"); + message.headerRows[i] = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.fromObject(object.headerRows[i]); + } + } + if (object.bodyRows) { + if (!Array.isArray(object.bodyRows)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.bodyRows: object expected"); + message.bodyRows[i] = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.fromObject(object.bodyRows[i]); + } + } + if (object.caption != null) + message.caption = String(object.caption); + if (object.annotations != null) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.annotations: object expected"); + message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.fromObject(object.annotations); + } + return message; + }; + + /** + * Creates a plain object from a LayoutTableBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock + * @static + * @param {google.cloud.documentai.v1beta3.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 = ""; + object.annotations = null; + } + if (message.headerRows && message.headerRows.length) { + object.headerRows = []; + for (var j = 0; j < message.headerRows.length; ++j) + object.headerRows[j] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.toObject(message.bodyRows[j], options); + } + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.annotations != null && message.hasOwnProperty("annotations")) + object.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.toObject(message.annotations, options); + return object; + }; + + /** + * Converts this LayoutTableBlock to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock"; + }; + + return LayoutTableBlock; + })(); + + DocumentLayoutBlock.LayoutTableRow = (function() { + + /** + * Properties of a LayoutTableRow. + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @interface ILayoutTableRow + * @property {Array.|null} [cells] LayoutTableRow cells + */ + + /** + * Constructs a new LayoutTableRow. + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutTableRow. + * @implements ILayoutTableRow + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow} LayoutTableRow + */ + LayoutTableRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow(); + if (object.cells) { + if (!Array.isArray(object.cells)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.cells: object expected"); + message.cells[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.toObject(message.cells[j], options); + } + return object; + }; + + /** + * Converts this LayoutTableRow to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow"; + }; + + return LayoutTableRow; + })(); + + DocumentLayoutBlock.LayoutTableCell = (function() { + + /** + * Properties of a LayoutTableCell. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutTableCell. + * @implements ILayoutTableCell + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @instance + */ + LayoutTableCell.prototype.blocks = $util.emptyArray; + + /** + * LayoutTableCell rowSpan. + * @member {number} rowSpan + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @instance + */ + LayoutTableCell.prototype.rowSpan = 0; + + /** + * LayoutTableCell colSpan. + * @member {number} colSpan + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @instance + */ + LayoutTableCell.prototype.colSpan = 0; + + /** + * Creates a new LayoutTableCell instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell} LayoutTableCell + */ + LayoutTableCell.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell(); + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.blocks: object expected"); + message.blocks[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell"; + }; + + return LayoutTableCell; + })(); + + DocumentLayoutBlock.LayoutListBlock = (function() { + + /** + * Properties of a LayoutListBlock. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutListBlock. + * @implements ILayoutListBlock + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @instance + */ + LayoutListBlock.prototype.listEntries = $util.emptyArray; + + /** + * LayoutListBlock type. + * @member {string} type + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @instance + */ + LayoutListBlock.prototype.type = ""; + + /** + * Creates a new LayoutListBlock instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock} LayoutListBlock + */ + LayoutListBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock(); + if (object.listEntries) { + if (!Array.isArray(object.listEntries)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.listEntries: object expected"); + message.listEntries[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock"; + }; + + return LayoutListBlock; + })(); + + DocumentLayoutBlock.LayoutListEntry = (function() { + + /** + * Properties of a LayoutListEntry. + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @interface ILayoutListEntry + * @property {Array.|null} [blocks] LayoutListEntry blocks + */ + + /** + * Constructs a new LayoutListEntry. + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutListEntry. + * @implements ILayoutListEntry + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry} LayoutListEntry + */ + LayoutListEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry(); + if (object.blocks) { + if (!Array.isArray(object.blocks)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.blocks: object expected"); + message.blocks[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); + } + return object; + }; + + /** + * Converts this LayoutListEntry to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry"; + }; + + return LayoutListEntry; + })(); + + DocumentLayoutBlock.LayoutImageBlock = (function() { + + /** + * Properties of a LayoutImageBlock. + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @interface ILayoutImageBlock + * @property {string|null} [blobAssetId] LayoutImageBlock blobAssetId + * @property {string|null} [gcsUri] LayoutImageBlock gcsUri + * @property {string|null} [dataUri] LayoutImageBlock dataUri + * @property {string|null} [mimeType] LayoutImageBlock mimeType + * @property {string|null} [imageText] LayoutImageBlock imageText + * @property {google.cloud.documentai.v1beta3.Document.IAnnotations|null} [annotations] LayoutImageBlock annotations + */ + + /** + * Constructs a new LayoutImageBlock. + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock + * @classdesc Represents a LayoutImageBlock. + * @implements ILayoutImageBlock + * @constructor + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock=} [properties] Properties to set + */ + function LayoutImageBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LayoutImageBlock blobAssetId. + * @member {string|null|undefined} blobAssetId + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @instance + */ + LayoutImageBlock.prototype.blobAssetId = null; + + /** + * LayoutImageBlock gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @instance + */ + LayoutImageBlock.prototype.gcsUri = null; + + /** + * LayoutImageBlock dataUri. + * @member {string|null|undefined} dataUri + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @instance + */ + LayoutImageBlock.prototype.dataUri = null; + + /** + * LayoutImageBlock mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @instance + */ + LayoutImageBlock.prototype.mimeType = ""; + + /** + * LayoutImageBlock imageText. + * @member {string} imageText + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @instance + */ + LayoutImageBlock.prototype.imageText = ""; + + /** + * LayoutImageBlock annotations. + * @member {google.cloud.documentai.v1beta3.Document.IAnnotations|null|undefined} annotations + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @instance + */ + LayoutImageBlock.prototype.annotations = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LayoutImageBlock imageSource. + * @member {"blobAssetId"|"gcsUri"|"dataUri"|undefined} imageSource + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @instance + */ + Object.defineProperty(LayoutImageBlock.prototype, "imageSource", { + get: $util.oneOfGetter($oneOfFields = ["blobAssetId", "gcsUri", "dataUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LayoutImageBlock instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @static + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock} LayoutImageBlock instance + */ + LayoutImageBlock.create = function create(properties) { + return new LayoutImageBlock(properties); + }; + + /** + * Encodes the specified LayoutImageBlock message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @static + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock} message LayoutImageBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutImageBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.imageText != null && Object.hasOwnProperty.call(message, "imageText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageText); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + $root.google.cloud.documentai.v1beta3.Document.Annotations.encode(message.annotations, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.blobAssetId != null && Object.hasOwnProperty.call(message, "blobAssetId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.blobAssetId); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.gcsUri); + if (message.dataUri != null && Object.hasOwnProperty.call(message, "dataUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.dataUri); + return writer; + }; + + /** + * Encodes the specified LayoutImageBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @static + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock} message LayoutImageBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutImageBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LayoutImageBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock} LayoutImageBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutImageBlock.decode = function decode(reader, 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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.blobAssetId = reader.string(); + break; + } + case 5: { + message.gcsUri = reader.string(); + break; + } + case 6: { + message.dataUri = reader.string(); + break; + } + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.imageText = reader.string(); + break; + } + case 3: { + message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LayoutImageBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock} LayoutImageBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutImageBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LayoutImageBlock message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LayoutImageBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.blobAssetId != null && message.hasOwnProperty("blobAssetId")) { + properties.imageSource = 1; + if (!$util.isString(message.blobAssetId)) + return "blobAssetId: string expected"; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + if (properties.imageSource === 1) + return "imageSource: multiple values"; + properties.imageSource = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.dataUri != null && message.hasOwnProperty("dataUri")) { + if (properties.imageSource === 1) + return "imageSource: multiple values"; + properties.imageSource = 1; + if (!$util.isString(message.dataUri)) + return "dataUri: string expected"; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.imageText != null && message.hasOwnProperty("imageText")) + if (!$util.isString(message.imageText)) + return "imageText: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + var error = $root.google.cloud.documentai.v1beta3.Document.Annotations.verify(message.annotations); + if (error) + return "annotations." + error; + } + return null; + }; + + /** + * Creates a LayoutImageBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock} LayoutImageBlock + */ + LayoutImageBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock(); + if (object.blobAssetId != null) + message.blobAssetId = String(object.blobAssetId); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.dataUri != null) + message.dataUri = String(object.dataUri); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.imageText != null) + message.imageText = String(object.imageText); + if (object.annotations != null) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.annotations: object expected"); + message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.fromObject(object.annotations); + } + return message; + }; + + /** + * Creates a plain object from a LayoutImageBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @static + * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock} message LayoutImageBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LayoutImageBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mimeType = ""; + object.imageText = ""; + object.annotations = null; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.imageText != null && message.hasOwnProperty("imageText")) + object.imageText = message.imageText; + if (message.annotations != null && message.hasOwnProperty("annotations")) + object.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.toObject(message.annotations, options); + if (message.blobAssetId != null && message.hasOwnProperty("blobAssetId")) { + object.blobAssetId = message.blobAssetId; + if (options.oneofs) + object.imageSource = "blobAssetId"; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.imageSource = "gcsUri"; + } + if (message.dataUri != null && message.hasOwnProperty("dataUri")) { + object.dataUri = message.dataUri; + if (options.oneofs) + object.imageSource = "dataUri"; + } + return object; + }; + + /** + * Converts this LayoutImageBlock to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @instance + * @returns {Object.} JSON object + */ + LayoutImageBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LayoutImageBlock + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LayoutImageBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock"; + }; + + return LayoutImageBlock; + })(); + + return DocumentLayoutBlock; + })(); + + return DocumentLayout; + })(); + + Document.ChunkedDocument = (function() { + + /** + * Properties of a ChunkedDocument. + * @memberof google.cloud.documentai.v1beta3.Document + * @interface IChunkedDocument + * @property {Array.|null} [chunks] ChunkedDocument chunks + */ + + /** + * Constructs a new ChunkedDocument. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents a ChunkedDocument. + * @implements IChunkedDocument + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument + * @instance + */ + ChunkedDocument.prototype.chunks = $util.emptyArray; + + /** + * Creates a new ChunkedDocument instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument + * @static + * @param {google.cloud.documentai.v1beta3.Document.IChunkedDocument=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument} ChunkedDocument + */ + ChunkedDocument.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument(); + if (object.chunks) { + if (!Array.isArray(object.chunks)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.chunks: object expected"); + message.chunks[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.toObject(message.chunks[j], options); + } + return object; + }; + + /** + * Converts this ChunkedDocument to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument"; + }; + + ChunkedDocument.Chunk = (function() { + + /** + * Properties of a Chunk. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null} [pageSpan] Chunk pageSpan + * @property {Array.|null} [pageHeaders] Chunk pageHeaders + * @property {Array.|null} [pageFooters] Chunk pageFooters + * @property {Array.|null} [chunkFields] Chunk chunkFields + */ + + /** + * Constructs a new Chunk. + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument + * @classdesc Represents a Chunk. + * @implements IChunk + * @constructor + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.IChunk=} [properties] Properties to set + */ + function Chunk(properties) { + this.sourceBlockIds = []; + this.pageHeaders = []; + this.pageFooters = []; + this.chunkFields = []; + if (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.v1beta3.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.chunkId = ""; + + /** + * Chunk sourceBlockIds. + * @member {Array.} sourceBlockIds + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.sourceBlockIds = $util.emptyArray; + + /** + * Chunk content. + * @member {string} content + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.content = ""; + + /** + * Chunk pageSpan. + * @member {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null|undefined} pageSpan + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.pageSpan = null; + + /** + * Chunk pageHeaders. + * @member {Array.} pageHeaders + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.pageHeaders = $util.emptyArray; + + /** + * Chunk pageFooters. + * @member {Array.} pageFooters + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.pageFooters = $util.emptyArray; + + /** + * Chunk chunkFields. + * @member {Array.} chunkFields + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @instance + */ + Chunk.prototype.chunkFields = $util.emptyArray; + + /** + * Creates a new Chunk instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.IChunk=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.encode(message.pageFooters[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.chunkFields != null && message.chunkFields.length) + for (var i = 0; i < message.chunkFields.length; ++i) + $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.encode(message.chunkFields[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.chunkFields && message.chunkFields.length)) + message.chunkFields = []; + message.chunkFields.push($root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.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.v1beta3.Document.ChunkedDocument.Chunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify(message.pageFooters[i]); + if (error) + return "pageFooters." + error; + } + } + if (message.chunkFields != null && message.hasOwnProperty("chunkFields")) { + if (!Array.isArray(message.chunkFields)) + return "chunkFields: array expected"; + for (var i = 0; i < message.chunkFields.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.verify(message.chunkFields[i]); + if (error) + return "chunkFields." + 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.v1beta3.Document.ChunkedDocument.Chunk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk} Chunk + */ + Chunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.pageSpan: object expected"); + message.pageSpan = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan.fromObject(object.pageSpan); + } + if (object.pageHeaders) { + if (!Array.isArray(object.pageHeaders)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.pageHeaders: object expected"); + message.pageHeaders[i] = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader.fromObject(object.pageHeaders[i]); + } + } + if (object.pageFooters) { + if (!Array.isArray(object.pageFooters)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.pageFooters: object expected"); + message.pageFooters[i] = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.fromObject(object.pageFooters[i]); + } + } + if (object.chunkFields) { + if (!Array.isArray(object.chunkFields)) + throw TypeError(".google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.chunkFields: array expected"); + message.chunkFields = []; + for (var i = 0; i < object.chunkFields.length; ++i) { + if (typeof object.chunkFields[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.chunkFields: object expected"); + message.chunkFields[i] = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.fromObject(object.chunkFields[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.v1beta3.Document.ChunkedDocument.Chunk + * @static + * @param {google.cloud.documentai.v1beta3.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 = []; + object.chunkFields = []; + } + 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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.toObject(message.pageFooters[j], options); + } + if (message.chunkFields && message.chunkFields.length) { + object.chunkFields = []; + for (var j = 0; j < message.chunkFields.length; ++j) + object.chunkFields[j] = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.toObject(message.chunkFields[j], options); + } + return object; + }; + + /** + * Converts this Chunk to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk"; + }; + + Chunk.ChunkPageSpan = (function() { + + /** + * Properties of a ChunkPageSpan. + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk + * @classdesc Represents a ChunkPageSpan. + * @implements IChunkPageSpan + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @instance + */ + ChunkPageSpan.prototype.pageStart = 0; + + /** + * ChunkPageSpan pageEnd. + * @member {number} pageEnd + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @instance + */ + ChunkPageSpan.prototype.pageEnd = 0; + + /** + * Creates a new ChunkPageSpan instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan} ChunkPageSpan + */ + ChunkPageSpan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan"; + }; + + return ChunkPageSpan; + })(); + + Chunk.ChunkPageHeader = (function() { + + /** + * Properties of a ChunkPageHeader. + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @interface IChunkPageHeader + * @property {string|null} [text] ChunkPageHeader text + * @property {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null} [pageSpan] ChunkPageHeader pageSpan + */ + + /** + * Constructs a new ChunkPageHeader. + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @classdesc Represents a ChunkPageHeader. + * @implements IChunkPageHeader + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @instance + */ + ChunkPageHeader.prototype.text = ""; + + /** + * ChunkPageHeader pageSpan. + * @member {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null|undefined} pageSpan + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @instance + */ + ChunkPageHeader.prototype.pageSpan = null; + + /** + * Creates a new ChunkPageHeader instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageHeader=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader} ChunkPageHeader + */ + ChunkPageHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader.pageSpan: object expected"); + message.pageSpan = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan.toObject(message.pageSpan, options); + return object; + }; + + /** + * Converts this ChunkPageHeader to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader"; + }; + + return ChunkPageHeader; + })(); + + Chunk.ChunkPageFooter = (function() { + + /** + * Properties of a ChunkPageFooter. + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @interface IChunkPageFooter + * @property {string|null} [text] ChunkPageFooter text + * @property {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null} [pageSpan] ChunkPageFooter pageSpan + */ + + /** + * Constructs a new ChunkPageFooter. + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @classdesc Represents a ChunkPageFooter. + * @implements IChunkPageFooter + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @instance + */ + ChunkPageFooter.prototype.text = ""; + + /** + * ChunkPageFooter pageSpan. + * @member {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null|undefined} pageSpan + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @instance + */ + ChunkPageFooter.prototype.pageSpan = null; + + /** + * Creates a new ChunkPageFooter instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageFooter=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter} ChunkPageFooter + */ + ChunkPageFooter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.pageSpan: object expected"); + message.pageSpan = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan.toObject(message.pageSpan, options); + return object; + }; + + /** + * Converts this ChunkPageFooter to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter"; + }; + + return ChunkPageFooter; + })(); + + Chunk.ImageChunkField = (function() { + + /** + * Properties of an ImageChunkField. + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @interface IImageChunkField + * @property {string|null} [blobAssetId] ImageChunkField blobAssetId + * @property {string|null} [gcsUri] ImageChunkField gcsUri + * @property {string|null} [dataUri] ImageChunkField dataUri + * @property {google.cloud.documentai.v1beta3.Document.IAnnotations|null} [annotations] ImageChunkField annotations + */ + + /** + * Constructs a new ImageChunkField. + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @classdesc Represents an ImageChunkField. + * @implements IImageChunkField + * @constructor + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField=} [properties] Properties to set + */ + function ImageChunkField(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageChunkField blobAssetId. + * @member {string|null|undefined} blobAssetId + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @instance + */ + ImageChunkField.prototype.blobAssetId = null; + + /** + * ImageChunkField gcsUri. + * @member {string|null|undefined} gcsUri + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @instance + */ + ImageChunkField.prototype.gcsUri = null; + + /** + * ImageChunkField dataUri. + * @member {string|null|undefined} dataUri + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @instance + */ + ImageChunkField.prototype.dataUri = null; + + /** + * ImageChunkField annotations. + * @member {google.cloud.documentai.v1beta3.Document.IAnnotations|null|undefined} annotations + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @instance + */ + ImageChunkField.prototype.annotations = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImageChunkField imageSource. + * @member {"blobAssetId"|"gcsUri"|"dataUri"|undefined} imageSource + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @instance + */ + Object.defineProperty(ImageChunkField.prototype, "imageSource", { + get: $util.oneOfGetter($oneOfFields = ["blobAssetId", "gcsUri", "dataUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImageChunkField instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField} ImageChunkField instance + */ + ImageChunkField.create = function create(properties) { + return new ImageChunkField(properties); + }; + + /** + * Encodes the specified ImageChunkField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField} message ImageChunkField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageChunkField.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blobAssetId != null && Object.hasOwnProperty.call(message, "blobAssetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.blobAssetId); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); + if (message.dataUri != null && Object.hasOwnProperty.call(message, "dataUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataUri); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + $root.google.cloud.documentai.v1beta3.Document.Annotations.encode(message.annotations, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImageChunkField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField} message ImageChunkField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageChunkField.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageChunkField message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField} ImageChunkField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageChunkField.decode = function decode(reader, 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.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.blobAssetId = reader.string(); + break; + } + case 2: { + message.gcsUri = reader.string(); + break; + } + case 3: { + message.dataUri = reader.string(); + break; + } + case 4: { + message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageChunkField message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField} ImageChunkField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageChunkField.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageChunkField message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageChunkField.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.blobAssetId != null && message.hasOwnProperty("blobAssetId")) { + properties.imageSource = 1; + if (!$util.isString(message.blobAssetId)) + return "blobAssetId: string expected"; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + if (properties.imageSource === 1) + return "imageSource: multiple values"; + properties.imageSource = 1; + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + } + if (message.dataUri != null && message.hasOwnProperty("dataUri")) { + if (properties.imageSource === 1) + return "imageSource: multiple values"; + properties.imageSource = 1; + if (!$util.isString(message.dataUri)) + return "dataUri: string expected"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) { + var error = $root.google.cloud.documentai.v1beta3.Document.Annotations.verify(message.annotations); + if (error) + return "annotations." + error; + } + return null; + }; + + /** + * Creates an ImageChunkField message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField} ImageChunkField + */ + ImageChunkField.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField(); + if (object.blobAssetId != null) + message.blobAssetId = String(object.blobAssetId); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.dataUri != null) + message.dataUri = String(object.dataUri); + if (object.annotations != null) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.annotations: object expected"); + message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.fromObject(object.annotations); + } + return message; + }; + + /** + * Creates a plain object from an ImageChunkField message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField} message ImageChunkField + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageChunkField.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.annotations = null; + if (message.blobAssetId != null && message.hasOwnProperty("blobAssetId")) { + object.blobAssetId = message.blobAssetId; + if (options.oneofs) + object.imageSource = "blobAssetId"; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { + object.gcsUri = message.gcsUri; + if (options.oneofs) + object.imageSource = "gcsUri"; + } + if (message.dataUri != null && message.hasOwnProperty("dataUri")) { + object.dataUri = message.dataUri; + if (options.oneofs) + object.imageSource = "dataUri"; + } + if (message.annotations != null && message.hasOwnProperty("annotations")) + object.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.toObject(message.annotations, options); + return object; + }; + + /** + * Converts this ImageChunkField to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @instance + * @returns {Object.} JSON object + */ + ImageChunkField.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageChunkField + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageChunkField.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField"; + }; + + return ImageChunkField; + })(); + + Chunk.TableChunkField = (function() { + + /** + * Properties of a TableChunkField. + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @interface ITableChunkField + * @property {google.cloud.documentai.v1beta3.Document.IAnnotations|null} [annotations] TableChunkField annotations + */ + + /** + * Constructs a new TableChunkField. + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @classdesc Represents a TableChunkField. + * @implements ITableChunkField + * @constructor + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField=} [properties] Properties to set + */ + function TableChunkField(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableChunkField annotations. + * @member {google.cloud.documentai.v1beta3.Document.IAnnotations|null|undefined} annotations + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField + * @instance + */ + TableChunkField.prototype.annotations = null; + + /** + * Creates a new TableChunkField instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField} TableChunkField instance + */ + TableChunkField.create = function create(properties) { + return new TableChunkField(properties); + }; + + /** + * Encodes the specified TableChunkField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField} message TableChunkField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableChunkField.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + $root.google.cloud.documentai.v1beta3.Document.Annotations.encode(message.annotations, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableChunkField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField} message TableChunkField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableChunkField.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableChunkField message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField} TableChunkField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableChunkField.decode = function decode(reader, 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.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableChunkField message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField} TableChunkField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableChunkField.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableChunkField message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableChunkField.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + var error = $root.google.cloud.documentai.v1beta3.Document.Annotations.verify(message.annotations); + if (error) + return "annotations." + error; + } + return null; + }; + + /** + * Creates a TableChunkField message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField} TableChunkField + */ + TableChunkField.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField(); + if (object.annotations != null) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.annotations: object expected"); + message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.fromObject(object.annotations); + } + return message; + }; + + /** + * Creates a plain object from a TableChunkField message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField} message TableChunkField + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableChunkField.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.annotations = null; + if (message.annotations != null && message.hasOwnProperty("annotations")) + object.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.toObject(message.annotations, options); + return object; + }; + + /** + * Converts this TableChunkField to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField + * @instance + * @returns {Object.} JSON object + */ + TableChunkField.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableChunkField + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableChunkField.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField"; + }; + + return TableChunkField; + })(); + + Chunk.ChunkField = (function() { + + /** + * Properties of a ChunkField. + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @interface IChunkField + * @property {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField|null} [imageChunkField] ChunkField imageChunkField + * @property {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField|null} [tableChunkField] ChunkField tableChunkField + */ + + /** + * Constructs a new ChunkField. + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk + * @classdesc Represents a ChunkField. + * @implements IChunkField + * @constructor + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField=} [properties] Properties to set + */ + function ChunkField(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChunkField imageChunkField. + * @member {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField|null|undefined} imageChunkField + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @instance + */ + ChunkField.prototype.imageChunkField = null; + + /** + * ChunkField tableChunkField. + * @member {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField|null|undefined} tableChunkField + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @instance + */ + ChunkField.prototype.tableChunkField = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ChunkField fieldType. + * @member {"imageChunkField"|"tableChunkField"|undefined} fieldType + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @instance + */ + Object.defineProperty(ChunkField.prototype, "fieldType", { + get: $util.oneOfGetter($oneOfFields = ["imageChunkField", "tableChunkField"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ChunkField instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField} ChunkField instance + */ + ChunkField.create = function create(properties) { + return new ChunkField(properties); + }; + + /** + * Encodes the specified ChunkField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField} message ChunkField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkField.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageChunkField != null && Object.hasOwnProperty.call(message, "imageChunkField")) + $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.encode(message.imageChunkField, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tableChunkField != null && Object.hasOwnProperty.call(message, "tableChunkField")) + $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.encode(message.tableChunkField, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChunkField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField} message ChunkField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkField.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkField message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField} ChunkField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkField.decode = function decode(reader, 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.v1beta3.Document.ChunkedDocument.Chunk.ChunkField(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.imageChunkField = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.decode(reader, reader.uint32()); + break; + } + case 2: { + message.tableChunkField = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkField message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField} ChunkField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkField.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkField message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkField.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.imageChunkField != null && message.hasOwnProperty("imageChunkField")) { + properties.fieldType = 1; + { + var error = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.verify(message.imageChunkField); + if (error) + return "imageChunkField." + error; + } + } + if (message.tableChunkField != null && message.hasOwnProperty("tableChunkField")) { + if (properties.fieldType === 1) + return "fieldType: multiple values"; + properties.fieldType = 1; + { + var error = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.verify(message.tableChunkField); + if (error) + return "tableChunkField." + error; + } + } + return null; + }; + + /** + * Creates a ChunkField message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField} ChunkField + */ + ChunkField.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField(); + if (object.imageChunkField != null) { + if (typeof object.imageChunkField !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.imageChunkField: object expected"); + message.imageChunkField = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.fromObject(object.imageChunkField); + } + if (object.tableChunkField != null) { + if (typeof object.tableChunkField !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.tableChunkField: object expected"); + message.tableChunkField = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.fromObject(object.tableChunkField); + } + return message; + }; + + /** + * Creates a plain object from a ChunkField message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @static + * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField} message ChunkField + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkField.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.imageChunkField != null && message.hasOwnProperty("imageChunkField")) { + object.imageChunkField = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.toObject(message.imageChunkField, options); + if (options.oneofs) + object.fieldType = "imageChunkField"; + } + if (message.tableChunkField != null && message.hasOwnProperty("tableChunkField")) { + object.tableChunkField = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.toObject(message.tableChunkField, options); + if (options.oneofs) + object.fieldType = "tableChunkField"; + } + return object; + }; + + /** + * Converts this ChunkField to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @instance + * @returns {Object.} JSON object + */ + ChunkField.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkField + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkField.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField"; + }; + + return ChunkField; + })(); + + return Chunk; + })(); + + return ChunkedDocument; + })(); + + Document.BlobAsset = (function() { + + /** + * Properties of a BlobAsset. + * @memberof google.cloud.documentai.v1beta3.Document + * @interface IBlobAsset + * @property {string|null} [assetId] BlobAsset assetId + * @property {Uint8Array|null} [content] BlobAsset content + * @property {string|null} [mimeType] BlobAsset mimeType + */ + + /** + * Constructs a new BlobAsset. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents a BlobAsset. + * @implements IBlobAsset + * @constructor + * @param {google.cloud.documentai.v1beta3.Document.IBlobAsset=} [properties] Properties to set + */ + function BlobAsset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlobAsset assetId. + * @member {string} assetId + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @instance + */ + BlobAsset.prototype.assetId = ""; + + /** + * BlobAsset content. + * @member {Uint8Array} content + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @instance + */ + BlobAsset.prototype.content = $util.newBuffer([]); + + /** + * BlobAsset mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @instance + */ + BlobAsset.prototype.mimeType = ""; + + /** + * Creates a new BlobAsset instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @static + * @param {google.cloud.documentai.v1beta3.Document.IBlobAsset=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Document.BlobAsset} BlobAsset instance + */ + BlobAsset.create = function create(properties) { + return new BlobAsset(properties); + }; + + /** + * Encodes the specified BlobAsset message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.BlobAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @static + * @param {google.cloud.documentai.v1beta3.Document.IBlobAsset} message BlobAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlobAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assetId != null && Object.hasOwnProperty.call(message, "assetId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.assetId); + 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); + return writer; + }; + + /** + * Encodes the specified BlobAsset message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.BlobAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @static + * @param {google.cloud.documentai.v1beta3.Document.IBlobAsset} message BlobAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlobAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlobAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Document.BlobAsset} BlobAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlobAsset.decode = function decode(reader, 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.v1beta3.Document.BlobAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.assetId = reader.string(); + break; + } + case 2: { + message.content = reader.bytes(); + break; + } + case 3: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BlobAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Document.BlobAsset} BlobAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlobAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlobAsset message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlobAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assetId != null && message.hasOwnProperty("assetId")) + if (!$util.isString(message.assetId)) + return "assetId: string 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"; + return null; + }; + + /** + * Creates a BlobAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.BlobAsset} BlobAsset + */ + BlobAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.BlobAsset) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.BlobAsset(); + if (object.assetId != null) + message.assetId = String(object.assetId); + 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); + return message; + }; + + /** + * Creates a plain object from a BlobAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @static + * @param {google.cloud.documentai.v1beta3.Document.BlobAsset} message BlobAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlobAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.assetId = ""; + if (options.bytes === String) + object.content = ""; + else { + object.content = []; + if (options.bytes !== Array) + object.content = $util.newBuffer(object.content); + } + object.mimeType = ""; + } + if (message.assetId != null && message.hasOwnProperty("assetId")) + object.assetId = message.assetId; + 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; + return object; + }; + + /** + * Converts this BlobAsset to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @instance + * @returns {Object.} JSON object + */ + BlobAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BlobAsset + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BlobAsset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.BlobAsset"; + }; + + return BlobAsset; + })(); + + Document.EntityValidationOutput = (function() { + + /** + * Properties of an EntityValidationOutput. + * @memberof google.cloud.documentai.v1beta3.Document + * @interface IEntityValidationOutput + * @property {Array.|null} [validationResults] EntityValidationOutput validationResults + * @property {boolean|null} [passAllRules] EntityValidationOutput passAllRules + */ + + /** + * Constructs a new EntityValidationOutput. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents an EntityValidationOutput. + * @implements IEntityValidationOutput + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput + * @instance + */ + EntityValidationOutput.prototype.validationResults = $util.emptyArray; + + /** + * EntityValidationOutput passAllRules. + * @member {boolean} passAllRules + * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput + * @instance + */ + EntityValidationOutput.prototype.passAllRules = false; + + /** + * Creates a new EntityValidationOutput instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput + * @static + * @param {google.cloud.documentai.v1beta3.Document.IEntityValidationOutput=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.EntityValidationOutput} EntityValidationOutput + */ + EntityValidationOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput(); + if (object.validationResults) { + if (!Array.isArray(object.validationResults)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.validationResults: object expected"); + message.validationResults[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput"; + }; + + EntityValidationOutput.ValidationResult = (function() { + + /** + * Properties of a ValidationResult. + * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput + * @interface IValidationResult + * @property {string|null} [ruleName] ValidationResult ruleName + * @property {string|null} [ruleDescription] ValidationResult ruleDescription + * @property {google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult.ValidationResultType|null} [validationResultType] ValidationResult validationResultType + * @property {string|null} [validationDetails] ValidationResult validationDetails + */ + + /** + * Constructs a new ValidationResult. + * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput + * @classdesc Represents a ValidationResult. + * @implements IValidationResult + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult + * @instance + */ + ValidationResult.prototype.ruleName = ""; + + /** + * ValidationResult ruleDescription. + * @member {string} ruleDescription + * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult + * @instance + */ + ValidationResult.prototype.ruleDescription = ""; + + /** + * ValidationResult validationResultType. + * @member {google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult.ValidationResultType} validationResultType + * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult + * @instance + */ + ValidationResult.prototype.validationResultType = 0; + + /** + * ValidationResult validationDetails. + * @member {string} validationDetails + * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult + * @instance + */ + ValidationResult.prototype.validationDetails = ""; + + /** + * Creates a new ValidationResult instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult + * @static + * @param {google.cloud.documentai.v1beta3.Document.EntityValidationOutput.IValidationResult=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult} ValidationResult + */ + ValidationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult.ValidationResultType[message.validationResultType] === undefined ? message.validationResultType : $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult"; + }; + + /** + * ValidationResultType enum. + * @name google.cloud.documentai.v1beta3.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.v1beta3.Document + * @interface IEntitiesRevision + * @property {string|null} [revisionId] EntitiesRevision revisionId + * @property {Array.|null} [entities] EntitiesRevision entities + * @property {google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null} [entityValidationOutput] EntitiesRevision entityValidationOutput + * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] EntitiesRevision provenance + */ + + /** + * Constructs a new EntitiesRevision. + * @memberof google.cloud.documentai.v1beta3.Document + * @classdesc Represents an EntitiesRevision. + * @implements IEntitiesRevision + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntitiesRevision + * @instance + */ + EntitiesRevision.prototype.revisionId = ""; + + /** + * EntitiesRevision entities. + * @member {Array.} entities + * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision + * @instance + */ + EntitiesRevision.prototype.entities = $util.emptyArray; + + /** + * EntitiesRevision entityValidationOutput. + * @member {google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null|undefined} entityValidationOutput + * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision + * @instance + */ + EntitiesRevision.prototype.entityValidationOutput = null; + + /** + * EntitiesRevision provenance. + * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision + * @instance + */ + EntitiesRevision.prototype.provenance = null; + + /** + * Creates a new EntitiesRevision instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision + * @static + * @param {google.cloud.documentai.v1beta3.Document.IEntitiesRevision=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntitiesRevision.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput.encode(message.entityValidationOutput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.google.cloud.documentai.v1beta3.Document.Provenance.encode(message.provenance, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EntitiesRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.EntitiesRevision.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.decode(reader, reader.uint32())); + break; + } + case 3: { + message.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.decode(reader, reader.uint32()); + break; + } + case 4: { + message.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.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.v1beta3.Document.EntitiesRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) { + var error = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.verify(message.entityValidationOutput); + if (error) + return "entityValidationOutput." + error; + } + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1beta3.Document.Provenance.verify(message.provenance); + if (error) + return "provenance." + 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.v1beta3.Document.EntitiesRevision + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Document.EntitiesRevision} EntitiesRevision + */ + EntitiesRevision.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Document.EntitiesRevision) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Document.EntitiesRevision(); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.EntitiesRevision.entities: object expected"); + message.entities[i] = $root.google.cloud.documentai.v1beta3.Document.Entity.fromObject(object.entities[i]); + } + } + if (object.entityValidationOutput != null) { + if (typeof object.entityValidationOutput !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.EntitiesRevision.entityValidationOutput: object expected"); + message.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.fromObject(object.entityValidationOutput); + } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.EntitiesRevision.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.fromObject(object.provenance); + } + return message; + }; + + /** + * Creates a plain object from an EntitiesRevision message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision + * @static + * @param {google.cloud.documentai.v1beta3.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; + object.provenance = 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.v1beta3.Document.Entity.toObject(message.entities[j], options); + } + if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) + object.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.toObject(message.entityValidationOutput, options); + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); + return object; + }; + + /** + * Converts this EntitiesRevision to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.EntitiesRevision"; + }; + + return EntitiesRevision; + })(); + + return Document; + })(); + + v1beta3.RevisionRef = (function() { + + /** + * Properties of a RevisionRef. + * @memberof google.cloud.documentai.v1beta3 + * @interface IRevisionRef + * @property {google.cloud.documentai.v1beta3.RevisionRef.RevisionCase|null} [revisionCase] RevisionRef revisionCase + * @property {string|null} [revisionId] RevisionRef revisionId + * @property {string|null} [latestProcessorVersion] RevisionRef latestProcessorVersion + */ + + /** + * Constructs a new RevisionRef. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a RevisionRef. + * @implements IRevisionRef + * @constructor + * @param {google.cloud.documentai.v1beta3.IRevisionRef=} [properties] Properties to set + */ + function RevisionRef(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RevisionRef revisionCase. + * @member {google.cloud.documentai.v1beta3.RevisionRef.RevisionCase|null|undefined} revisionCase + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @instance + */ + RevisionRef.prototype.revisionCase = null; + + /** + * RevisionRef revisionId. + * @member {string|null|undefined} revisionId + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @instance + */ + RevisionRef.prototype.revisionId = null; + + /** + * RevisionRef latestProcessorVersion. + * @member {string|null|undefined} latestProcessorVersion + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @instance + */ + RevisionRef.prototype.latestProcessorVersion = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RevisionRef source. + * @member {"revisionCase"|"revisionId"|"latestProcessorVersion"|undefined} source + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @instance + */ + Object.defineProperty(RevisionRef.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["revisionCase", "revisionId", "latestProcessorVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RevisionRef instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @static + * @param {google.cloud.documentai.v1beta3.IRevisionRef=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.RevisionRef} RevisionRef instance + */ + RevisionRef.create = function create(properties) { + return new RevisionRef(properties); + }; + + /** + * Encodes the specified RevisionRef message. Does not implicitly {@link google.cloud.documentai.v1beta3.RevisionRef.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @static + * @param {google.cloud.documentai.v1beta3.IRevisionRef} message RevisionRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevisionRef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.revisionCase != null && Object.hasOwnProperty.call(message, "revisionCase")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revisionCase); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + if (message.latestProcessorVersion != null && Object.hasOwnProperty.call(message, "latestProcessorVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.latestProcessorVersion); + return writer; + }; + + /** + * Encodes the specified RevisionRef message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RevisionRef.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @static + * @param {google.cloud.documentai.v1beta3.IRevisionRef} message RevisionRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RevisionRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RevisionRef message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.RevisionRef} RevisionRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevisionRef.decode = function decode(reader, 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.v1beta3.RevisionRef(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.revisionCase = reader.int32(); + break; + } + case 2: { + message.revisionId = reader.string(); + break; + } + case 3: { + message.latestProcessorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RevisionRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.RevisionRef} RevisionRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RevisionRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RevisionRef message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RevisionRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.revisionCase != null && message.hasOwnProperty("revisionCase")) { + properties.source = 1; + switch (message.revisionCase) { + default: + return "revisionCase: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.revisionId != null && message.hasOwnProperty("revisionId")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + } + if (message.latestProcessorVersion != null && message.hasOwnProperty("latestProcessorVersion")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.latestProcessorVersion)) + return "latestProcessorVersion: string expected"; + } + return null; + }; + + /** + * Creates a RevisionRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.RevisionRef} RevisionRef + */ + RevisionRef.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.RevisionRef) + return object; + var message = new $root.google.cloud.documentai.v1beta3.RevisionRef(); + switch (object.revisionCase) { + default: + if (typeof object.revisionCase === "number") { + message.revisionCase = object.revisionCase; + break; + } + break; + case "REVISION_CASE_UNSPECIFIED": + case 0: + message.revisionCase = 0; + break; + case "LATEST_HUMAN_REVIEW": + case 1: + message.revisionCase = 1; + break; + case "LATEST_TIMESTAMP": + case 2: + message.revisionCase = 2; + break; + case "BASE_OCR_REVISION": + case 3: + message.revisionCase = 3; + break; + } + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.latestProcessorVersion != null) + message.latestProcessorVersion = String(object.latestProcessorVersion); + return message; + }; + + /** + * Creates a plain object from a RevisionRef message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @static + * @param {google.cloud.documentai.v1beta3.RevisionRef} message RevisionRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RevisionRef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.revisionCase != null && message.hasOwnProperty("revisionCase")) { + object.revisionCase = options.enums === String ? $root.google.cloud.documentai.v1beta3.RevisionRef.RevisionCase[message.revisionCase] === undefined ? message.revisionCase : $root.google.cloud.documentai.v1beta3.RevisionRef.RevisionCase[message.revisionCase] : message.revisionCase; + if (options.oneofs) + object.source = "revisionCase"; + } + if (message.revisionId != null && message.hasOwnProperty("revisionId")) { + object.revisionId = message.revisionId; + if (options.oneofs) + object.source = "revisionId"; + } + if (message.latestProcessorVersion != null && message.hasOwnProperty("latestProcessorVersion")) { + object.latestProcessorVersion = message.latestProcessorVersion; + if (options.oneofs) + object.source = "latestProcessorVersion"; + } + return object; + }; + + /** + * Converts this RevisionRef to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @instance + * @returns {Object.} JSON object + */ + RevisionRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RevisionRef + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.RevisionRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RevisionRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.RevisionRef"; + }; + + /** + * RevisionCase enum. + * @name google.cloud.documentai.v1beta3.RevisionRef.RevisionCase + * @enum {number} + * @property {number} REVISION_CASE_UNSPECIFIED=0 REVISION_CASE_UNSPECIFIED value + * @property {number} LATEST_HUMAN_REVIEW=1 LATEST_HUMAN_REVIEW value + * @property {number} LATEST_TIMESTAMP=2 LATEST_TIMESTAMP value + * @property {number} BASE_OCR_REVISION=3 BASE_OCR_REVISION value + */ + RevisionRef.RevisionCase = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REVISION_CASE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LATEST_HUMAN_REVIEW"] = 1; + values[valuesById[2] = "LATEST_TIMESTAMP"] = 2; + values[valuesById[3] = "BASE_OCR_REVISION"] = 3; + return values; + })(); + + return RevisionRef; + })(); + + v1beta3.Vertex = (function() { + + /** + * Properties of a Vertex. + * @memberof google.cloud.documentai.v1beta3 + * @interface IVertex + * @property {number|null} [x] Vertex x + * @property {number|null} [y] Vertex y + */ + + /** + * Constructs a new Vertex. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a Vertex. + * @implements IVertex + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Vertex + * @instance + */ + Vertex.prototype.x = 0; + + /** + * Vertex y. + * @member {number} y + * @memberof google.cloud.documentai.v1beta3.Vertex + * @instance + */ + Vertex.prototype.y = 0; + + /** + * Creates a new Vertex instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Vertex + * @static + * @param {google.cloud.documentai.v1beta3.IVertex=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Vertex} Vertex instance + */ + Vertex.create = function create(properties) { + return new Vertex(properties); + }; + + /** + * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.documentai.v1beta3.Vertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Vertex + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.Vertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Vertex + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Vertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Vertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Vertex} Vertex + */ + Vertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Vertex) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Vertex + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Vertex"; + }; + + return Vertex; + })(); + + v1beta3.NormalizedVertex = (function() { + + /** + * Properties of a NormalizedVertex. + * @memberof google.cloud.documentai.v1beta3 + * @interface INormalizedVertex + * @property {number|null} [x] NormalizedVertex x + * @property {number|null} [y] NormalizedVertex y + */ + + /** + * Constructs a new NormalizedVertex. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a NormalizedVertex. + * @implements INormalizedVertex + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.x = 0; + + /** + * NormalizedVertex y. + * @member {number} y + * @memberof google.cloud.documentai.v1beta3.NormalizedVertex + * @instance + */ + NormalizedVertex.prototype.y = 0; + + /** + * Creates a new NormalizedVertex instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.NormalizedVertex + * @static + * @param {google.cloud.documentai.v1beta3.INormalizedVertex=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.NormalizedVertex} NormalizedVertex instance + */ + NormalizedVertex.create = function create(properties) { + return new NormalizedVertex(properties); + }; + + /** + * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.documentai.v1beta3.NormalizedVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.NormalizedVertex + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.NormalizedVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.NormalizedVertex + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.NormalizedVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.NormalizedVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.NormalizedVertex} NormalizedVertex + */ + NormalizedVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.NormalizedVertex) + return object; + var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.NormalizedVertex + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.NormalizedVertex"; + }; + + return NormalizedVertex; + })(); + + v1beta3.BoundingPoly = (function() { + + /** + * Properties of a BoundingPoly. + * @memberof google.cloud.documentai.v1beta3 + * @interface IBoundingPoly + * @property {Array.|null} [vertices] BoundingPoly vertices + * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices + */ + + /** + * Constructs a new BoundingPoly. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a BoundingPoly. + * @implements IBoundingPoly + * @constructor + * @param {google.cloud.documentai.v1beta3.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.v1beta3.BoundingPoly + * @instance + */ + BoundingPoly.prototype.vertices = $util.emptyArray; + + /** + * BoundingPoly normalizedVertices. + * @member {Array.} normalizedVertices + * @memberof google.cloud.documentai.v1beta3.BoundingPoly + * @instance + */ + BoundingPoly.prototype.normalizedVertices = $util.emptyArray; + + /** + * Creates a new BoundingPoly instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BoundingPoly + * @static + * @param {google.cloud.documentai.v1beta3.IBoundingPoly=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BoundingPoly} BoundingPoly instance + */ + BoundingPoly.create = function create(properties) { + return new BoundingPoly(properties); + }; + + /** + * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.documentai.v1beta3.BoundingPoly.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BoundingPoly + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.BoundingPoly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BoundingPoly + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Vertex.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.normalizedVertices && message.normalizedVertices.length)) + message.normalizedVertices = []; + message.normalizedVertices.push($root.google.cloud.documentai.v1beta3.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.v1beta3.BoundingPoly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.BoundingPoly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BoundingPoly} BoundingPoly + */ + BoundingPoly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BoundingPoly) + return object; + var message = new $root.google.cloud.documentai.v1beta3.BoundingPoly(); + if (object.vertices) { + if (!Array.isArray(object.vertices)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.BoundingPoly.vertices: object expected"); + message.vertices[i] = $root.google.cloud.documentai.v1beta3.Vertex.fromObject(object.vertices[i]); + } + } + if (object.normalizedVertices) { + if (!Array.isArray(object.normalizedVertices)) + throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.BoundingPoly.normalizedVertices: object expected"); + message.normalizedVertices[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.BoundingPoly + * @static + * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.NormalizedVertex.toObject(message.normalizedVertices[j], options); + } + return object; + }; + + /** + * Converts this BoundingPoly to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.BoundingPoly"; + }; + + return BoundingPoly; + })(); + + v1beta3.Documents = (function() { + + /** + * Properties of a Documents. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDocuments + * @property {Array.|null} [documents] Documents documents + */ + + /** + * Constructs a new Documents. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a Documents. + * @implements IDocuments + * @constructor + * @param {google.cloud.documentai.v1beta3.IDocuments=} [properties] Properties to set + */ + function Documents(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]]; + } + + /** + * Documents documents. + * @member {Array.} documents + * @memberof google.cloud.documentai.v1beta3.Documents + * @instance + */ + Documents.prototype.documents = $util.emptyArray; + + /** + * Creates a new Documents instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {google.cloud.documentai.v1beta3.IDocuments=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Documents} Documents instance + */ + Documents.create = function create(properties) { + return new Documents(properties); + }; + + /** + * Encodes the specified Documents message. Does not implicitly {@link google.cloud.documentai.v1beta3.Documents.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {google.cloud.documentai.v1beta3.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.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) + $root.google.cloud.documentai.v1beta3.Document.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Documents message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Documents.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {google.cloud.documentai.v1beta3.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Documents message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decode = function decode(reader, 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.v1beta3.Documents(); + 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($root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Documents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Documents message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documents.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) { + var error = $root.google.cloud.documentai.v1beta3.Document.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + return null; + }; + + /** + * Creates a Documents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Documents} Documents + */ + Documents.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Documents) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Documents(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.documentai.v1beta3.Documents.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Documents.documents: object expected"); + message.documents[i] = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.documents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Documents message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {google.cloud.documentai.v1beta3.Documents} message Documents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.cloud.documentai.v1beta3.Document.toObject(message.documents[j], options); + } + return object; + }; + + /** + * Converts this Documents to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Documents + * @instance + * @returns {Object.} JSON object + */ + Documents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Documents + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Documents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Documents"; + }; + + return Documents; + })(); + + v1beta3.RawDocument = (function() { + + /** + * Properties of a RawDocument. + * @memberof google.cloud.documentai.v1beta3 + * @interface IRawDocument + * @property {Uint8Array|null} [content] RawDocument content + * @property {string|null} [mimeType] RawDocument mimeType + * @property {string|null} [displayName] RawDocument displayName + */ + + /** + * Constructs a new RawDocument. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a RawDocument. + * @implements IRawDocument + * @constructor + * @param {google.cloud.documentai.v1beta3.IRawDocument=} [properties] Properties to set + */ + function RawDocument(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RawDocument content. + * @member {Uint8Array} content + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @instance + */ + RawDocument.prototype.content = $util.newBuffer([]); + + /** + * RawDocument mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @instance + */ + RawDocument.prototype.mimeType = ""; + + /** + * RawDocument displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @instance + */ + RawDocument.prototype.displayName = ""; + + /** + * Creates a new RawDocument instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @static + * @param {google.cloud.documentai.v1beta3.IRawDocument=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.RawDocument} RawDocument instance + */ + RawDocument.create = function create(properties) { + return new RawDocument(properties); + }; + + /** + * Encodes the specified RawDocument message. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocument.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @static + * @param {google.cloud.documentai.v1beta3.IRawDocument} message RawDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawDocument.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified RawDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocument.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @static + * @param {google.cloud.documentai.v1beta3.IRawDocument} message RawDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawDocument.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RawDocument message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.RawDocument} RawDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawDocument.decode = function decode(reader, 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.v1beta3.RawDocument(); + 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.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RawDocument message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.RawDocument} RawDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawDocument.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RawDocument message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RawDocument.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a RawDocument message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.RawDocument} RawDocument + */ + RawDocument.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.RawDocument) + return object; + var message = new $root.google.cloud.documentai.v1beta3.RawDocument(); + 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.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a RawDocument message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @static + * @param {google.cloud.documentai.v1beta3.RawDocument} message RawDocument + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RawDocument.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.displayName = ""; + } + 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.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this RawDocument to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @instance + * @returns {Object.} JSON object + */ + RawDocument.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RawDocument + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.RawDocument + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RawDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.RawDocument"; + }; + + return RawDocument; + })(); + + v1beta3.GcsDocument = (function() { + + /** + * Properties of a GcsDocument. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGcsDocument + * @property {string|null} [gcsUri] GcsDocument gcsUri + * @property {string|null} [mimeType] GcsDocument mimeType + */ + + /** + * Constructs a new GcsDocument. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a GcsDocument. + * @implements IGcsDocument + * @constructor + * @param {google.cloud.documentai.v1beta3.IGcsDocument=} [properties] Properties to set + */ + function GcsDocument(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsDocument gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @instance + */ + GcsDocument.prototype.gcsUri = ""; + + /** + * GcsDocument mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @instance + */ + GcsDocument.prototype.mimeType = ""; + + /** + * Creates a new GcsDocument instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @static + * @param {google.cloud.documentai.v1beta3.IGcsDocument=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.GcsDocument} GcsDocument instance + */ + GcsDocument.create = function create(properties) { + return new GcsDocument(properties); + }; + + /** + * Encodes the specified GcsDocument message. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocument.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @static + * @param {google.cloud.documentai.v1beta3.IGcsDocument} message GcsDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDocument.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified GcsDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocument.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @static + * @param {google.cloud.documentai.v1beta3.IGcsDocument} message GcsDocument message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDocument.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDocument message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.GcsDocument} GcsDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDocument.decode = function decode(reader, 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.v1beta3.GcsDocument(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsUri = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDocument message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.GcsDocument} GcsDocument + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDocument.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDocument message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDocument.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a GcsDocument message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.GcsDocument} GcsDocument + */ + GcsDocument.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.GcsDocument) + return object; + var message = new $root.google.cloud.documentai.v1beta3.GcsDocument(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a GcsDocument message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @static + * @param {google.cloud.documentai.v1beta3.GcsDocument} message GcsDocument + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDocument.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsUri = ""; + object.mimeType = ""; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + object.gcsUri = message.gcsUri; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this GcsDocument to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @instance + * @returns {Object.} JSON object + */ + GcsDocument.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDocument + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.GcsDocument + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GcsDocument"; + }; + + return GcsDocument; + })(); + + v1beta3.GcsDocuments = (function() { + + /** + * Properties of a GcsDocuments. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGcsDocuments + * @property {Array.|null} [documents] GcsDocuments documents + */ + + /** + * Constructs a new GcsDocuments. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a GcsDocuments. + * @implements IGcsDocuments + * @constructor + * @param {google.cloud.documentai.v1beta3.IGcsDocuments=} [properties] Properties to set + */ + function GcsDocuments(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]]; + } + + /** + * GcsDocuments documents. + * @member {Array.} documents + * @memberof google.cloud.documentai.v1beta3.GcsDocuments + * @instance + */ + GcsDocuments.prototype.documents = $util.emptyArray; + + /** + * Creates a new GcsDocuments instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.GcsDocuments + * @static + * @param {google.cloud.documentai.v1beta3.IGcsDocuments=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.GcsDocuments} GcsDocuments instance + */ + GcsDocuments.create = function create(properties) { + return new GcsDocuments(properties); + }; + + /** + * Encodes the specified GcsDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocuments.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.GcsDocuments + * @static + * @param {google.cloud.documentai.v1beta3.IGcsDocuments} message GcsDocuments message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDocuments.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) + $root.google.cloud.documentai.v1beta3.GcsDocument.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GcsDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocuments.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.GcsDocuments + * @static + * @param {google.cloud.documentai.v1beta3.IGcsDocuments} message GcsDocuments message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDocuments.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsDocuments message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.GcsDocuments + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.GcsDocuments} GcsDocuments + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDocuments.decode = function decode(reader, 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.v1beta3.GcsDocuments(); + 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($root.google.cloud.documentai.v1beta3.GcsDocument.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDocuments message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.GcsDocuments + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.GcsDocuments} GcsDocuments + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsDocuments.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsDocuments message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.GcsDocuments + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsDocuments.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) { + var error = $root.google.cloud.documentai.v1beta3.GcsDocument.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + return null; + }; + + /** + * Creates a GcsDocuments message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.GcsDocuments + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.GcsDocuments} GcsDocuments + */ + GcsDocuments.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.GcsDocuments) + return object; + var message = new $root.google.cloud.documentai.v1beta3.GcsDocuments(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.documentai.v1beta3.GcsDocuments.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.GcsDocuments.documents: object expected"); + message.documents[i] = $root.google.cloud.documentai.v1beta3.GcsDocument.fromObject(object.documents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GcsDocuments message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.GcsDocuments + * @static + * @param {google.cloud.documentai.v1beta3.GcsDocuments} message GcsDocuments + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsDocuments.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.cloud.documentai.v1beta3.GcsDocument.toObject(message.documents[j], options); + } + return object; + }; + + /** + * Converts this GcsDocuments to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.GcsDocuments + * @instance + * @returns {Object.} JSON object + */ + GcsDocuments.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDocuments + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.GcsDocuments + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDocuments.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GcsDocuments"; + }; + + return GcsDocuments; + })(); + + v1beta3.GcsPrefix = (function() { + + /** + * Properties of a GcsPrefix. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGcsPrefix + * @property {string|null} [gcsUriPrefix] GcsPrefix gcsUriPrefix + */ + + /** + * Constructs a new GcsPrefix. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a GcsPrefix. + * @implements IGcsPrefix + * @constructor + * @param {google.cloud.documentai.v1beta3.IGcsPrefix=} [properties] Properties to set + */ + function GcsPrefix(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsPrefix gcsUriPrefix. + * @member {string} gcsUriPrefix + * @memberof google.cloud.documentai.v1beta3.GcsPrefix + * @instance + */ + GcsPrefix.prototype.gcsUriPrefix = ""; + + /** + * Creates a new GcsPrefix instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.GcsPrefix + * @static + * @param {google.cloud.documentai.v1beta3.IGcsPrefix=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.GcsPrefix} GcsPrefix instance + */ + GcsPrefix.create = function create(properties) { + return new GcsPrefix(properties); + }; + + /** + * Encodes the specified GcsPrefix message. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsPrefix.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.GcsPrefix + * @static + * @param {google.cloud.documentai.v1beta3.IGcsPrefix} message GcsPrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsPrefix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsUriPrefix != null && Object.hasOwnProperty.call(message, "gcsUriPrefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsPrefix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsPrefix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.GcsPrefix + * @static + * @param {google.cloud.documentai.v1beta3.IGcsPrefix} message GcsPrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsPrefix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsPrefix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.GcsPrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.GcsPrefix} GcsPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsPrefix.decode = function decode(reader, 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.v1beta3.GcsPrefix(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsUriPrefix = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsPrefix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.GcsPrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.GcsPrefix} GcsPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsPrefix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsPrefix message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.GcsPrefix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsPrefix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsUriPrefix != null && message.hasOwnProperty("gcsUriPrefix")) + if (!$util.isString(message.gcsUriPrefix)) + return "gcsUriPrefix: string expected"; + return null; + }; + + /** + * Creates a GcsPrefix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.GcsPrefix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.GcsPrefix} GcsPrefix + */ + GcsPrefix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.GcsPrefix) + return object; + var message = new $root.google.cloud.documentai.v1beta3.GcsPrefix(); + if (object.gcsUriPrefix != null) + message.gcsUriPrefix = String(object.gcsUriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsPrefix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.GcsPrefix + * @static + * @param {google.cloud.documentai.v1beta3.GcsPrefix} message GcsPrefix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsPrefix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsUriPrefix = ""; + if (message.gcsUriPrefix != null && message.hasOwnProperty("gcsUriPrefix")) + object.gcsUriPrefix = message.gcsUriPrefix; + return object; + }; + + /** + * Converts this GcsPrefix to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.GcsPrefix + * @instance + * @returns {Object.} JSON object + */ + GcsPrefix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsPrefix + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.GcsPrefix + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsPrefix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GcsPrefix"; + }; + + return GcsPrefix; + })(); + + v1beta3.RawDocuments = (function() { + + /** + * Properties of a RawDocuments. + * @memberof google.cloud.documentai.v1beta3 + * @interface IRawDocuments + * @property {Array.|null} [documents] RawDocuments documents + */ + + /** + * Constructs a new RawDocuments. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a RawDocuments. + * @implements IRawDocuments + * @constructor + * @param {google.cloud.documentai.v1beta3.IRawDocuments=} [properties] Properties to set + */ + function RawDocuments(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]]; + } + + /** + * RawDocuments documents. + * @member {Array.} documents + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @instance + */ + RawDocuments.prototype.documents = $util.emptyArray; + + /** + * Creates a new RawDocuments instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {google.cloud.documentai.v1beta3.IRawDocuments=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.RawDocuments} RawDocuments instance + */ + RawDocuments.create = function create(properties) { + return new RawDocuments(properties); + }; + + /** + * Encodes the specified RawDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocuments.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {google.cloud.documentai.v1beta3.IRawDocuments} message RawDocuments message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawDocuments.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) + $root.google.cloud.documentai.v1beta3.RawDocument.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RawDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocuments.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {google.cloud.documentai.v1beta3.IRawDocuments} message RawDocuments message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawDocuments.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RawDocuments message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.RawDocuments} RawDocuments + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawDocuments.decode = function decode(reader, 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.v1beta3.RawDocuments(); + 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($root.google.cloud.documentai.v1beta3.RawDocument.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RawDocuments message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.RawDocuments} RawDocuments + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawDocuments.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RawDocuments message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RawDocuments.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) { + var error = $root.google.cloud.documentai.v1beta3.RawDocument.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + return null; + }; + + /** + * Creates a RawDocuments message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.RawDocuments} RawDocuments + */ + RawDocuments.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.RawDocuments) + return object; + var message = new $root.google.cloud.documentai.v1beta3.RawDocuments(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.documentai.v1beta3.RawDocuments.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.RawDocuments.documents: object expected"); + message.documents[i] = $root.google.cloud.documentai.v1beta3.RawDocument.fromObject(object.documents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RawDocuments message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {google.cloud.documentai.v1beta3.RawDocuments} message RawDocuments + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RawDocuments.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.cloud.documentai.v1beta3.RawDocument.toObject(message.documents[j], options); + } + return object; + }; + + /** + * Converts this RawDocuments to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @instance + * @returns {Object.} JSON object + */ + RawDocuments.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RawDocuments + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RawDocuments.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.RawDocuments"; + }; + + return RawDocuments; + })(); + + v1beta3.BatchDocumentsInputConfig = (function() { + + /** + * Properties of a BatchDocumentsInputConfig. + * @memberof google.cloud.documentai.v1beta3 + * @interface IBatchDocumentsInputConfig + * @property {google.cloud.documentai.v1beta3.IGcsPrefix|null} [gcsPrefix] BatchDocumentsInputConfig gcsPrefix + * @property {google.cloud.documentai.v1beta3.IGcsDocuments|null} [gcsDocuments] BatchDocumentsInputConfig gcsDocuments + */ + + /** + * Constructs a new BatchDocumentsInputConfig. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a BatchDocumentsInputConfig. + * @implements IBatchDocumentsInputConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig=} [properties] Properties to set + */ + function BatchDocumentsInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDocumentsInputConfig gcsPrefix. + * @member {google.cloud.documentai.v1beta3.IGcsPrefix|null|undefined} gcsPrefix + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @instance + */ + BatchDocumentsInputConfig.prototype.gcsPrefix = null; + + /** + * BatchDocumentsInputConfig gcsDocuments. + * @member {google.cloud.documentai.v1beta3.IGcsDocuments|null|undefined} gcsDocuments + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @instance + */ + BatchDocumentsInputConfig.prototype.gcsDocuments = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchDocumentsInputConfig source. + * @member {"gcsPrefix"|"gcsDocuments"|undefined} source + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @instance + */ + Object.defineProperty(BatchDocumentsInputConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsPrefix", "gcsDocuments"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchDocumentsInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} BatchDocumentsInputConfig instance + */ + BatchDocumentsInputConfig.create = function create(properties) { + return new BatchDocumentsInputConfig(properties); + }; + + /** + * Encodes the specified BatchDocumentsInputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig} message BatchDocumentsInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDocumentsInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) + $root.google.cloud.documentai.v1beta3.GcsPrefix.encode(message.gcsPrefix, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gcsDocuments != null && Object.hasOwnProperty.call(message, "gcsDocuments")) + $root.google.cloud.documentai.v1beta3.GcsDocuments.encode(message.gcsDocuments, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchDocumentsInputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig} message BatchDocumentsInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDocumentsInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} BatchDocumentsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDocumentsInputConfig.decode = function decode(reader, 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.v1beta3.BatchDocumentsInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.decode(reader, reader.uint32()); + break; + } + case 2: { + message.gcsDocuments = $root.google.cloud.documentai.v1beta3.GcsDocuments.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} BatchDocumentsInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDocumentsInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDocumentsInputConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDocumentsInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1beta3.GcsPrefix.verify(message.gcsPrefix); + if (error) + return "gcsPrefix." + error; + } + } + if (message.gcsDocuments != null && message.hasOwnProperty("gcsDocuments")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1beta3.GcsDocuments.verify(message.gcsDocuments); + if (error) + return "gcsDocuments." + error; + } + } + return null; + }; + + /** + * Creates a BatchDocumentsInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} BatchDocumentsInputConfig + */ + BatchDocumentsInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig(); + if (object.gcsPrefix != null) { + if (typeof object.gcsPrefix !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.gcsPrefix: object expected"); + message.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.fromObject(object.gcsPrefix); + } + if (object.gcsDocuments != null) { + if (typeof object.gcsDocuments !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.gcsDocuments: object expected"); + message.gcsDocuments = $root.google.cloud.documentai.v1beta3.GcsDocuments.fromObject(object.gcsDocuments); + } + return message; + }; + + /** + * Creates a plain object from a BatchDocumentsInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @static + * @param {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} message BatchDocumentsInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDocumentsInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { + object.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.toObject(message.gcsPrefix, options); + if (options.oneofs) + object.source = "gcsPrefix"; + } + if (message.gcsDocuments != null && message.hasOwnProperty("gcsDocuments")) { + object.gcsDocuments = $root.google.cloud.documentai.v1beta3.GcsDocuments.toObject(message.gcsDocuments, options); + if (options.oneofs) + object.source = "gcsDocuments"; + } + return object; + }; + + /** + * Converts this BatchDocumentsInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchDocumentsInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDocumentsInputConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDocumentsInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDocumentsInputConfig"; + }; + + return BatchDocumentsInputConfig; + })(); + + v1beta3.DocumentOutputConfig = (function() { + + /** + * Properties of a DocumentOutputConfig. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDocumentOutputConfig + * @property {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null} [gcsOutputConfig] DocumentOutputConfig gcsOutputConfig + */ + + /** + * Constructs a new DocumentOutputConfig. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DocumentOutputConfig. + * @implements IDocumentOutputConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.IDocumentOutputConfig=} [properties] Properties to set + */ + function DocumentOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentOutputConfig gcsOutputConfig. + * @member {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null|undefined} gcsOutputConfig + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @instance + */ + DocumentOutputConfig.prototype.gcsOutputConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DocumentOutputConfig destination. + * @member {"gcsOutputConfig"|undefined} destination + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @instance + */ + Object.defineProperty(DocumentOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DocumentOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentOutputConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig} DocumentOutputConfig instance + */ + DocumentOutputConfig.create = function create(properties) { + return new DocumentOutputConfig(properties); + }; + + /** + * Encodes the specified DocumentOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentOutputConfig} message DocumentOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputConfig != null && Object.hasOwnProperty.call(message, "gcsOutputConfig")) + $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.encode(message.gcsOutputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentOutputConfig} message DocumentOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig} DocumentOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentOutputConfig.decode = function decode(reader, 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.v1beta3.DocumentOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig} DocumentOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentOutputConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputConfig != null && message.hasOwnProperty("gcsOutputConfig")) { + properties.destination = 1; + { + var error = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.verify(message.gcsOutputConfig); + if (error) + return "gcsOutputConfig." + error; + } + } + return null; + }; + + /** + * Creates a DocumentOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig} DocumentOutputConfig + */ + DocumentOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentOutputConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentOutputConfig(); + if (object.gcsOutputConfig != null) { + if (typeof object.gcsOutputConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DocumentOutputConfig.gcsOutputConfig: object expected"); + message.gcsOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.fromObject(object.gcsOutputConfig); + } + return message; + }; + + /** + * Creates a plain object from a DocumentOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @static + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig} message DocumentOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputConfig != null && message.hasOwnProperty("gcsOutputConfig")) { + object.gcsOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.toObject(message.gcsOutputConfig, options); + if (options.oneofs) + object.destination = "gcsOutputConfig"; + } + return object; + }; + + /** + * Converts this DocumentOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @instance + * @returns {Object.} JSON object + */ + DocumentOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentOutputConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentOutputConfig"; + }; + + DocumentOutputConfig.GcsOutputConfig = (function() { + + /** + * Properties of a GcsOutputConfig. + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @interface IGcsOutputConfig + * @property {string|null} [gcsUri] GcsOutputConfig gcsUri + * @property {google.protobuf.IFieldMask|null} [fieldMask] GcsOutputConfig fieldMask + * @property {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null} [shardingConfig] GcsOutputConfig shardingConfig + */ + + /** + * Constructs a new GcsOutputConfig. + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig + * @classdesc Represents a GcsOutputConfig. + * @implements IGcsOutputConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig=} [properties] Properties to set + */ + function GcsOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsOutputConfig gcsUri. + * @member {string} gcsUri + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @instance + */ + GcsOutputConfig.prototype.gcsUri = ""; + + /** + * GcsOutputConfig fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @instance + */ + GcsOutputConfig.prototype.fieldMask = null; + + /** + * GcsOutputConfig shardingConfig. + * @member {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null|undefined} shardingConfig + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @instance + */ + GcsOutputConfig.prototype.shardingConfig = null; + + /** + * Creates a new GcsOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig instance + */ + GcsOutputConfig.create = function create(properties) { + return new GcsOutputConfig(properties); + }; + + /** + * Encodes the specified GcsOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig} message GcsOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.shardingConfig != null && Object.hasOwnProperty.call(message, "shardingConfig")) + $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.encode(message.shardingConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GcsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig} message GcsOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputConfig.decode = function decode(reader, 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.v1beta3.DocumentOutputConfig.GcsOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsUri = reader.string(); + break; + } + case 2: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.shardingConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsOutputConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + if (!$util.isString(message.gcsUri)) + return "gcsUri: string expected"; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.shardingConfig != null && message.hasOwnProperty("shardingConfig")) { + var error = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify(message.shardingConfig); + if (error) + return "shardingConfig." + error; + } + return null; + }; + + /** + * Creates a GcsOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig + */ + GcsOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig(); + if (object.gcsUri != null) + message.gcsUri = String(object.gcsUri); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.shardingConfig != null) { + if (typeof object.shardingConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.shardingConfig: object expected"); + message.shardingConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.fromObject(object.shardingConfig); + } + return message; + }; + + /** + * Creates a plain object from a GcsOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} message GcsOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsUri = ""; + object.fieldMask = null; + object.shardingConfig = null; + } + if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) + object.gcsUri = message.gcsUri; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.shardingConfig != null && message.hasOwnProperty("shardingConfig")) + object.shardingConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.toObject(message.shardingConfig, options); + return object; + }; + + /** + * Converts this GcsOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @instance + * @returns {Object.} JSON object + */ + GcsOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsOutputConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig"; + }; + + GcsOutputConfig.ShardingConfig = (function() { + + /** + * Properties of a ShardingConfig. + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @interface IShardingConfig + * @property {number|null} [pagesPerShard] ShardingConfig pagesPerShard + * @property {number|null} [pagesOverlap] ShardingConfig pagesOverlap + */ + + /** + * Constructs a new ShardingConfig. + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig + * @classdesc Represents a ShardingConfig. + * @implements IShardingConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig=} [properties] Properties to set + */ + function ShardingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShardingConfig pagesPerShard. + * @member {number} pagesPerShard + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @instance + */ + ShardingConfig.prototype.pagesPerShard = 0; + + /** + * ShardingConfig pagesOverlap. + * @member {number} pagesOverlap + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @instance + */ + ShardingConfig.prototype.pagesOverlap = 0; + + /** + * Creates a new ShardingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig instance + */ + ShardingConfig.create = function create(properties) { + return new ShardingConfig(properties); + }; + + /** + * Encodes the specified ShardingConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig} message ShardingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pagesPerShard != null && Object.hasOwnProperty.call(message, "pagesPerShard")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pagesPerShard); + if (message.pagesOverlap != null && Object.hasOwnProperty.call(message, "pagesOverlap")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pagesOverlap); + return writer; + }; + + /** + * Encodes the specified ShardingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig} message ShardingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShardingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardingConfig.decode = function decode(reader, 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.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pagesPerShard = reader.int32(); + break; + } + case 2: { + message.pagesOverlap = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShardingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShardingConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShardingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pagesPerShard != null && message.hasOwnProperty("pagesPerShard")) + if (!$util.isInteger(message.pagesPerShard)) + return "pagesPerShard: integer expected"; + if (message.pagesOverlap != null && message.hasOwnProperty("pagesOverlap")) + if (!$util.isInteger(message.pagesOverlap)) + return "pagesOverlap: integer expected"; + return null; + }; + + /** + * Creates a ShardingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig + */ + ShardingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig(); + if (object.pagesPerShard != null) + message.pagesPerShard = object.pagesPerShard | 0; + if (object.pagesOverlap != null) + message.pagesOverlap = object.pagesOverlap | 0; + return message; + }; + + /** + * Creates a plain object from a ShardingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} message ShardingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShardingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pagesPerShard = 0; + object.pagesOverlap = 0; + } + if (message.pagesPerShard != null && message.hasOwnProperty("pagesPerShard")) + object.pagesPerShard = message.pagesPerShard; + if (message.pagesOverlap != null && message.hasOwnProperty("pagesOverlap")) + object.pagesOverlap = message.pagesOverlap; + return object; + }; + + /** + * Converts this ShardingConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @instance + * @returns {Object.} JSON object + */ + ShardingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShardingConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig"; + }; + + return ShardingConfig; + })(); + + return GcsOutputConfig; + })(); + + return DocumentOutputConfig; + })(); + + v1beta3.OcrConfig = (function() { + + /** + * Properties of an OcrConfig. + * @memberof google.cloud.documentai.v1beta3 + * @interface IOcrConfig + * @property {google.cloud.documentai.v1beta3.OcrConfig.IHints|null} [hints] OcrConfig hints + * @property {boolean|null} [enableNativePdfParsing] OcrConfig enableNativePdfParsing + * @property {boolean|null} [enableImageQualityScores] OcrConfig enableImageQualityScores + * @property {Array.|null} [advancedOcrOptions] OcrConfig advancedOcrOptions + * @property {boolean|null} [enableSymbol] OcrConfig enableSymbol + * @property {boolean|null} [computeStyleInfo] OcrConfig computeStyleInfo + * @property {boolean|null} [disableCharacterBoxesDetection] OcrConfig disableCharacterBoxesDetection + * @property {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures|null} [premiumFeatures] OcrConfig premiumFeatures + */ + + /** + * Constructs a new OcrConfig. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an OcrConfig. + * @implements IOcrConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.IOcrConfig=} [properties] Properties to set + */ + function OcrConfig(properties) { + this.advancedOcrOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OcrConfig hints. + * @member {google.cloud.documentai.v1beta3.OcrConfig.IHints|null|undefined} hints + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.hints = null; + + /** + * OcrConfig enableNativePdfParsing. + * @member {boolean} enableNativePdfParsing + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.enableNativePdfParsing = false; + + /** + * OcrConfig enableImageQualityScores. + * @member {boolean} enableImageQualityScores + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.enableImageQualityScores = false; + + /** + * OcrConfig advancedOcrOptions. + * @member {Array.} advancedOcrOptions + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.advancedOcrOptions = $util.emptyArray; + + /** + * OcrConfig enableSymbol. + * @member {boolean} enableSymbol + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.enableSymbol = false; + + /** + * OcrConfig computeStyleInfo. + * @member {boolean} computeStyleInfo + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.computeStyleInfo = false; + + /** + * OcrConfig disableCharacterBoxesDetection. + * @member {boolean} disableCharacterBoxesDetection + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.disableCharacterBoxesDetection = false; + + /** + * OcrConfig premiumFeatures. + * @member {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures|null|undefined} premiumFeatures + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + */ + OcrConfig.prototype.premiumFeatures = null; + + /** + * Creates a new OcrConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {google.cloud.documentai.v1beta3.IOcrConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig instance + */ + OcrConfig.create = function create(properties) { + return new OcrConfig(properties); + }; + + /** + * Encodes the specified OcrConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {google.cloud.documentai.v1beta3.IOcrConfig} message OcrConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OcrConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hints != null && Object.hasOwnProperty.call(message, "hints")) + $root.google.cloud.documentai.v1beta3.OcrConfig.Hints.encode(message.hints, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.enableNativePdfParsing != null && Object.hasOwnProperty.call(message, "enableNativePdfParsing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableNativePdfParsing); + if (message.enableImageQualityScores != null && Object.hasOwnProperty.call(message, "enableImageQualityScores")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableImageQualityScores); + if (message.advancedOcrOptions != null && message.advancedOcrOptions.length) + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.advancedOcrOptions[i]); + if (message.enableSymbol != null && Object.hasOwnProperty.call(message, "enableSymbol")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableSymbol); + if (message.computeStyleInfo != null && Object.hasOwnProperty.call(message, "computeStyleInfo")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.computeStyleInfo); + if (message.disableCharacterBoxesDetection != null && Object.hasOwnProperty.call(message, "disableCharacterBoxesDetection")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.disableCharacterBoxesDetection); + if (message.premiumFeatures != null && Object.hasOwnProperty.call(message, "premiumFeatures")) + $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.encode(message.premiumFeatures, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OcrConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {google.cloud.documentai.v1beta3.IOcrConfig} message OcrConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OcrConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OcrConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OcrConfig.decode = function decode(reader, 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.v1beta3.OcrConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.hints = $root.google.cloud.documentai.v1beta3.OcrConfig.Hints.decode(reader, reader.uint32()); + break; + } + case 3: { + message.enableNativePdfParsing = reader.bool(); + break; + } + case 4: { + message.enableImageQualityScores = reader.bool(); + break; + } + case 5: { + if (!(message.advancedOcrOptions && message.advancedOcrOptions.length)) + message.advancedOcrOptions = []; + message.advancedOcrOptions.push(reader.string()); + break; + } + case 6: { + message.enableSymbol = reader.bool(); + break; + } + case 8: { + message.computeStyleInfo = reader.bool(); + break; + } + case 10: { + message.disableCharacterBoxesDetection = reader.bool(); + break; + } + case 11: { + message.premiumFeatures = $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OcrConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OcrConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OcrConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OcrConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hints != null && message.hasOwnProperty("hints")) { + var error = $root.google.cloud.documentai.v1beta3.OcrConfig.Hints.verify(message.hints); + if (error) + return "hints." + error; + } + if (message.enableNativePdfParsing != null && message.hasOwnProperty("enableNativePdfParsing")) + if (typeof message.enableNativePdfParsing !== "boolean") + return "enableNativePdfParsing: boolean expected"; + if (message.enableImageQualityScores != null && message.hasOwnProperty("enableImageQualityScores")) + if (typeof message.enableImageQualityScores !== "boolean") + return "enableImageQualityScores: boolean expected"; + if (message.advancedOcrOptions != null && message.hasOwnProperty("advancedOcrOptions")) { + if (!Array.isArray(message.advancedOcrOptions)) + return "advancedOcrOptions: array expected"; + for (var i = 0; i < message.advancedOcrOptions.length; ++i) + if (!$util.isString(message.advancedOcrOptions[i])) + return "advancedOcrOptions: string[] expected"; + } + if (message.enableSymbol != null && message.hasOwnProperty("enableSymbol")) + if (typeof message.enableSymbol !== "boolean") + return "enableSymbol: boolean expected"; + if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) + if (typeof message.computeStyleInfo !== "boolean") + return "computeStyleInfo: boolean expected"; + if (message.disableCharacterBoxesDetection != null && message.hasOwnProperty("disableCharacterBoxesDetection")) + if (typeof message.disableCharacterBoxesDetection !== "boolean") + return "disableCharacterBoxesDetection: boolean expected"; + if (message.premiumFeatures != null && message.hasOwnProperty("premiumFeatures")) { + var error = $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify(message.premiumFeatures); + if (error) + return "premiumFeatures." + error; + } + return null; + }; + + /** + * Creates an OcrConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig + */ + OcrConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.OcrConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.OcrConfig(); + if (object.hints != null) { + if (typeof object.hints !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.OcrConfig.hints: object expected"); + message.hints = $root.google.cloud.documentai.v1beta3.OcrConfig.Hints.fromObject(object.hints); + } + if (object.enableNativePdfParsing != null) + message.enableNativePdfParsing = Boolean(object.enableNativePdfParsing); + if (object.enableImageQualityScores != null) + message.enableImageQualityScores = Boolean(object.enableImageQualityScores); + if (object.advancedOcrOptions) { + if (!Array.isArray(object.advancedOcrOptions)) + throw TypeError(".google.cloud.documentai.v1beta3.OcrConfig.advancedOcrOptions: array expected"); + message.advancedOcrOptions = []; + for (var i = 0; i < object.advancedOcrOptions.length; ++i) + message.advancedOcrOptions[i] = String(object.advancedOcrOptions[i]); + } + if (object.enableSymbol != null) + message.enableSymbol = Boolean(object.enableSymbol); + if (object.computeStyleInfo != null) + message.computeStyleInfo = Boolean(object.computeStyleInfo); + if (object.disableCharacterBoxesDetection != null) + message.disableCharacterBoxesDetection = Boolean(object.disableCharacterBoxesDetection); + if (object.premiumFeatures != null) { + if (typeof object.premiumFeatures !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.OcrConfig.premiumFeatures: object expected"); + message.premiumFeatures = $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.fromObject(object.premiumFeatures); + } + return message; + }; + + /** + * Creates a plain object from an OcrConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig} message OcrConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OcrConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.advancedOcrOptions = []; + if (options.defaults) { + object.hints = null; + object.enableNativePdfParsing = false; + object.enableImageQualityScores = false; + object.enableSymbol = false; + object.computeStyleInfo = false; + object.disableCharacterBoxesDetection = false; + object.premiumFeatures = null; + } + if (message.hints != null && message.hasOwnProperty("hints")) + object.hints = $root.google.cloud.documentai.v1beta3.OcrConfig.Hints.toObject(message.hints, options); + if (message.enableNativePdfParsing != null && message.hasOwnProperty("enableNativePdfParsing")) + object.enableNativePdfParsing = message.enableNativePdfParsing; + if (message.enableImageQualityScores != null && message.hasOwnProperty("enableImageQualityScores")) + object.enableImageQualityScores = message.enableImageQualityScores; + if (message.advancedOcrOptions && message.advancedOcrOptions.length) { + object.advancedOcrOptions = []; + for (var j = 0; j < message.advancedOcrOptions.length; ++j) + object.advancedOcrOptions[j] = message.advancedOcrOptions[j]; + } + if (message.enableSymbol != null && message.hasOwnProperty("enableSymbol")) + object.enableSymbol = message.enableSymbol; + if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) + object.computeStyleInfo = message.computeStyleInfo; + if (message.disableCharacterBoxesDetection != null && message.hasOwnProperty("disableCharacterBoxesDetection")) + object.disableCharacterBoxesDetection = message.disableCharacterBoxesDetection; + if (message.premiumFeatures != null && message.hasOwnProperty("premiumFeatures")) + object.premiumFeatures = $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.toObject(message.premiumFeatures, options); + return object; + }; + + /** + * Converts this OcrConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @instance + * @returns {Object.} JSON object + */ + OcrConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OcrConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OcrConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.OcrConfig"; + }; + + OcrConfig.Hints = (function() { + + /** + * Properties of a Hints. + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @interface IHints + * @property {Array.|null} [languageHints] Hints languageHints + */ + + /** + * Constructs a new Hints. + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @classdesc Represents a Hints. + * @implements IHints + * @constructor + * @param {google.cloud.documentai.v1beta3.OcrConfig.IHints=} [properties] Properties to set + */ + function Hints(properties) { + this.languageHints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Hints languageHints. + * @member {Array.} languageHints + * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints + * @instance + */ + Hints.prototype.languageHints = $util.emptyArray; + + /** + * Creates a new Hints instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig.IHints=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.OcrConfig.Hints} Hints instance + */ + Hints.create = function create(properties) { + return new Hints(properties); + }; + + /** + * Encodes the specified Hints message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.Hints.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig.IHints} message Hints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageHints != null && message.languageHints.length) + for (var i = 0; i < message.languageHints.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageHints[i]); + return writer; + }; + + /** + * Encodes the specified Hints message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.Hints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig.IHints} message Hints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Hints message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.OcrConfig.Hints} Hints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hints.decode = function decode(reader, 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.v1beta3.OcrConfig.Hints(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.languageHints && message.languageHints.length)) + message.languageHints = []; + message.languageHints.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Hints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.OcrConfig.Hints} Hints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Hints message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Hints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageHints != null && message.hasOwnProperty("languageHints")) { + if (!Array.isArray(message.languageHints)) + return "languageHints: array expected"; + for (var i = 0; i < message.languageHints.length; ++i) + if (!$util.isString(message.languageHints[i])) + return "languageHints: string[] expected"; + } + return null; + }; + + /** + * Creates a Hints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.OcrConfig.Hints} Hints + */ + Hints.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.OcrConfig.Hints) + return object; + var message = new $root.google.cloud.documentai.v1beta3.OcrConfig.Hints(); + if (object.languageHints) { + if (!Array.isArray(object.languageHints)) + throw TypeError(".google.cloud.documentai.v1beta3.OcrConfig.Hints.languageHints: array expected"); + message.languageHints = []; + for (var i = 0; i < object.languageHints.length; ++i) + message.languageHints[i] = String(object.languageHints[i]); + } + return message; + }; + + /** + * Creates a plain object from a Hints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig.Hints} message Hints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Hints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.languageHints = []; + if (message.languageHints && message.languageHints.length) { + object.languageHints = []; + for (var j = 0; j < message.languageHints.length; ++j) + object.languageHints[j] = message.languageHints[j]; + } + return object; + }; + + /** + * Converts this Hints to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints + * @instance + * @returns {Object.} JSON object + */ + Hints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Hints + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Hints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.OcrConfig.Hints"; + }; + + return Hints; + })(); + + OcrConfig.PremiumFeatures = (function() { + + /** + * Properties of a PremiumFeatures. + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @interface IPremiumFeatures + * @property {boolean|null} [enableSelectionMarkDetection] PremiumFeatures enableSelectionMarkDetection + * @property {boolean|null} [computeStyleInfo] PremiumFeatures computeStyleInfo + * @property {boolean|null} [enableMathOcr] PremiumFeatures enableMathOcr + */ + + /** + * Constructs a new PremiumFeatures. + * @memberof google.cloud.documentai.v1beta3.OcrConfig + * @classdesc Represents a PremiumFeatures. + * @implements IPremiumFeatures + * @constructor + * @param {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures=} [properties] Properties to set + */ + function PremiumFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PremiumFeatures enableSelectionMarkDetection. + * @member {boolean} enableSelectionMarkDetection + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @instance + */ + PremiumFeatures.prototype.enableSelectionMarkDetection = false; + + /** + * PremiumFeatures computeStyleInfo. + * @member {boolean} computeStyleInfo + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @instance + */ + PremiumFeatures.prototype.computeStyleInfo = false; + + /** + * PremiumFeatures enableMathOcr. + * @member {boolean} enableMathOcr + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @instance + */ + PremiumFeatures.prototype.enableMathOcr = false; + + /** + * Creates a new PremiumFeatures instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} PremiumFeatures instance + */ + PremiumFeatures.create = function create(properties) { + return new PremiumFeatures(properties); + }; + + /** + * Encodes the specified PremiumFeatures message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures} message PremiumFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PremiumFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableSelectionMarkDetection != null && Object.hasOwnProperty.call(message, "enableSelectionMarkDetection")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableSelectionMarkDetection); + if (message.computeStyleInfo != null && Object.hasOwnProperty.call(message, "computeStyleInfo")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.computeStyleInfo); + if (message.enableMathOcr != null && Object.hasOwnProperty.call(message, "enableMathOcr")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableMathOcr); + return writer; + }; + + /** + * Encodes the specified PremiumFeatures message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures} message PremiumFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PremiumFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PremiumFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} PremiumFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PremiumFeatures.decode = function decode(reader, 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.v1beta3.OcrConfig.PremiumFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.enableSelectionMarkDetection = reader.bool(); + break; + } + case 4: { + message.computeStyleInfo = reader.bool(); + break; + } + case 5: { + message.enableMathOcr = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PremiumFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} PremiumFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PremiumFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PremiumFeatures message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PremiumFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableSelectionMarkDetection != null && message.hasOwnProperty("enableSelectionMarkDetection")) + if (typeof message.enableSelectionMarkDetection !== "boolean") + return "enableSelectionMarkDetection: boolean expected"; + if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) + if (typeof message.computeStyleInfo !== "boolean") + return "computeStyleInfo: boolean expected"; + if (message.enableMathOcr != null && message.hasOwnProperty("enableMathOcr")) + if (typeof message.enableMathOcr !== "boolean") + return "enableMathOcr: boolean expected"; + return null; + }; + + /** + * Creates a PremiumFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} PremiumFeatures + */ + PremiumFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures) + return object; + var message = new $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures(); + if (object.enableSelectionMarkDetection != null) + message.enableSelectionMarkDetection = Boolean(object.enableSelectionMarkDetection); + if (object.computeStyleInfo != null) + message.computeStyleInfo = Boolean(object.computeStyleInfo); + if (object.enableMathOcr != null) + message.enableMathOcr = Boolean(object.enableMathOcr); + return message; + }; + + /** + * Creates a plain object from a PremiumFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} message PremiumFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PremiumFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableSelectionMarkDetection = false; + object.computeStyleInfo = false; + object.enableMathOcr = false; + } + if (message.enableSelectionMarkDetection != null && message.hasOwnProperty("enableSelectionMarkDetection")) + object.enableSelectionMarkDetection = message.enableSelectionMarkDetection; + if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) + object.computeStyleInfo = message.computeStyleInfo; + if (message.enableMathOcr != null && message.hasOwnProperty("enableMathOcr")) + object.enableMathOcr = message.enableMathOcr; + return object; + }; + + /** + * Converts this PremiumFeatures to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @instance + * @returns {Object.} JSON object + */ + PremiumFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PremiumFeatures + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PremiumFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures"; + }; + + return PremiumFeatures; + })(); + + return OcrConfig; + })(); + + v1beta3.SummaryOptions = (function() { + + /** + * Properties of a SummaryOptions. + * @memberof google.cloud.documentai.v1beta3 + * @interface ISummaryOptions + * @property {google.cloud.documentai.v1beta3.SummaryOptions.Length|null} [length] SummaryOptions length + * @property {google.cloud.documentai.v1beta3.SummaryOptions.Format|null} [format] SummaryOptions format + */ + + /** + * Constructs a new SummaryOptions. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a SummaryOptions. + * @implements ISummaryOptions + * @constructor + * @param {google.cloud.documentai.v1beta3.ISummaryOptions=} [properties] Properties to set + */ + function SummaryOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SummaryOptions length. + * @member {google.cloud.documentai.v1beta3.SummaryOptions.Length} length + * @memberof google.cloud.documentai.v1beta3.SummaryOptions + * @instance + */ + SummaryOptions.prototype.length = 0; + + /** + * SummaryOptions format. + * @member {google.cloud.documentai.v1beta3.SummaryOptions.Format} format + * @memberof google.cloud.documentai.v1beta3.SummaryOptions + * @instance + */ + SummaryOptions.prototype.format = 0; + + /** + * Creates a new SummaryOptions instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.SummaryOptions + * @static + * @param {google.cloud.documentai.v1beta3.ISummaryOptions=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.SummaryOptions} SummaryOptions instance + */ + SummaryOptions.create = function create(properties) { + return new SummaryOptions(properties); + }; + + /** + * Encodes the specified SummaryOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.SummaryOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.SummaryOptions + * @static + * @param {google.cloud.documentai.v1beta3.ISummaryOptions} message SummaryOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummaryOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.length != null && Object.hasOwnProperty.call(message, "length")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.length); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.format); + return writer; + }; + + /** + * Encodes the specified SummaryOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SummaryOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.SummaryOptions + * @static + * @param {google.cloud.documentai.v1beta3.ISummaryOptions} message SummaryOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummaryOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SummaryOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.SummaryOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.SummaryOptions} SummaryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummaryOptions.decode = function decode(reader, 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.v1beta3.SummaryOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.length = reader.int32(); + break; + } + case 2: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SummaryOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.SummaryOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.SummaryOptions} SummaryOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummaryOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SummaryOptions message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.SummaryOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SummaryOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.length != null && message.hasOwnProperty("length")) + switch (message.length) { + default: + return "length: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a SummaryOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.SummaryOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.SummaryOptions} SummaryOptions + */ + SummaryOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.SummaryOptions) + return object; + var message = new $root.google.cloud.documentai.v1beta3.SummaryOptions(); + switch (object.length) { + default: + if (typeof object.length === "number") { + message.length = object.length; + break; + } + break; + case "LENGTH_UNSPECIFIED": + case 0: + message.length = 0; + break; + case "BRIEF": + case 1: + message.length = 1; + break; + case "MODERATE": + case 2: + message.length = 2; + break; + case "COMPREHENSIVE": + case 3: + message.length = 3; + break; + } + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "PARAGRAPH": + case 1: + message.format = 1; + break; + case "BULLETS": + case 2: + message.format = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SummaryOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.SummaryOptions + * @static + * @param {google.cloud.documentai.v1beta3.SummaryOptions} message SummaryOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SummaryOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.length = options.enums === String ? "LENGTH_UNSPECIFIED" : 0; + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + } + if (message.length != null && message.hasOwnProperty("length")) + object.length = options.enums === String ? $root.google.cloud.documentai.v1beta3.SummaryOptions.Length[message.length] === undefined ? message.length : $root.google.cloud.documentai.v1beta3.SummaryOptions.Length[message.length] : message.length; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.cloud.documentai.v1beta3.SummaryOptions.Format[message.format] === undefined ? message.format : $root.google.cloud.documentai.v1beta3.SummaryOptions.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this SummaryOptions to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.SummaryOptions + * @instance + * @returns {Object.} JSON object + */ + SummaryOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SummaryOptions + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.SummaryOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SummaryOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.SummaryOptions"; + }; + + /** + * Length enum. + * @name google.cloud.documentai.v1beta3.SummaryOptions.Length + * @enum {number} + * @property {number} LENGTH_UNSPECIFIED=0 LENGTH_UNSPECIFIED value + * @property {number} BRIEF=1 BRIEF value + * @property {number} MODERATE=2 MODERATE value + * @property {number} COMPREHENSIVE=3 COMPREHENSIVE value + */ + SummaryOptions.Length = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LENGTH_UNSPECIFIED"] = 0; + values[valuesById[1] = "BRIEF"] = 1; + values[valuesById[2] = "MODERATE"] = 2; + values[valuesById[3] = "COMPREHENSIVE"] = 3; + return values; + })(); + + /** + * Format enum. + * @name google.cloud.documentai.v1beta3.SummaryOptions.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} PARAGRAPH=1 PARAGRAPH value + * @property {number} BULLETS=2 BULLETS value + */ + SummaryOptions.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARAGRAPH"] = 1; + values[valuesById[2] = "BULLETS"] = 2; + return values; + })(); + + return SummaryOptions; + })(); + + v1beta3.FieldExtractionMetadata = (function() { + + /** + * Properties of a FieldExtractionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IFieldExtractionMetadata + * @property {google.cloud.documentai.v1beta3.ISummaryOptions|null} [summaryOptions] FieldExtractionMetadata summaryOptions + */ + + /** + * Constructs a new FieldExtractionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a FieldExtractionMetadata. + * @implements IFieldExtractionMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IFieldExtractionMetadata=} [properties] Properties to set + */ + function FieldExtractionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldExtractionMetadata summaryOptions. + * @member {google.cloud.documentai.v1beta3.ISummaryOptions|null|undefined} summaryOptions + * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata + * @instance + */ + FieldExtractionMetadata.prototype.summaryOptions = null; + + /** + * Creates a new FieldExtractionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IFieldExtractionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.FieldExtractionMetadata} FieldExtractionMetadata instance + */ + FieldExtractionMetadata.create = function create(properties) { + return new FieldExtractionMetadata(properties); + }; + + /** + * Encodes the specified FieldExtractionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.FieldExtractionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IFieldExtractionMetadata} message FieldExtractionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldExtractionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.summaryOptions != null && Object.hasOwnProperty.call(message, "summaryOptions")) + $root.google.cloud.documentai.v1beta3.SummaryOptions.encode(message.summaryOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldExtractionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.FieldExtractionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IFieldExtractionMetadata} message FieldExtractionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldExtractionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldExtractionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.FieldExtractionMetadata} FieldExtractionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldExtractionMetadata.decode = function decode(reader, 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.v1beta3.FieldExtractionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.summaryOptions = $root.google.cloud.documentai.v1beta3.SummaryOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldExtractionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.FieldExtractionMetadata} FieldExtractionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldExtractionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldExtractionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldExtractionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.summaryOptions != null && message.hasOwnProperty("summaryOptions")) { + var error = $root.google.cloud.documentai.v1beta3.SummaryOptions.verify(message.summaryOptions); + if (error) + return "summaryOptions." + error; + } + return null; + }; + + /** + * Creates a FieldExtractionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.FieldExtractionMetadata} FieldExtractionMetadata + */ + FieldExtractionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata(); + if (object.summaryOptions != null) { + if (typeof object.summaryOptions !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.FieldExtractionMetadata.summaryOptions: object expected"); + message.summaryOptions = $root.google.cloud.documentai.v1beta3.SummaryOptions.fromObject(object.summaryOptions); + } + return message; + }; + + /** + * Creates a plain object from a FieldExtractionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.FieldExtractionMetadata} message FieldExtractionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldExtractionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.summaryOptions = null; + if (message.summaryOptions != null && message.hasOwnProperty("summaryOptions")) + object.summaryOptions = $root.google.cloud.documentai.v1beta3.SummaryOptions.toObject(message.summaryOptions, options); + return object; + }; + + /** + * Converts this FieldExtractionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata + * @instance + * @returns {Object.} JSON object + */ + FieldExtractionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldExtractionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldExtractionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.FieldExtractionMetadata"; + }; + + return FieldExtractionMetadata; + })(); + + v1beta3.PropertyMetadata = (function() { + + /** + * Properties of a PropertyMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IPropertyMetadata + * @property {boolean|null} [inactive] PropertyMetadata inactive + * @property {google.cloud.documentai.v1beta3.IFieldExtractionMetadata|null} [fieldExtractionMetadata] PropertyMetadata fieldExtractionMetadata + */ + + /** + * Constructs a new PropertyMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a PropertyMetadata. + * @implements IPropertyMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IPropertyMetadata=} [properties] Properties to set + */ + function PropertyMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PropertyMetadata inactive. + * @member {boolean} inactive + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @instance + */ + PropertyMetadata.prototype.inactive = false; + + /** + * PropertyMetadata fieldExtractionMetadata. + * @member {google.cloud.documentai.v1beta3.IFieldExtractionMetadata|null|undefined} fieldExtractionMetadata + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @instance + */ + PropertyMetadata.prototype.fieldExtractionMetadata = null; + + /** + * Creates a new PropertyMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IPropertyMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.PropertyMetadata} PropertyMetadata instance + */ + PropertyMetadata.create = function create(properties) { + return new PropertyMetadata(properties); + }; + + /** + * Encodes the specified PropertyMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.PropertyMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IPropertyMetadata} message PropertyMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inactive != null && Object.hasOwnProperty.call(message, "inactive")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.inactive); + if (message.fieldExtractionMetadata != null && Object.hasOwnProperty.call(message, "fieldExtractionMetadata")) + $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata.encode(message.fieldExtractionMetadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PropertyMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.PropertyMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IPropertyMetadata} message PropertyMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PropertyMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PropertyMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.PropertyMetadata} PropertyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyMetadata.decode = function decode(reader, 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.v1beta3.PropertyMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.inactive = reader.bool(); + break; + } + case 9: { + message.fieldExtractionMetadata = $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PropertyMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.PropertyMetadata} PropertyMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PropertyMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PropertyMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inactive != null && message.hasOwnProperty("inactive")) + if (typeof message.inactive !== "boolean") + return "inactive: boolean expected"; + if (message.fieldExtractionMetadata != null && message.hasOwnProperty("fieldExtractionMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata.verify(message.fieldExtractionMetadata); + if (error) + return "fieldExtractionMetadata." + error; + } + return null; + }; + + /** + * Creates a PropertyMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.PropertyMetadata} PropertyMetadata + */ + PropertyMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.PropertyMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.PropertyMetadata(); + if (object.inactive != null) + message.inactive = Boolean(object.inactive); + if (object.fieldExtractionMetadata != null) { + if (typeof object.fieldExtractionMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.PropertyMetadata.fieldExtractionMetadata: object expected"); + message.fieldExtractionMetadata = $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata.fromObject(object.fieldExtractionMetadata); + } + return message; + }; + + /** + * Creates a plain object from a PropertyMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @static + * @param {google.cloud.documentai.v1beta3.PropertyMetadata} message PropertyMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PropertyMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inactive = false; + object.fieldExtractionMetadata = null; + } + if (message.inactive != null && message.hasOwnProperty("inactive")) + object.inactive = message.inactive; + if (message.fieldExtractionMetadata != null && message.hasOwnProperty("fieldExtractionMetadata")) + object.fieldExtractionMetadata = $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata.toObject(message.fieldExtractionMetadata, options); + return object; + }; + + /** + * Converts this PropertyMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @instance + * @returns {Object.} JSON object + */ + PropertyMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PropertyMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.PropertyMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PropertyMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.PropertyMetadata"; + }; + + return PropertyMetadata; + })(); + + v1beta3.EntityTypeMetadata = (function() { + + /** + * Properties of an EntityTypeMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IEntityTypeMetadata + * @property {boolean|null} [inactive] EntityTypeMetadata inactive + */ + + /** + * Constructs a new EntityTypeMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an EntityTypeMetadata. + * @implements IEntityTypeMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IEntityTypeMetadata=} [properties] Properties to set + */ + function EntityTypeMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EntityTypeMetadata inactive. + * @member {boolean} inactive + * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata + * @instance + */ + EntityTypeMetadata.prototype.inactive = false; + + /** + * Creates a new EntityTypeMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IEntityTypeMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.EntityTypeMetadata} EntityTypeMetadata instance + */ + EntityTypeMetadata.create = function create(properties) { + return new EntityTypeMetadata(properties); + }; + + /** + * Encodes the specified EntityTypeMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.EntityTypeMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IEntityTypeMetadata} message EntityTypeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityTypeMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inactive != null && Object.hasOwnProperty.call(message, "inactive")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.inactive); + return writer; + }; + + /** + * Encodes the specified EntityTypeMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EntityTypeMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IEntityTypeMetadata} message EntityTypeMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityTypeMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityTypeMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.EntityTypeMetadata} EntityTypeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityTypeMetadata.decode = function decode(reader, 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.v1beta3.EntityTypeMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.inactive = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityTypeMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.EntityTypeMetadata} EntityTypeMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityTypeMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityTypeMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityTypeMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inactive != null && message.hasOwnProperty("inactive")) + if (typeof message.inactive !== "boolean") + return "inactive: boolean expected"; + return null; + }; + + /** + * Creates an EntityTypeMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.EntityTypeMetadata} EntityTypeMetadata + */ + EntityTypeMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.EntityTypeMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.EntityTypeMetadata(); + if (object.inactive != null) + message.inactive = Boolean(object.inactive); + return message; + }; + + /** + * Creates a plain object from an EntityTypeMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata + * @static + * @param {google.cloud.documentai.v1beta3.EntityTypeMetadata} message EntityTypeMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityTypeMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inactive = false; + if (message.inactive != null && message.hasOwnProperty("inactive")) + object.inactive = message.inactive; + return object; + }; + + /** + * Converts this EntityTypeMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata + * @instance + * @returns {Object.} JSON object + */ + EntityTypeMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityTypeMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityTypeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EntityTypeMetadata"; + }; + + return EntityTypeMetadata; + })(); + + v1beta3.DocumentSchema = (function() { + + /** + * Properties of a DocumentSchema. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDocumentSchema + * @property {string|null} [displayName] DocumentSchema displayName + * @property {string|null} [description] DocumentSchema description + * @property {Array.|null} [entityTypes] DocumentSchema entityTypes + * @property {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null} [metadata] DocumentSchema metadata + * @property {string|null} [documentPrompt] DocumentSchema documentPrompt + */ + + /** + * Constructs a new DocumentSchema. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DocumentSchema. + * @implements IDocumentSchema + * @constructor + * @param {google.cloud.documentai.v1beta3.IDocumentSchema=} [properties] Properties to set + */ + function DocumentSchema(properties) { + this.entityTypes = []; + if (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 displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @instance + */ + DocumentSchema.prototype.displayName = ""; + + /** + * DocumentSchema description. + * @member {string} description + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @instance + */ + DocumentSchema.prototype.description = ""; + + /** + * DocumentSchema entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @instance + */ + DocumentSchema.prototype.entityTypes = $util.emptyArray; + + /** + * DocumentSchema metadata. + * @member {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null|undefined} metadata + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @instance + */ + DocumentSchema.prototype.metadata = null; + + /** + * DocumentSchema documentPrompt. + * @member {string} documentPrompt + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @instance + */ + DocumentSchema.prototype.documentPrompt = ""; + + /** + * Creates a new DocumentSchema instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentSchema=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentSchema} DocumentSchema instance + */ + DocumentSchema.create = function create(properties) { + return new DocumentSchema(properties); + }; + + /** + * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @static + * @param {google.cloud.documentai.v1beta3.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.documentPrompt != null && Object.hasOwnProperty.call(message, "documentPrompt")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.documentPrompt); + return writer; + }; + + /** + * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @static + * @param {google.cloud.documentai.v1beta3.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.documentai.v1beta3.DocumentSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.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.documentai.v1beta3.DocumentSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push($root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.decode(reader, reader.uint32())); + break; + } + case 4: { + message.metadata = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.decode(reader, reader.uint32()); + break; + } + case 5: { + message.documentPrompt = 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.documentai.v1beta3.DocumentSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.documentai.v1beta3.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.verify(message.entityTypes[i]); + if (error) + return "entityTypes." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.documentPrompt != null && message.hasOwnProperty("documentPrompt")) + if (!$util.isString(message.documentPrompt)) + return "documentPrompt: 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.documentai.v1beta3.DocumentSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentSchema} DocumentSchema + */ + DocumentSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentSchema) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentSchema(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) { + if (typeof object.entityTypes[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.entityTypes: object expected"); + message.entityTypes[i] = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.fromObject(object.entityTypes[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.metadata: object expected"); + message.metadata = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.fromObject(object.metadata); + } + if (object.documentPrompt != null) + message.documentPrompt = String(object.documentPrompt); + return message; + }; + + /** + * Creates a plain object from a DocumentSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @static + * @param {google.cloud.documentai.v1beta3.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.entityTypes = []; + if (options.defaults) { + object.displayName = ""; + object.description = ""; + object.metadata = null; + object.documentPrompt = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.toObject(message.entityTypes[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.toObject(message.metadata, options); + if (message.documentPrompt != null && message.hasOwnProperty("documentPrompt")) + object.documentPrompt = message.documentPrompt; + return object; + }; + + /** + * Converts this DocumentSchema to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.DocumentSchema"; + }; + + DocumentSchema.EntityType = (function() { + + /** + * Properties of an EntityType. + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @interface IEntityType + * @property {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues|null} [enumValues] EntityType enumValues + * @property {string|null} [displayName] EntityType displayName + * @property {string|null} [name] EntityType name + * @property {string|null} [description] EntityType description + * @property {Array.|null} [baseTypes] EntityType baseTypes + * @property {Array.|null} [properties] EntityType properties + * @property {google.cloud.documentai.v1beta3.IEntityTypeMetadata|null} [entityTypeMetadata] EntityType entityTypeMetadata + */ + + /** + * Constructs a new EntityType. + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @classdesc Represents an EntityType. + * @implements IEntityType + * @constructor + * @param {google.cloud.documentai.v1beta3.DocumentSchema.IEntityType=} [properties] Properties to set + */ + function EntityType(properties) { + this.baseTypes = []; + 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]]; + } + + /** + * EntityType enumValues. + * @member {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues|null|undefined} enumValues + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.enumValues = null; + + /** + * EntityType displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.displayName = ""; + + /** + * EntityType name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.name = ""; + + /** + * EntityType description. + * @member {string} description + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.description = ""; + + /** + * EntityType baseTypes. + * @member {Array.} baseTypes + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.baseTypes = $util.emptyArray; + + /** + * EntityType properties. + * @member {Array.} properties + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.properties = $util.emptyArray; + + /** + * EntityType entityTypeMetadata. + * @member {google.cloud.documentai.v1beta3.IEntityTypeMetadata|null|undefined} entityTypeMetadata + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + EntityType.prototype.entityTypeMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EntityType valueSource. + * @member {"enumValues"|undefined} valueSource + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + */ + Object.defineProperty(EntityType.prototype, "valueSource", { + get: $util.oneOfGetter($oneOfFields = ["enumValues"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EntityType instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.IEntityType=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType} EntityType instance + */ + EntityType.create = function create(properties) { + return new EntityType(properties); + }; + + /** + * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.IEntityType} message EntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityType.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.baseTypes != null && message.baseTypes.length) + for (var i = 0; i < message.baseTypes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseTypes[i]); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.encode(message.properties[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.entityTypeMetadata != null && Object.hasOwnProperty.call(message, "entityTypeMetadata")) + $root.google.cloud.documentai.v1beta3.EntityTypeMetadata.encode(message.entityTypeMetadata, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.displayName); + if (message.enumValues != null && Object.hasOwnProperty.call(message, "enumValues")) + $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.encode(message.enumValues, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.description); + return writer; + }; + + /** + * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.IEntityType} message EntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EntityType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType} EntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityType.decode = function decode(reader, 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.v1beta3.DocumentSchema.EntityType(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 14: { + message.enumValues = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.decode(reader, reader.uint32()); + break; + } + case 13: { + message.displayName = reader.string(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 15: { + message.description = reader.string(); + break; + } + case 2: { + if (!(message.baseTypes && message.baseTypes.length)) + message.baseTypes = []; + message.baseTypes.push(reader.string()); + break; + } + case 6: { + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.decode(reader, reader.uint32())); + break; + } + case 11: { + message.entityTypeMetadata = $root.google.cloud.documentai.v1beta3.EntityTypeMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EntityType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType} EntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityType message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enumValues != null && message.hasOwnProperty("enumValues")) { + properties.valueSource = 1; + { + var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.verify(message.enumValues); + if (error) + return "enumValues." + error; + } + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string 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.baseTypes != null && message.hasOwnProperty("baseTypes")) { + if (!Array.isArray(message.baseTypes)) + return "baseTypes: array expected"; + for (var i = 0; i < message.baseTypes.length; ++i) + if (!$util.isString(message.baseTypes[i])) + return "baseTypes: string[] 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.documentai.v1beta3.DocumentSchema.EntityType.Property.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + if (message.entityTypeMetadata != null && message.hasOwnProperty("entityTypeMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.EntityTypeMetadata.verify(message.entityTypeMetadata); + if (error) + return "entityTypeMetadata." + error; + } + return null; + }; + + /** + * Creates an EntityType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType} EntityType + */ + EntityType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType(); + if (object.enumValues != null) { + if (typeof object.enumValues !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.EntityType.enumValues: object expected"); + message.enumValues = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.fromObject(object.enumValues); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.baseTypes) { + if (!Array.isArray(object.baseTypes)) + throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.EntityType.baseTypes: array expected"); + message.baseTypes = []; + for (var i = 0; i < object.baseTypes.length; ++i) + message.baseTypes[i] = String(object.baseTypes[i]); + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.v1beta3.DocumentSchema.EntityType.properties: object expected"); + message.properties[i] = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.fromObject(object.properties[i]); + } + } + if (object.entityTypeMetadata != null) { + if (typeof object.entityTypeMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.EntityType.entityTypeMetadata: object expected"); + message.entityTypeMetadata = $root.google.cloud.documentai.v1beta3.EntityTypeMetadata.fromObject(object.entityTypeMetadata); + } + return message; + }; + + /** + * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType} message EntityType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.baseTypes = []; + object.properties = []; + } + if (options.defaults) { + object.name = ""; + object.entityTypeMetadata = null; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.baseTypes && message.baseTypes.length) { + object.baseTypes = []; + for (var j = 0; j < message.baseTypes.length; ++j) + object.baseTypes[j] = message.baseTypes[j]; + } + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.toObject(message.properties[j], options); + } + if (message.entityTypeMetadata != null && message.hasOwnProperty("entityTypeMetadata")) + object.entityTypeMetadata = $root.google.cloud.documentai.v1beta3.EntityTypeMetadata.toObject(message.entityTypeMetadata, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.enumValues != null && message.hasOwnProperty("enumValues")) { + object.enumValues = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.toObject(message.enumValues, options); + if (options.oneofs) + object.valueSource = "enumValues"; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this EntityType to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @instance + * @returns {Object.} JSON object + */ + EntityType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EntityType + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EntityType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentSchema.EntityType"; + }; + + EntityType.EnumValues = (function() { + + /** + * Properties of an EnumValues. + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @interface IEnumValues + * @property {Array.|null} [values] EnumValues values + */ + + /** + * Constructs a new EnumValues. + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @classdesc Represents an EnumValues. + * @implements IEnumValues + * @constructor + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues=} [properties] Properties to set + */ + function EnumValues(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]]; + } + + /** + * EnumValues values. + * @member {Array.} values + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + * @instance + */ + EnumValues.prototype.values = $util.emptyArray; + + /** + * Creates a new EnumValues instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} EnumValues instance + */ + EnumValues.create = function create(properties) { + return new EnumValues(properties); + }; + + /** + * Encodes the specified EnumValues message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues} message EnumValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValues.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 EnumValues message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues} message EnumValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} EnumValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValues.decode = function decode(reader, 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.v1beta3.DocumentSchema.EntityType.EnumValues(); + 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 EnumValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} EnumValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValues message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValues.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 EnumValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} EnumValues + */ + EnumValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.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 EnumValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} message EnumValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValues.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 EnumValues to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + * @instance + * @returns {Object.} JSON object + */ + EnumValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValues + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues"; + }; + + return EnumValues; + })(); + + EntityType.Property = (function() { + + /** + * Properties of a Property. + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @interface IProperty + * @property {string|null} [name] Property name + * @property {string|null} [description] Property description + * @property {string|null} [displayName] Property displayName + * @property {string|null} [valueType] Property valueType + * @property {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|null} [occurrenceType] Property occurrenceType + * @property {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method|null} [method] Property method + * @property {google.cloud.documentai.v1beta3.IPropertyMetadata|null} [propertyMetadata] Property propertyMetadata + */ + + /** + * Constructs a new Property. + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType + * @classdesc Represents a Property. + * @implements IProperty + * @constructor + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.Property + * @instance + */ + Property.prototype.name = ""; + + /** + * Property description. + * @member {string} description + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + * @instance + */ + Property.prototype.description = ""; + + /** + * Property displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + * @instance + */ + Property.prototype.displayName = ""; + + /** + * Property valueType. + * @member {string} valueType + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + * @instance + */ + Property.prototype.valueType = ""; + + /** + * Property occurrenceType. + * @member {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType} occurrenceType + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + * @instance + */ + Property.prototype.occurrenceType = 0; + + /** + * Property method. + * @member {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method} method + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + * @instance + */ + Property.prototype.method = 0; + + /** + * Property propertyMetadata. + * @member {google.cloud.documentai.v1beta3.IPropertyMetadata|null|undefined} propertyMetadata + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + * @instance + */ + Property.prototype.propertyMetadata = null; + + /** + * Creates a new Property instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property} Property instance + */ + Property.create = function create(properties) { + return new Property(properties); + }; + + /** + * Encodes the specified Property message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.valueType); + if (message.occurrenceType != null && Object.hasOwnProperty.call(message, "occurrenceType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.occurrenceType); + if (message.propertyMetadata != null && Object.hasOwnProperty.call(message, "propertyMetadata")) + $root.google.cloud.documentai.v1beta3.PropertyMetadata.encode(message.propertyMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.method); + return writer; + }; + + /** + * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.Property(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 7: { + message.description = reader.string(); + break; + } + case 6: { + message.displayName = reader.string(); + break; + } + case 2: { + message.valueType = reader.string(); + break; + } + case 3: { + message.occurrenceType = reader.int32(); + break; + } + case 8: { + message.method = reader.int32(); + break; + } + case 5: { + message.propertyMetadata = $root.google.cloud.documentai.v1beta3.PropertyMetadata.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.documentai.v1beta3.DocumentSchema.EntityType.Property + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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"; + 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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + if (!$util.isString(message.valueType)) + return "valueType: string expected"; + if (message.occurrenceType != null && message.hasOwnProperty("occurrenceType")) + switch (message.occurrenceType) { + default: + return "occurrenceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.method != null && message.hasOwnProperty("method")) + switch (message.method) { + default: + return "method: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.propertyMetadata != null && message.hasOwnProperty("propertyMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.PropertyMetadata.verify(message.propertyMetadata); + if (error) + return "propertyMetadata." + error; + } + return null; + }; + + /** + * Creates a Property message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property} Property + */ + Property.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.valueType != null) + message.valueType = String(object.valueType); + switch (object.occurrenceType) { + default: + if (typeof object.occurrenceType === "number") { + message.occurrenceType = object.occurrenceType; + break; + } + break; + case "OCCURRENCE_TYPE_UNSPECIFIED": + case 0: + message.occurrenceType = 0; + break; + case "OPTIONAL_ONCE": + case 1: + message.occurrenceType = 1; + break; + case "OPTIONAL_MULTIPLE": + case 2: + message.occurrenceType = 2; + break; + case "REQUIRED_ONCE": + case 3: + message.occurrenceType = 3; + break; + case "REQUIRED_MULTIPLE": + case 4: + message.occurrenceType = 4; + break; + } + 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; + } + if (object.propertyMetadata != null) { + if (typeof object.propertyMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.propertyMetadata: object expected"); + message.propertyMetadata = $root.google.cloud.documentai.v1beta3.PropertyMetadata.fromObject(object.propertyMetadata); + } + return message; + }; + + /** + * Creates a plain object from a Property message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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 = ""; + object.valueType = ""; + object.occurrenceType = options.enums === String ? "OCCURRENCE_TYPE_UNSPECIFIED" : 0; + object.propertyMetadata = null; + object.displayName = ""; + object.description = ""; + object.method = options.enums === String ? "METHOD_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = message.valueType; + if (message.occurrenceType != null && message.hasOwnProperty("occurrenceType")) + object.occurrenceType = options.enums === String ? $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] === undefined ? message.occurrenceType : $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] : message.occurrenceType; + if (message.propertyMetadata != null && message.hasOwnProperty("propertyMetadata")) + object.propertyMetadata = $root.google.cloud.documentai.v1beta3.PropertyMetadata.toObject(message.propertyMetadata, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.method != null && message.hasOwnProperty("method")) + object.method = options.enums === String ? $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method[message.method] === undefined ? message.method : $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method[message.method] : message.method; + return object; + }; + + /** + * Converts this Property to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.Property"; + }; + + /** + * OccurrenceType enum. + * @name google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType + * @enum {number} + * @property {number} OCCURRENCE_TYPE_UNSPECIFIED=0 OCCURRENCE_TYPE_UNSPECIFIED value + * @property {number} OPTIONAL_ONCE=1 OPTIONAL_ONCE value + * @property {number} OPTIONAL_MULTIPLE=2 OPTIONAL_MULTIPLE value + * @property {number} REQUIRED_ONCE=3 REQUIRED_ONCE value + * @property {number} REQUIRED_MULTIPLE=4 REQUIRED_MULTIPLE value + */ + Property.OccurrenceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OCCURRENCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL_ONCE"] = 1; + values[valuesById[2] = "OPTIONAL_MULTIPLE"] = 2; + values[valuesById[3] = "REQUIRED_ONCE"] = 3; + values[valuesById[4] = "REQUIRED_MULTIPLE"] = 4; + return values; + })(); + + /** + * Method enum. + * @name google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method + * @enum {number} + * @property {number} METHOD_UNSPECIFIED=0 METHOD_UNSPECIFIED value + * @property {number} EXTRACT=1 EXTRACT value + * @property {number} DERIVE=2 DERIVE value + */ + Property.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 Property; + })(); + + return EntityType; + })(); + + DocumentSchema.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @interface IMetadata + * @property {boolean|null} [documentSplitter] Metadata documentSplitter + * @property {boolean|null} [documentAllowMultipleLabels] Metadata documentAllowMultipleLabels + * @property {boolean|null} [prefixedNamingOnProperties] Metadata prefixedNamingOnProperties + * @property {boolean|null} [skipNamingValidation] Metadata skipNamingValidation + */ + + /** + * Constructs a new Metadata. + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metadata documentSplitter. + * @member {boolean} documentSplitter + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @instance + */ + Metadata.prototype.documentSplitter = false; + + /** + * Metadata documentAllowMultipleLabels. + * @member {boolean} documentAllowMultipleLabels + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @instance + */ + Metadata.prototype.documentAllowMultipleLabels = false; + + /** + * Metadata prefixedNamingOnProperties. + * @member {boolean} prefixedNamingOnProperties + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @instance + */ + Metadata.prototype.prefixedNamingOnProperties = false; + + /** + * Metadata skipNamingValidation. + * @member {boolean} skipNamingValidation + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @instance + */ + Metadata.prototype.skipNamingValidation = false; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentSplitter != null && Object.hasOwnProperty.call(message, "documentSplitter")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.documentSplitter); + if (message.documentAllowMultipleLabels != null && Object.hasOwnProperty.call(message, "documentAllowMultipleLabels")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.documentAllowMultipleLabels); + if (message.prefixedNamingOnProperties != null && Object.hasOwnProperty.call(message, "prefixedNamingOnProperties")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prefixedNamingOnProperties); + if (message.skipNamingValidation != null && Object.hasOwnProperty.call(message, "skipNamingValidation")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.skipNamingValidation); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, 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.v1beta3.DocumentSchema.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.documentSplitter = reader.bool(); + break; + } + case 2: { + message.documentAllowMultipleLabels = reader.bool(); + break; + } + case 6: { + message.prefixedNamingOnProperties = reader.bool(); + break; + } + case 7: { + message.skipNamingValidation = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentSplitter != null && message.hasOwnProperty("documentSplitter")) + if (typeof message.documentSplitter !== "boolean") + return "documentSplitter: boolean expected"; + if (message.documentAllowMultipleLabels != null && message.hasOwnProperty("documentAllowMultipleLabels")) + if (typeof message.documentAllowMultipleLabels !== "boolean") + return "documentAllowMultipleLabels: boolean expected"; + if (message.prefixedNamingOnProperties != null && message.hasOwnProperty("prefixedNamingOnProperties")) + if (typeof message.prefixedNamingOnProperties !== "boolean") + return "prefixedNamingOnProperties: boolean expected"; + if (message.skipNamingValidation != null && message.hasOwnProperty("skipNamingValidation")) + if (typeof message.skipNamingValidation !== "boolean") + return "skipNamingValidation: boolean expected"; + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentSchema.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata(); + if (object.documentSplitter != null) + message.documentSplitter = Boolean(object.documentSplitter); + if (object.documentAllowMultipleLabels != null) + message.documentAllowMultipleLabels = Boolean(object.documentAllowMultipleLabels); + if (object.prefixedNamingOnProperties != null) + message.prefixedNamingOnProperties = Boolean(object.prefixedNamingOnProperties); + if (object.skipNamingValidation != null) + message.skipNamingValidation = Boolean(object.skipNamingValidation); + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @static + * @param {google.cloud.documentai.v1beta3.DocumentSchema.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.documentSplitter = false; + object.documentAllowMultipleLabels = false; + object.prefixedNamingOnProperties = false; + object.skipNamingValidation = false; + } + if (message.documentSplitter != null && message.hasOwnProperty("documentSplitter")) + object.documentSplitter = message.documentSplitter; + if (message.documentAllowMultipleLabels != null && message.hasOwnProperty("documentAllowMultipleLabels")) + object.documentAllowMultipleLabels = message.documentAllowMultipleLabels; + if (message.prefixedNamingOnProperties != null && message.hasOwnProperty("prefixedNamingOnProperties")) + object.prefixedNamingOnProperties = message.prefixedNamingOnProperties; + if (message.skipNamingValidation != null && message.hasOwnProperty("skipNamingValidation")) + object.skipNamingValidation = message.skipNamingValidation; + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentSchema.Metadata"; + }; + + return Metadata; + })(); + + return DocumentSchema; + })(); + + v1beta3.DocumentProcessorService = (function() { + + /** + * Constructs a new DocumentProcessorService service. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DocumentProcessorService + * @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 DocumentProcessorService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DocumentProcessorService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DocumentProcessorService; + + /** + * Creates new DocumentProcessorService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @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 {DocumentProcessorService} RPC service. Useful where requests and/or responses are streamed. + */ + DocumentProcessorService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|processDocument}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef ProcessDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.ProcessResponse} [response] ProcessResponse + */ + + /** + * Calls ProcessDocument. + * @function processDocument + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IProcessRequest} request ProcessRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocumentCallback} callback Node-style callback called with the error, if any, and ProcessResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.processDocument = function processDocument(request, callback) { + return this.rpcCall(processDocument, $root.google.cloud.documentai.v1beta3.ProcessRequest, $root.google.cloud.documentai.v1beta3.ProcessResponse, request, callback); + }, "name", { value: "ProcessDocument" }); + + /** + * Calls ProcessDocument. + * @function processDocument + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IProcessRequest} request ProcessRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|batchProcessDocuments}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef BatchProcessDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchProcessDocuments. + * @function batchProcessDocuments + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IBatchProcessRequest} request BatchProcessRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocumentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.batchProcessDocuments = function batchProcessDocuments(request, callback) { + return this.rpcCall(batchProcessDocuments, $root.google.cloud.documentai.v1beta3.BatchProcessRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchProcessDocuments" }); + + /** + * Calls BatchProcessDocuments. + * @function batchProcessDocuments + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IBatchProcessRequest} request BatchProcessRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|fetchProcessorTypes}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef FetchProcessorTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} [response] FetchProcessorTypesResponse + */ + + /** + * Calls FetchProcessorTypes. + * @function fetchProcessorTypes + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest} request FetchProcessorTypesRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypesCallback} callback Node-style callback called with the error, if any, and FetchProcessorTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.fetchProcessorTypes = function fetchProcessorTypes(request, callback) { + return this.rpcCall(fetchProcessorTypes, $root.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest, $root.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse, request, callback); + }, "name", { value: "FetchProcessorTypes" }); + + /** + * Calls FetchProcessorTypes. + * @function fetchProcessorTypes + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest} request FetchProcessorTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listProcessorTypes}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef ListProcessorTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.ListProcessorTypesResponse} [response] ListProcessorTypesResponse + */ + + /** + * Calls ListProcessorTypes. + * @function listProcessorTypes + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IListProcessorTypesRequest} request ListProcessorTypesRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypesCallback} callback Node-style callback called with the error, if any, and ListProcessorTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.listProcessorTypes = function listProcessorTypes(request, callback) { + return this.rpcCall(listProcessorTypes, $root.google.cloud.documentai.v1beta3.ListProcessorTypesRequest, $root.google.cloud.documentai.v1beta3.ListProcessorTypesResponse, request, callback); + }, "name", { value: "ListProcessorTypes" }); + + /** + * Calls ListProcessorTypes. + * @function listProcessorTypes + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IListProcessorTypesRequest} request ListProcessorTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getProcessorType}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef GetProcessorTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.ProcessorType} [response] ProcessorType + */ + + /** + * Calls GetProcessorType. + * @function getProcessorType + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IGetProcessorTypeRequest} request GetProcessorTypeRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorTypeCallback} callback Node-style callback called with the error, if any, and ProcessorType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.getProcessorType = function getProcessorType(request, callback) { + return this.rpcCall(getProcessorType, $root.google.cloud.documentai.v1beta3.GetProcessorTypeRequest, $root.google.cloud.documentai.v1beta3.ProcessorType, request, callback); + }, "name", { value: "GetProcessorType" }); + + /** + * Calls GetProcessorType. + * @function getProcessorType + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IGetProcessorTypeRequest} request GetProcessorTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listProcessors}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef ListProcessorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.ListProcessorsResponse} [response] ListProcessorsResponse + */ + + /** + * Calls ListProcessors. + * @function listProcessors + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IListProcessorsRequest} request ListProcessorsRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorsCallback} callback Node-style callback called with the error, if any, and ListProcessorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.listProcessors = function listProcessors(request, callback) { + return this.rpcCall(listProcessors, $root.google.cloud.documentai.v1beta3.ListProcessorsRequest, $root.google.cloud.documentai.v1beta3.ListProcessorsResponse, request, callback); + }, "name", { value: "ListProcessors" }); + + /** + * Calls ListProcessors. + * @function listProcessors + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IListProcessorsRequest} request ListProcessorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getProcessor}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef GetProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.Processor} [response] Processor + */ + + /** + * Calls GetProcessor. + * @function getProcessor + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IGetProcessorRequest} request GetProcessorRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorCallback} callback Node-style callback called with the error, if any, and Processor + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.getProcessor = function getProcessor(request, callback) { + return this.rpcCall(getProcessor, $root.google.cloud.documentai.v1beta3.GetProcessorRequest, $root.google.cloud.documentai.v1beta3.Processor, request, callback); + }, "name", { value: "GetProcessor" }); + + /** + * Calls GetProcessor. + * @function getProcessor + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IGetProcessorRequest} request GetProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|trainProcessorVersion}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef TrainProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls TrainProcessorVersion. + * @function trainProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest} request TrainProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.trainProcessorVersion = function trainProcessorVersion(request, callback) { + return this.rpcCall(trainProcessorVersion, $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "TrainProcessorVersion" }); + + /** + * Calls TrainProcessorVersion. + * @function trainProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest} request TrainProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getProcessorVersion}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef GetProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.ProcessorVersion} [response] ProcessorVersion + */ + + /** + * Calls GetProcessorVersion. + * @function getProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IGetProcessorVersionRequest} request GetProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersionCallback} callback Node-style callback called with the error, if any, and ProcessorVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.getProcessorVersion = function getProcessorVersion(request, callback) { + return this.rpcCall(getProcessorVersion, $root.google.cloud.documentai.v1beta3.GetProcessorVersionRequest, $root.google.cloud.documentai.v1beta3.ProcessorVersion, request, callback); + }, "name", { value: "GetProcessorVersion" }); + + /** + * Calls GetProcessorVersion. + * @function getProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IGetProcessorVersionRequest} request GetProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listProcessorVersions}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef ListProcessorVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} [response] ListProcessorVersionsResponse + */ + + /** + * Calls ListProcessorVersions. + * @function listProcessorVersions + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsRequest} request ListProcessorVersionsRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersionsCallback} callback Node-style callback called with the error, if any, and ListProcessorVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.listProcessorVersions = function listProcessorVersions(request, callback) { + return this.rpcCall(listProcessorVersions, $root.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest, $root.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse, request, callback); + }, "name", { value: "ListProcessorVersions" }); + + /** + * Calls ListProcessorVersions. + * @function listProcessorVersions + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsRequest} request ListProcessorVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|deleteProcessorVersion}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef DeleteProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteProcessorVersion. + * @function deleteProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest} request DeleteProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.deleteProcessorVersion = function deleteProcessorVersion(request, callback) { + return this.rpcCall(deleteProcessorVersion, $root.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteProcessorVersion" }); + + /** + * Calls DeleteProcessorVersion. + * @function deleteProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest} request DeleteProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|deployProcessorVersion}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef DeployProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeployProcessorVersion. + * @function deployProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest} request DeployProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.deployProcessorVersion = function deployProcessorVersion(request, callback) { + return this.rpcCall(deployProcessorVersion, $root.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeployProcessorVersion" }); + + /** + * Calls DeployProcessorVersion. + * @function deployProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest} request DeployProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|undeployProcessorVersion}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef UndeployProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeployProcessorVersion. + * @function undeployProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest} request UndeployProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.undeployProcessorVersion = function undeployProcessorVersion(request, callback) { + return this.rpcCall(undeployProcessorVersion, $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeployProcessorVersion" }); + + /** + * Calls UndeployProcessorVersion. + * @function undeployProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest} request UndeployProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|createProcessor}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef CreateProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.Processor} [response] Processor + */ + + /** + * Calls CreateProcessor. + * @function createProcessor + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.ICreateProcessorRequest} request CreateProcessorRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessorCallback} callback Node-style callback called with the error, if any, and Processor + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.createProcessor = function createProcessor(request, callback) { + return this.rpcCall(createProcessor, $root.google.cloud.documentai.v1beta3.CreateProcessorRequest, $root.google.cloud.documentai.v1beta3.Processor, request, callback); + }, "name", { value: "CreateProcessor" }); + + /** + * Calls CreateProcessor. + * @function createProcessor + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.ICreateProcessorRequest} request CreateProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|deleteProcessor}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef DeleteProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteProcessor. + * @function deleteProcessor + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorRequest} request DeleteProcessorRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.deleteProcessor = function deleteProcessor(request, callback) { + return this.rpcCall(deleteProcessor, $root.google.cloud.documentai.v1beta3.DeleteProcessorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteProcessor" }); + + /** + * Calls DeleteProcessor. + * @function deleteProcessor + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorRequest} request DeleteProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|enableProcessor}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef EnableProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls EnableProcessor. + * @function enableProcessor + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IEnableProcessorRequest} request EnableProcessorRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.enableProcessor = function enableProcessor(request, callback) { + return this.rpcCall(enableProcessor, $root.google.cloud.documentai.v1beta3.EnableProcessorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "EnableProcessor" }); + + /** + * Calls EnableProcessor. + * @function enableProcessor + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IEnableProcessorRequest} request EnableProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|disableProcessor}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef DisableProcessorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DisableProcessor. + * @function disableProcessor + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IDisableProcessorRequest} request DisableProcessorRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.disableProcessor = function disableProcessor(request, callback) { + return this.rpcCall(disableProcessor, $root.google.cloud.documentai.v1beta3.DisableProcessorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DisableProcessor" }); + + /** + * Calls DisableProcessor. + * @function disableProcessor + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IDisableProcessorRequest} request DisableProcessorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|setDefaultProcessorVersion}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef SetDefaultProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SetDefaultProcessorVersion. + * @function setDefaultProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest} request SetDefaultProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.setDefaultProcessorVersion = function setDefaultProcessorVersion(request, callback) { + return this.rpcCall(setDefaultProcessorVersion, $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SetDefaultProcessorVersion" }); + + /** + * Calls SetDefaultProcessorVersion. + * @function setDefaultProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest} request SetDefaultProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|reviewDocument}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef ReviewDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ReviewDocument. + * @function reviewDocument + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IReviewDocumentRequest} request ReviewDocumentRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocumentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.reviewDocument = function reviewDocument(request, callback) { + return this.rpcCall(reviewDocument, $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ReviewDocument" }); + + /** + * Calls ReviewDocument. + * @function reviewDocument + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IReviewDocumentRequest} request ReviewDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|evaluateProcessorVersion}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef EvaluateProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls EvaluateProcessorVersion. + * @function evaluateProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest} request EvaluateProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.evaluateProcessorVersion = function evaluateProcessorVersion(request, callback) { + return this.rpcCall(evaluateProcessorVersion, $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "EvaluateProcessorVersion" }); + + /** + * Calls EvaluateProcessorVersion. + * @function evaluateProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest} request EvaluateProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getEvaluation}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef GetEvaluationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.Evaluation} [response] Evaluation + */ + + /** + * Calls GetEvaluation. + * @function getEvaluation + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IGetEvaluationRequest} request GetEvaluationRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.getEvaluation = function getEvaluation(request, callback) { + return this.rpcCall(getEvaluation, $root.google.cloud.documentai.v1beta3.GetEvaluationRequest, $root.google.cloud.documentai.v1beta3.Evaluation, request, callback); + }, "name", { value: "GetEvaluation" }); + + /** + * Calls GetEvaluation. + * @function getEvaluation + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IGetEvaluationRequest} request GetEvaluationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listEvaluations}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef ListEvaluationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.ListEvaluationsResponse} [response] ListEvaluationsResponse + */ + + /** + * Calls ListEvaluations. + * @function listEvaluations + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluationsCallback} callback Node-style callback called with the error, if any, and ListEvaluationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.listEvaluations = function listEvaluations(request, callback) { + return this.rpcCall(listEvaluations, $root.google.cloud.documentai.v1beta3.ListEvaluationsRequest, $root.google.cloud.documentai.v1beta3.ListEvaluationsResponse, request, callback); + }, "name", { value: "ListEvaluations" }); + + /** + * Calls ListEvaluations. + * @function listEvaluations + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|importProcessorVersion}. + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @typedef ImportProcessorVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportProcessorVersion. + * @function importProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionRequest} request ImportProcessorVersionRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentProcessorService.prototype.importProcessorVersion = function importProcessorVersion(request, callback) { + return this.rpcCall(importProcessorVersion, $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportProcessorVersion" }); + + /** + * Calls ImportProcessorVersion. + * @function importProcessorVersion + * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService + * @instance + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionRequest} request ImportProcessorVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DocumentProcessorService; + })(); + + v1beta3.ProcessOptions = (function() { + + /** + * Properties of a ProcessOptions. + * @memberof google.cloud.documentai.v1beta3 + * @interface IProcessOptions + * @property {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector|null} [individualPageSelector] ProcessOptions individualPageSelector + * @property {number|null} [fromStart] ProcessOptions fromStart + * @property {number|null} [fromEnd] ProcessOptions fromEnd + * @property {google.cloud.documentai.v1beta3.IOcrConfig|null} [ocrConfig] ProcessOptions ocrConfig + * @property {google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig|null} [layoutConfig] ProcessOptions layoutConfig + * @property {google.cloud.documentai.v1beta3.IDocumentSchema|null} [schemaOverride] ProcessOptions schemaOverride + */ + + /** + * Constructs a new ProcessOptions. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ProcessOptions. + * @implements IProcessOptions + * @constructor + * @param {google.cloud.documentai.v1beta3.IProcessOptions=} [properties] Properties to set + */ + function ProcessOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessOptions individualPageSelector. + * @member {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector|null|undefined} individualPageSelector + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + */ + ProcessOptions.prototype.individualPageSelector = null; + + /** + * ProcessOptions fromStart. + * @member {number|null|undefined} fromStart + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + */ + ProcessOptions.prototype.fromStart = null; + + /** + * ProcessOptions fromEnd. + * @member {number|null|undefined} fromEnd + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + */ + ProcessOptions.prototype.fromEnd = null; + + /** + * ProcessOptions ocrConfig. + * @member {google.cloud.documentai.v1beta3.IOcrConfig|null|undefined} ocrConfig + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + */ + ProcessOptions.prototype.ocrConfig = null; + + /** + * ProcessOptions layoutConfig. + * @member {google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig|null|undefined} layoutConfig + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + */ + ProcessOptions.prototype.layoutConfig = null; + + /** + * ProcessOptions schemaOverride. + * @member {google.cloud.documentai.v1beta3.IDocumentSchema|null|undefined} schemaOverride + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + */ + ProcessOptions.prototype.schemaOverride = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProcessOptions pageRange. + * @member {"individualPageSelector"|"fromStart"|"fromEnd"|undefined} pageRange + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + */ + Object.defineProperty(ProcessOptions.prototype, "pageRange", { + get: $util.oneOfGetter($oneOfFields = ["individualPageSelector", "fromStart", "fromEnd"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProcessOptions instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {google.cloud.documentai.v1beta3.IProcessOptions=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessOptions} ProcessOptions instance + */ + ProcessOptions.create = function create(properties) { + return new ProcessOptions(properties); + }; + + /** + * Encodes the specified ProcessOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {google.cloud.documentai.v1beta3.IProcessOptions} message ProcessOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ocrConfig != null && Object.hasOwnProperty.call(message, "ocrConfig")) + $root.google.cloud.documentai.v1beta3.OcrConfig.encode(message.ocrConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.individualPageSelector != null && Object.hasOwnProperty.call(message, "individualPageSelector")) + $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.encode(message.individualPageSelector, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fromStart != null && Object.hasOwnProperty.call(message, "fromStart")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.fromStart); + if (message.fromEnd != null && Object.hasOwnProperty.call(message, "fromEnd")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.fromEnd); + if (message.schemaOverride != null && Object.hasOwnProperty.call(message, "schemaOverride")) + $root.google.cloud.documentai.v1beta3.DocumentSchema.encode(message.schemaOverride, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.layoutConfig != null && Object.hasOwnProperty.call(message, "layoutConfig")) + $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.encode(message.layoutConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {google.cloud.documentai.v1beta3.IProcessOptions} message ProcessOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessOptions} ProcessOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessOptions.decode = function decode(reader, 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.v1beta3.ProcessOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.individualPageSelector = $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.decode(reader, reader.uint32()); + break; + } + case 6: { + message.fromStart = reader.int32(); + break; + } + case 7: { + message.fromEnd = reader.int32(); + break; + } + case 1: { + message.ocrConfig = $root.google.cloud.documentai.v1beta3.OcrConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.layoutConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.schemaOverride = $root.google.cloud.documentai.v1beta3.DocumentSchema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessOptions} ProcessOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessOptions message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.individualPageSelector != null && message.hasOwnProperty("individualPageSelector")) { + properties.pageRange = 1; + { + var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify(message.individualPageSelector); + if (error) + return "individualPageSelector." + error; + } + } + if (message.fromStart != null && message.hasOwnProperty("fromStart")) { + if (properties.pageRange === 1) + return "pageRange: multiple values"; + properties.pageRange = 1; + if (!$util.isInteger(message.fromStart)) + return "fromStart: integer expected"; + } + if (message.fromEnd != null && message.hasOwnProperty("fromEnd")) { + if (properties.pageRange === 1) + return "pageRange: multiple values"; + properties.pageRange = 1; + if (!$util.isInteger(message.fromEnd)) + return "fromEnd: integer expected"; + } + if (message.ocrConfig != null && message.hasOwnProperty("ocrConfig")) { + var error = $root.google.cloud.documentai.v1beta3.OcrConfig.verify(message.ocrConfig); + if (error) + return "ocrConfig." + error; + } + if (message.layoutConfig != null && message.hasOwnProperty("layoutConfig")) { + var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.verify(message.layoutConfig); + if (error) + return "layoutConfig." + error; + } + if (message.schemaOverride != null && message.hasOwnProperty("schemaOverride")) { + var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.verify(message.schemaOverride); + if (error) + return "schemaOverride." + error; + } + return null; + }; + + /** + * Creates a ProcessOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessOptions} ProcessOptions + */ + ProcessOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessOptions) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessOptions(); + if (object.individualPageSelector != null) { + if (typeof object.individualPageSelector !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.individualPageSelector: object expected"); + message.individualPageSelector = $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.fromObject(object.individualPageSelector); + } + if (object.fromStart != null) + message.fromStart = object.fromStart | 0; + if (object.fromEnd != null) + message.fromEnd = object.fromEnd | 0; + if (object.ocrConfig != null) { + if (typeof object.ocrConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.ocrConfig: object expected"); + message.ocrConfig = $root.google.cloud.documentai.v1beta3.OcrConfig.fromObject(object.ocrConfig); + } + if (object.layoutConfig != null) { + if (typeof object.layoutConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.layoutConfig: object expected"); + message.layoutConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.fromObject(object.layoutConfig); + } + if (object.schemaOverride != null) { + if (typeof object.schemaOverride !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.schemaOverride: object expected"); + message.schemaOverride = $root.google.cloud.documentai.v1beta3.DocumentSchema.fromObject(object.schemaOverride); + } + return message; + }; + + /** + * Creates a plain object from a ProcessOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions} message ProcessOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ocrConfig = null; + object.schemaOverride = null; + object.layoutConfig = null; + } + if (message.ocrConfig != null && message.hasOwnProperty("ocrConfig")) + object.ocrConfig = $root.google.cloud.documentai.v1beta3.OcrConfig.toObject(message.ocrConfig, options); + if (message.individualPageSelector != null && message.hasOwnProperty("individualPageSelector")) { + object.individualPageSelector = $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.toObject(message.individualPageSelector, options); + if (options.oneofs) + object.pageRange = "individualPageSelector"; + } + if (message.fromStart != null && message.hasOwnProperty("fromStart")) { + object.fromStart = message.fromStart; + if (options.oneofs) + object.pageRange = "fromStart"; + } + if (message.fromEnd != null && message.hasOwnProperty("fromEnd")) { + object.fromEnd = message.fromEnd; + if (options.oneofs) + object.pageRange = "fromEnd"; + } + if (message.schemaOverride != null && message.hasOwnProperty("schemaOverride")) + object.schemaOverride = $root.google.cloud.documentai.v1beta3.DocumentSchema.toObject(message.schemaOverride, options); + if (message.layoutConfig != null && message.hasOwnProperty("layoutConfig")) + object.layoutConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.toObject(message.layoutConfig, options); + return object; + }; + + /** + * Converts this ProcessOptions to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @instance + * @returns {Object.} JSON object + */ + ProcessOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessOptions + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessOptions"; + }; + + ProcessOptions.LayoutConfig = (function() { + + /** + * Properties of a LayoutConfig. + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @interface ILayoutConfig + * @property {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig|null} [chunkingConfig] LayoutConfig chunkingConfig + * @property {boolean|null} [returnImages] LayoutConfig returnImages + * @property {boolean|null} [returnBoundingBoxes] LayoutConfig returnBoundingBoxes + * @property {boolean|null} [enableImageAnnotation] LayoutConfig enableImageAnnotation + * @property {boolean|null} [enableImageExtraction] LayoutConfig enableImageExtraction + * @property {boolean|null} [enableLlmLayoutParsing] LayoutConfig enableLlmLayoutParsing + * @property {boolean|null} [enableTableAnnotation] LayoutConfig enableTableAnnotation + * @property {boolean|null} [enableTableSplit] LayoutConfig enableTableSplit + */ + + /** + * Constructs a new LayoutConfig. + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @classdesc Represents a LayoutConfig. + * @implements ILayoutConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig=} [properties] Properties to set + */ + function LayoutConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LayoutConfig chunkingConfig. + * @member {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig|null|undefined} chunkingConfig + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @instance + */ + LayoutConfig.prototype.chunkingConfig = null; + + /** + * LayoutConfig returnImages. + * @member {boolean} returnImages + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @instance + */ + LayoutConfig.prototype.returnImages = false; + + /** + * LayoutConfig returnBoundingBoxes. + * @member {boolean} returnBoundingBoxes + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @instance + */ + LayoutConfig.prototype.returnBoundingBoxes = false; + + /** + * LayoutConfig enableImageAnnotation. + * @member {boolean} enableImageAnnotation + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @instance + */ + LayoutConfig.prototype.enableImageAnnotation = false; + + /** + * LayoutConfig enableImageExtraction. + * @member {boolean} enableImageExtraction + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @instance + */ + LayoutConfig.prototype.enableImageExtraction = false; + + /** + * LayoutConfig enableLlmLayoutParsing. + * @member {boolean} enableLlmLayoutParsing + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @instance + */ + LayoutConfig.prototype.enableLlmLayoutParsing = false; + + /** + * LayoutConfig enableTableAnnotation. + * @member {boolean} enableTableAnnotation + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @instance + */ + LayoutConfig.prototype.enableTableAnnotation = false; + + /** + * LayoutConfig enableTableSplit. + * @member {boolean} enableTableSplit + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @instance + */ + LayoutConfig.prototype.enableTableSplit = false; + + /** + * Creates a new LayoutConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig} LayoutConfig instance + */ + LayoutConfig.create = function create(properties) { + return new LayoutConfig(properties); + }; + + /** + * Encodes the specified LayoutConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig} message LayoutConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkingConfig != null && Object.hasOwnProperty.call(message, "chunkingConfig")) + $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.encode(message.chunkingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.returnImages != null && Object.hasOwnProperty.call(message, "returnImages")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.returnImages); + if (message.returnBoundingBoxes != null && Object.hasOwnProperty.call(message, "returnBoundingBoxes")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.returnBoundingBoxes); + if (message.enableImageAnnotation != null && Object.hasOwnProperty.call(message, "enableImageAnnotation")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableImageAnnotation); + if (message.enableLlmLayoutParsing != null && Object.hasOwnProperty.call(message, "enableLlmLayoutParsing")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableLlmLayoutParsing); + if (message.enableTableAnnotation != null && Object.hasOwnProperty.call(message, "enableTableAnnotation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableTableAnnotation); + if (message.enableImageExtraction != null && Object.hasOwnProperty.call(message, "enableImageExtraction")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableImageExtraction); + if (message.enableTableSplit != null && Object.hasOwnProperty.call(message, "enableTableSplit")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableTableSplit); + return writer; + }; + + /** + * Encodes the specified LayoutConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig} message LayoutConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LayoutConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig} LayoutConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutConfig.decode = function decode(reader, 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.v1beta3.ProcessOptions.LayoutConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chunkingConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.returnImages = reader.bool(); + break; + } + case 3: { + message.returnBoundingBoxes = reader.bool(); + break; + } + case 4: { + message.enableImageAnnotation = reader.bool(); + break; + } + case 7: { + message.enableImageExtraction = reader.bool(); + break; + } + case 5: { + message.enableLlmLayoutParsing = reader.bool(); + break; + } + case 6: { + message.enableTableAnnotation = reader.bool(); + break; + } + case 8: { + message.enableTableSplit = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LayoutConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig} LayoutConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LayoutConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LayoutConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkingConfig != null && message.hasOwnProperty("chunkingConfig")) { + var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.verify(message.chunkingConfig); + if (error) + return "chunkingConfig." + error; + } + if (message.returnImages != null && message.hasOwnProperty("returnImages")) + if (typeof message.returnImages !== "boolean") + return "returnImages: boolean expected"; + if (message.returnBoundingBoxes != null && message.hasOwnProperty("returnBoundingBoxes")) + if (typeof message.returnBoundingBoxes !== "boolean") + return "returnBoundingBoxes: boolean expected"; + if (message.enableImageAnnotation != null && message.hasOwnProperty("enableImageAnnotation")) + if (typeof message.enableImageAnnotation !== "boolean") + return "enableImageAnnotation: boolean expected"; + if (message.enableImageExtraction != null && message.hasOwnProperty("enableImageExtraction")) + if (typeof message.enableImageExtraction !== "boolean") + return "enableImageExtraction: boolean expected"; + if (message.enableLlmLayoutParsing != null && message.hasOwnProperty("enableLlmLayoutParsing")) + if (typeof message.enableLlmLayoutParsing !== "boolean") + return "enableLlmLayoutParsing: boolean expected"; + if (message.enableTableAnnotation != null && message.hasOwnProperty("enableTableAnnotation")) + if (typeof message.enableTableAnnotation !== "boolean") + return "enableTableAnnotation: boolean expected"; + if (message.enableTableSplit != null && message.hasOwnProperty("enableTableSplit")) + if (typeof message.enableTableSplit !== "boolean") + return "enableTableSplit: boolean expected"; + return null; + }; + + /** + * Creates a LayoutConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig} LayoutConfig + */ + LayoutConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig(); + if (object.chunkingConfig != null) { + if (typeof object.chunkingConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.chunkingConfig: object expected"); + message.chunkingConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.fromObject(object.chunkingConfig); + } + if (object.returnImages != null) + message.returnImages = Boolean(object.returnImages); + if (object.returnBoundingBoxes != null) + message.returnBoundingBoxes = Boolean(object.returnBoundingBoxes); + if (object.enableImageAnnotation != null) + message.enableImageAnnotation = Boolean(object.enableImageAnnotation); + if (object.enableImageExtraction != null) + message.enableImageExtraction = Boolean(object.enableImageExtraction); + if (object.enableLlmLayoutParsing != null) + message.enableLlmLayoutParsing = Boolean(object.enableLlmLayoutParsing); + if (object.enableTableAnnotation != null) + message.enableTableAnnotation = Boolean(object.enableTableAnnotation); + if (object.enableTableSplit != null) + message.enableTableSplit = Boolean(object.enableTableSplit); + return message; + }; + + /** + * Creates a plain object from a LayoutConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig} message LayoutConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LayoutConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chunkingConfig = null; + object.returnImages = false; + object.returnBoundingBoxes = false; + object.enableImageAnnotation = false; + object.enableLlmLayoutParsing = false; + object.enableTableAnnotation = false; + object.enableImageExtraction = false; + object.enableTableSplit = false; + } + if (message.chunkingConfig != null && message.hasOwnProperty("chunkingConfig")) + object.chunkingConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.toObject(message.chunkingConfig, options); + if (message.returnImages != null && message.hasOwnProperty("returnImages")) + object.returnImages = message.returnImages; + if (message.returnBoundingBoxes != null && message.hasOwnProperty("returnBoundingBoxes")) + object.returnBoundingBoxes = message.returnBoundingBoxes; + if (message.enableImageAnnotation != null && message.hasOwnProperty("enableImageAnnotation")) + object.enableImageAnnotation = message.enableImageAnnotation; + if (message.enableLlmLayoutParsing != null && message.hasOwnProperty("enableLlmLayoutParsing")) + object.enableLlmLayoutParsing = message.enableLlmLayoutParsing; + if (message.enableTableAnnotation != null && message.hasOwnProperty("enableTableAnnotation")) + object.enableTableAnnotation = message.enableTableAnnotation; + if (message.enableImageExtraction != null && message.hasOwnProperty("enableImageExtraction")) + object.enableImageExtraction = message.enableImageExtraction; + if (message.enableTableSplit != null && message.hasOwnProperty("enableTableSplit")) + object.enableTableSplit = message.enableTableSplit; + return object; + }; + + /** + * Converts this LayoutConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @instance + * @returns {Object.} JSON object + */ + LayoutConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LayoutConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LayoutConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig"; + }; + + LayoutConfig.ChunkingConfig = (function() { + + /** + * Properties of a ChunkingConfig. + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @interface IChunkingConfig + * @property {number|null} [chunkSize] ChunkingConfig chunkSize + * @property {boolean|null} [includeAncestorHeadings] ChunkingConfig includeAncestorHeadings + * @property {boolean|null} [semanticChunkingGroupSize] ChunkingConfig semanticChunkingGroupSize + * @property {number|null} [breakpointPercentileThreshold] ChunkingConfig breakpointPercentileThreshold + */ + + /** + * Constructs a new ChunkingConfig. + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @classdesc Represents a ChunkingConfig. + * @implements IChunkingConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig=} [properties] Properties to set + */ + function ChunkingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChunkingConfig chunkSize. + * @member {number} chunkSize + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @instance + */ + ChunkingConfig.prototype.chunkSize = 0; + + /** + * ChunkingConfig includeAncestorHeadings. + * @member {boolean} includeAncestorHeadings + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @instance + */ + ChunkingConfig.prototype.includeAncestorHeadings = false; + + /** + * ChunkingConfig semanticChunkingGroupSize. + * @member {boolean} semanticChunkingGroupSize + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @instance + */ + ChunkingConfig.prototype.semanticChunkingGroupSize = false; + + /** + * ChunkingConfig breakpointPercentileThreshold. + * @member {number} breakpointPercentileThreshold + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @instance + */ + ChunkingConfig.prototype.breakpointPercentileThreshold = 0; + + /** + * Creates a new ChunkingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig instance + */ + ChunkingConfig.create = function create(properties) { + return new ChunkingConfig(properties); + }; + + /** + * Encodes the specified ChunkingConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig} message ChunkingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkSize != null && Object.hasOwnProperty.call(message, "chunkSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.chunkSize); + if (message.includeAncestorHeadings != null && Object.hasOwnProperty.call(message, "includeAncestorHeadings")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeAncestorHeadings); + if (message.semanticChunkingGroupSize != null && Object.hasOwnProperty.call(message, "semanticChunkingGroupSize")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.semanticChunkingGroupSize); + if (message.breakpointPercentileThreshold != null && Object.hasOwnProperty.call(message, "breakpointPercentileThreshold")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.breakpointPercentileThreshold); + return writer; + }; + + /** + * Encodes the specified ChunkingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig} message ChunkingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkingConfig.decode = function decode(reader, 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.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.chunkSize = reader.int32(); + break; + } + case 2: { + message.includeAncestorHeadings = reader.bool(); + break; + } + case 3: { + message.semanticChunkingGroupSize = reader.bool(); + break; + } + case 4: { + message.breakpointPercentileThreshold = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkingConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) + if (!$util.isInteger(message.chunkSize)) + return "chunkSize: integer expected"; + if (message.includeAncestorHeadings != null && message.hasOwnProperty("includeAncestorHeadings")) + if (typeof message.includeAncestorHeadings !== "boolean") + return "includeAncestorHeadings: boolean expected"; + if (message.semanticChunkingGroupSize != null && message.hasOwnProperty("semanticChunkingGroupSize")) + if (typeof message.semanticChunkingGroupSize !== "boolean") + return "semanticChunkingGroupSize: boolean expected"; + if (message.breakpointPercentileThreshold != null && message.hasOwnProperty("breakpointPercentileThreshold")) + if (!$util.isInteger(message.breakpointPercentileThreshold)) + return "breakpointPercentileThreshold: integer expected"; + return null; + }; + + /** + * Creates a ChunkingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig + */ + ChunkingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig(); + if (object.chunkSize != null) + message.chunkSize = object.chunkSize | 0; + if (object.includeAncestorHeadings != null) + message.includeAncestorHeadings = Boolean(object.includeAncestorHeadings); + if (object.semanticChunkingGroupSize != null) + message.semanticChunkingGroupSize = Boolean(object.semanticChunkingGroupSize); + if (object.breakpointPercentileThreshold != null) + message.breakpointPercentileThreshold = object.breakpointPercentileThreshold | 0; + return message; + }; + + /** + * Creates a plain object from a ChunkingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig} message ChunkingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chunkSize = 0; + object.includeAncestorHeadings = false; + object.semanticChunkingGroupSize = false; + object.breakpointPercentileThreshold = 0; + } + if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) + object.chunkSize = message.chunkSize; + if (message.includeAncestorHeadings != null && message.hasOwnProperty("includeAncestorHeadings")) + object.includeAncestorHeadings = message.includeAncestorHeadings; + if (message.semanticChunkingGroupSize != null && message.hasOwnProperty("semanticChunkingGroupSize")) + object.semanticChunkingGroupSize = message.semanticChunkingGroupSize; + if (message.breakpointPercentileThreshold != null && message.hasOwnProperty("breakpointPercentileThreshold")) + object.breakpointPercentileThreshold = message.breakpointPercentileThreshold; + return object; + }; + + /** + * Converts this ChunkingConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @instance + * @returns {Object.} JSON object + */ + ChunkingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkingConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig"; + }; + + return ChunkingConfig; + })(); + + return LayoutConfig; + })(); + + ProcessOptions.IndividualPageSelector = (function() { + + /** + * Properties of an IndividualPageSelector. + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @interface IIndividualPageSelector + * @property {Array.|null} [pages] IndividualPageSelector pages + */ + + /** + * Constructs a new IndividualPageSelector. + * @memberof google.cloud.documentai.v1beta3.ProcessOptions + * @classdesc Represents an IndividualPageSelector. + * @implements IIndividualPageSelector + * @constructor + * @param {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector=} [properties] Properties to set + */ + function IndividualPageSelector(properties) { + this.pages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndividualPageSelector pages. + * @member {Array.} pages + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @instance + */ + IndividualPageSelector.prototype.pages = $util.emptyArray; + + /** + * Creates a new IndividualPageSelector instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} IndividualPageSelector instance + */ + IndividualPageSelector.create = function create(properties) { + return new IndividualPageSelector(properties); + }; + + /** + * Encodes the specified IndividualPageSelector message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector} message IndividualPageSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualPageSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pages != null && message.pages.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.pages.length; ++i) + writer.int32(message.pages[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified IndividualPageSelector message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector} message IndividualPageSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualPageSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndividualPageSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} IndividualPageSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualPageSelector.decode = function decode(reader, 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.v1beta3.ProcessOptions.IndividualPageSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.pages && message.pages.length)) + message.pages = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.pages.push(reader.int32()); + } else + message.pages.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndividualPageSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} IndividualPageSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualPageSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndividualPageSelector message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndividualPageSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) + if (!$util.isInteger(message.pages[i])) + return "pages: integer[] expected"; + } + return null; + }; + + /** + * Creates an IndividualPageSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} IndividualPageSelector + */ + IndividualPageSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector(); + if (object.pages) { + if (!Array.isArray(object.pages)) + throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.pages: array expected"); + message.pages = []; + for (var i = 0; i < object.pages.length; ++i) + message.pages[i] = object.pages[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from an IndividualPageSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} message IndividualPageSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndividualPageSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pages = []; + if (message.pages && message.pages.length) { + object.pages = []; + for (var j = 0; j < message.pages.length; ++j) + object.pages[j] = message.pages[j]; + } + return object; + }; + + /** + * Converts this IndividualPageSelector to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @instance + * @returns {Object.} JSON object + */ + IndividualPageSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndividualPageSelector + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndividualPageSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector"; + }; + + return IndividualPageSelector; + })(); + + return ProcessOptions; + })(); + + v1beta3.ProcessRequest = (function() { + + /** + * Properties of a ProcessRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IProcessRequest + * @property {google.cloud.documentai.v1beta3.IDocument|null} [inlineDocument] ProcessRequest inlineDocument + * @property {google.cloud.documentai.v1beta3.IRawDocument|null} [rawDocument] ProcessRequest rawDocument + * @property {google.cloud.documentai.v1beta3.IGcsDocument|null} [gcsDocument] ProcessRequest gcsDocument + * @property {string|null} [name] ProcessRequest name + * @property {google.cloud.documentai.v1beta3.IDocument|null} [document] ProcessRequest document + * @property {boolean|null} [skipHumanReview] ProcessRequest skipHumanReview + * @property {google.protobuf.IFieldMask|null} [fieldMask] ProcessRequest fieldMask + * @property {google.cloud.documentai.v1beta3.IProcessOptions|null} [processOptions] ProcessRequest processOptions + * @property {Object.|null} [labels] ProcessRequest labels + * @property {boolean|null} [imagelessMode] ProcessRequest imagelessMode + */ + + /** + * Constructs a new ProcessRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ProcessRequest. + * @implements IProcessRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IProcessRequest=} [properties] Properties to set + */ + function ProcessRequest(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessRequest inlineDocument. + * @member {google.cloud.documentai.v1beta3.IDocument|null|undefined} inlineDocument + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + */ + ProcessRequest.prototype.inlineDocument = null; + + /** + * ProcessRequest rawDocument. + * @member {google.cloud.documentai.v1beta3.IRawDocument|null|undefined} rawDocument + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + */ + ProcessRequest.prototype.rawDocument = null; + + /** + * ProcessRequest gcsDocument. + * @member {google.cloud.documentai.v1beta3.IGcsDocument|null|undefined} gcsDocument + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + */ + ProcessRequest.prototype.gcsDocument = null; + + /** + * ProcessRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + */ + ProcessRequest.prototype.name = ""; + + /** + * ProcessRequest document. + * @member {google.cloud.documentai.v1beta3.IDocument|null|undefined} document + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + */ + ProcessRequest.prototype.document = null; + + /** + * ProcessRequest skipHumanReview. + * @member {boolean} skipHumanReview + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + */ + ProcessRequest.prototype.skipHumanReview = false; + + /** + * ProcessRequest fieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} fieldMask + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + */ + ProcessRequest.prototype.fieldMask = null; + + /** + * ProcessRequest processOptions. + * @member {google.cloud.documentai.v1beta3.IProcessOptions|null|undefined} processOptions + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + */ + ProcessRequest.prototype.processOptions = null; + + /** + * ProcessRequest labels. + * @member {Object.} labels + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + */ + ProcessRequest.prototype.labels = $util.emptyObject; + + /** + * ProcessRequest imagelessMode. + * @member {boolean} imagelessMode + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + */ + ProcessRequest.prototype.imagelessMode = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProcessRequest source. + * @member {"inlineDocument"|"rawDocument"|"gcsDocument"|undefined} source + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + */ + Object.defineProperty(ProcessRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["inlineDocument", "rawDocument", "gcsDocument"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProcessRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @static + * @param {google.cloud.documentai.v1beta3.IProcessRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessRequest} ProcessRequest instance + */ + ProcessRequest.create = function create(properties) { + return new ProcessRequest(properties); + }; + + /** + * Encodes the specified ProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @static + * @param {google.cloud.documentai.v1beta3.IProcessRequest} message ProcessRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessRequest.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.documentai.v1beta3.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.skipHumanReview != null && Object.hasOwnProperty.call(message, "skipHumanReview")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skipHumanReview); + if (message.inlineDocument != null && Object.hasOwnProperty.call(message, "inlineDocument")) + $root.google.cloud.documentai.v1beta3.Document.encode(message.inlineDocument, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rawDocument != null && Object.hasOwnProperty.call(message, "rawDocument")) + $root.google.cloud.documentai.v1beta3.RawDocument.encode(message.rawDocument, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.processOptions != null && Object.hasOwnProperty.call(message, "processOptions")) + $root.google.cloud.documentai.v1beta3.ProcessOptions.encode(message.processOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.gcsDocument != null && Object.hasOwnProperty.call(message, "gcsDocument")) + $root.google.cloud.documentai.v1beta3.GcsDocument.encode(message.gcsDocument, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.imagelessMode != null && Object.hasOwnProperty.call(message, "imagelessMode")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.imagelessMode); + return writer; + }; + + /** + * Encodes the specified ProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @static + * @param {google.cloud.documentai.v1beta3.IProcessRequest} message ProcessRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessRequest} ProcessRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessRequest.decode = function decode(reader, 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.v1beta3.ProcessRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.inlineDocument = $root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32()); + break; + } + case 5: { + message.rawDocument = $root.google.cloud.documentai.v1beta3.RawDocument.decode(reader, reader.uint32()); + break; + } + case 8: { + message.gcsDocument = $root.google.cloud.documentai.v1beta3.GcsDocument.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.document = $root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32()); + break; + } + case 3: { + message.skipHumanReview = reader.bool(); + break; + } + case 6: { + message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 7: { + message.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.decode(reader, reader.uint32()); + break; + } + case 10: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 11: { + message.imagelessMode = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessRequest} ProcessRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1beta3.Document.verify(message.inlineDocument); + if (error) + return "inlineDocument." + error; + } + } + if (message.rawDocument != null && message.hasOwnProperty("rawDocument")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1beta3.RawDocument.verify(message.rawDocument); + if (error) + return "rawDocument." + error; + } + } + if (message.gcsDocument != null && message.hasOwnProperty("gcsDocument")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1beta3.GcsDocument.verify(message.gcsDocument); + if (error) + return "gcsDocument." + error; + } + } + 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.documentai.v1beta3.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) + if (typeof message.skipHumanReview !== "boolean") + return "skipHumanReview: boolean expected"; + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); + if (error) + return "fieldMask." + error; + } + if (message.processOptions != null && message.hasOwnProperty("processOptions")) { + var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.verify(message.processOptions); + if (error) + return "processOptions." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.imagelessMode != null && message.hasOwnProperty("imagelessMode")) + if (typeof message.imagelessMode !== "boolean") + return "imagelessMode: boolean expected"; + return null; + }; + + /** + * Creates a ProcessRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessRequest} ProcessRequest + */ + ProcessRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessRequest(); + if (object.inlineDocument != null) { + if (typeof object.inlineDocument !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.inlineDocument: object expected"); + message.inlineDocument = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.inlineDocument); + } + if (object.rawDocument != null) { + if (typeof object.rawDocument !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.rawDocument: object expected"); + message.rawDocument = $root.google.cloud.documentai.v1beta3.RawDocument.fromObject(object.rawDocument); + } + if (object.gcsDocument != null) { + if (typeof object.gcsDocument !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.gcsDocument: object expected"); + message.gcsDocument = $root.google.cloud.documentai.v1beta3.GcsDocument.fromObject(object.gcsDocument); + } + if (object.name != null) + message.name = String(object.name); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.document: object expected"); + message.document = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.document); + } + if (object.skipHumanReview != null) + message.skipHumanReview = Boolean(object.skipHumanReview); + if (object.fieldMask != null) { + if (typeof object.fieldMask !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.fieldMask: object expected"); + message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); + } + if (object.processOptions != null) { + if (typeof object.processOptions !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.processOptions: object expected"); + message.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.fromObject(object.processOptions); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.imagelessMode != null) + message.imagelessMode = Boolean(object.imagelessMode); + return message; + }; + + /** + * Creates a plain object from a ProcessRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @static + * @param {google.cloud.documentai.v1beta3.ProcessRequest} message ProcessRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.document = null; + object.skipHumanReview = false; + object.fieldMask = null; + object.processOptions = null; + object.imagelessMode = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.documentai.v1beta3.Document.toObject(message.document, options); + if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) + object.skipHumanReview = message.skipHumanReview; + if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { + object.inlineDocument = $root.google.cloud.documentai.v1beta3.Document.toObject(message.inlineDocument, options); + if (options.oneofs) + object.source = "inlineDocument"; + } + if (message.rawDocument != null && message.hasOwnProperty("rawDocument")) { + object.rawDocument = $root.google.cloud.documentai.v1beta3.RawDocument.toObject(message.rawDocument, options); + if (options.oneofs) + object.source = "rawDocument"; + } + if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.processOptions != null && message.hasOwnProperty("processOptions")) + object.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.toObject(message.processOptions, options); + if (message.gcsDocument != null && message.hasOwnProperty("gcsDocument")) { + object.gcsDocument = $root.google.cloud.documentai.v1beta3.GcsDocument.toObject(message.gcsDocument, options); + if (options.oneofs) + object.source = "gcsDocument"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.imagelessMode != null && message.hasOwnProperty("imagelessMode")) + object.imagelessMode = message.imagelessMode; + return object; + }; + + /** + * Converts this ProcessRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @instance + * @returns {Object.} JSON object + */ + ProcessRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessRequest"; + }; + + return ProcessRequest; + })(); + + v1beta3.HumanReviewStatus = (function() { + + /** + * Properties of a HumanReviewStatus. + * @memberof google.cloud.documentai.v1beta3 + * @interface IHumanReviewStatus + * @property {google.cloud.documentai.v1beta3.HumanReviewStatus.State|null} [state] HumanReviewStatus state + * @property {string|null} [stateMessage] HumanReviewStatus stateMessage + * @property {string|null} [humanReviewOperation] HumanReviewStatus humanReviewOperation + */ + + /** + * Constructs a new HumanReviewStatus. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a HumanReviewStatus. + * @implements IHumanReviewStatus + * @constructor + * @param {google.cloud.documentai.v1beta3.IHumanReviewStatus=} [properties] Properties to set + */ + function HumanReviewStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HumanReviewStatus state. + * @member {google.cloud.documentai.v1beta3.HumanReviewStatus.State} state + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @instance + */ + HumanReviewStatus.prototype.state = 0; + + /** + * HumanReviewStatus stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @instance + */ + HumanReviewStatus.prototype.stateMessage = ""; + + /** + * HumanReviewStatus humanReviewOperation. + * @member {string} humanReviewOperation + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @instance + */ + HumanReviewStatus.prototype.humanReviewOperation = ""; + + /** + * Creates a new HumanReviewStatus instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @static + * @param {google.cloud.documentai.v1beta3.IHumanReviewStatus=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.HumanReviewStatus} HumanReviewStatus instance + */ + HumanReviewStatus.create = function create(properties) { + return new HumanReviewStatus(properties); + }; + + /** + * Encodes the specified HumanReviewStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.HumanReviewStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @static + * @param {google.cloud.documentai.v1beta3.IHumanReviewStatus} message HumanReviewStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanReviewStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); + if (message.humanReviewOperation != null && Object.hasOwnProperty.call(message, "humanReviewOperation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.humanReviewOperation); + return writer; + }; + + /** + * Encodes the specified HumanReviewStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.HumanReviewStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @static + * @param {google.cloud.documentai.v1beta3.IHumanReviewStatus} message HumanReviewStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanReviewStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HumanReviewStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.HumanReviewStatus} HumanReviewStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HumanReviewStatus.decode = function decode(reader, 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.v1beta3.HumanReviewStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.stateMessage = reader.string(); + break; + } + case 3: { + message.humanReviewOperation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HumanReviewStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.HumanReviewStatus} HumanReviewStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HumanReviewStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HumanReviewStatus message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HumanReviewStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) + if (!$util.isString(message.humanReviewOperation)) + return "humanReviewOperation: string expected"; + return null; + }; + + /** + * Creates a HumanReviewStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.HumanReviewStatus} HumanReviewStatus + */ + HumanReviewStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.HumanReviewStatus) + return object; + var message = new $root.google.cloud.documentai.v1beta3.HumanReviewStatus(); + 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 "SKIPPED": + case 1: + message.state = 1; + break; + case "VALIDATION_PASSED": + case 2: + message.state = 2; + break; + case "IN_PROGRESS": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.humanReviewOperation != null) + message.humanReviewOperation = String(object.humanReviewOperation); + return message; + }; + + /** + * Creates a plain object from a HumanReviewStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @static + * @param {google.cloud.documentai.v1beta3.HumanReviewStatus} message HumanReviewStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HumanReviewStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.humanReviewOperation = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.HumanReviewStatus.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.HumanReviewStatus.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) + object.humanReviewOperation = message.humanReviewOperation; + return object; + }; + + /** + * Converts this HumanReviewStatus to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @instance + * @returns {Object.} JSON object + */ + HumanReviewStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HumanReviewStatus + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HumanReviewStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.HumanReviewStatus"; + }; + + /** + * State enum. + * @name google.cloud.documentai.v1beta3.HumanReviewStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} SKIPPED=1 SKIPPED value + * @property {number} VALIDATION_PASSED=2 VALIDATION_PASSED value + * @property {number} IN_PROGRESS=3 IN_PROGRESS value + * @property {number} ERROR=4 ERROR value + */ + HumanReviewStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SKIPPED"] = 1; + values[valuesById[2] = "VALIDATION_PASSED"] = 2; + values[valuesById[3] = "IN_PROGRESS"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); + + return HumanReviewStatus; + })(); + + v1beta3.ProcessResponse = (function() { + + /** + * Properties of a ProcessResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IProcessResponse + * @property {google.cloud.documentai.v1beta3.IDocument|null} [document] ProcessResponse document + * @property {string|null} [humanReviewOperation] ProcessResponse humanReviewOperation + * @property {google.cloud.documentai.v1beta3.IHumanReviewStatus|null} [humanReviewStatus] ProcessResponse humanReviewStatus + */ + + /** + * Constructs a new ProcessResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ProcessResponse. + * @implements IProcessResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IProcessResponse=} [properties] Properties to set + */ + function ProcessResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessResponse document. + * @member {google.cloud.documentai.v1beta3.IDocument|null|undefined} document + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @instance + */ + ProcessResponse.prototype.document = null; + + /** + * ProcessResponse humanReviewOperation. + * @member {string} humanReviewOperation + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @instance + */ + ProcessResponse.prototype.humanReviewOperation = ""; + + /** + * ProcessResponse humanReviewStatus. + * @member {google.cloud.documentai.v1beta3.IHumanReviewStatus|null|undefined} humanReviewStatus + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @instance + */ + ProcessResponse.prototype.humanReviewStatus = null; + + /** + * Creates a new ProcessResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @static + * @param {google.cloud.documentai.v1beta3.IProcessResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessResponse} ProcessResponse instance + */ + ProcessResponse.create = function create(properties) { + return new ProcessResponse(properties); + }; + + /** + * Encodes the specified ProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @static + * @param {google.cloud.documentai.v1beta3.IProcessResponse} message ProcessResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.documentai.v1beta3.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.humanReviewOperation != null && Object.hasOwnProperty.call(message, "humanReviewOperation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.humanReviewOperation); + if (message.humanReviewStatus != null && Object.hasOwnProperty.call(message, "humanReviewStatus")) + $root.google.cloud.documentai.v1beta3.HumanReviewStatus.encode(message.humanReviewStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @static + * @param {google.cloud.documentai.v1beta3.IProcessResponse} message ProcessResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessResponse} ProcessResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessResponse.decode = function decode(reader, 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.v1beta3.ProcessResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32()); + break; + } + case 2: { + message.humanReviewOperation = reader.string(); + break; + } + case 3: { + message.humanReviewStatus = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessResponse} ProcessResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessResponse.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.documentai.v1beta3.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) + if (!$util.isString(message.humanReviewOperation)) + return "humanReviewOperation: string expected"; + if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) { + var error = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.verify(message.humanReviewStatus); + if (error) + return "humanReviewStatus." + error; + } + return null; + }; + + /** + * Creates a ProcessResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessResponse} ProcessResponse + */ + ProcessResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessResponse) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessResponse(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessResponse.document: object expected"); + message.document = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.document); + } + if (object.humanReviewOperation != null) + message.humanReviewOperation = String(object.humanReviewOperation); + if (object.humanReviewStatus != null) { + if (typeof object.humanReviewStatus !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessResponse.humanReviewStatus: object expected"); + message.humanReviewStatus = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.fromObject(object.humanReviewStatus); + } + return message; + }; + + /** + * Creates a plain object from a ProcessResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @static + * @param {google.cloud.documentai.v1beta3.ProcessResponse} message ProcessResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.humanReviewOperation = ""; + object.humanReviewStatus = null; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.documentai.v1beta3.Document.toObject(message.document, options); + if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) + object.humanReviewOperation = message.humanReviewOperation; + if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) + object.humanReviewStatus = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.toObject(message.humanReviewStatus, options); + return object; + }; + + /** + * Converts this ProcessResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @instance + * @returns {Object.} JSON object + */ + ProcessResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessResponse"; + }; + + return ProcessResponse; + })(); + + v1beta3.BatchProcessRequest = (function() { + + /** + * Properties of a BatchProcessRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IBatchProcessRequest + * @property {string|null} [name] BatchProcessRequest name + * @property {Array.|null} [inputConfigs] BatchProcessRequest inputConfigs + * @property {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig|null} [outputConfig] BatchProcessRequest outputConfig + * @property {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null} [inputDocuments] BatchProcessRequest inputDocuments + * @property {google.cloud.documentai.v1beta3.IDocumentOutputConfig|null} [documentOutputConfig] BatchProcessRequest documentOutputConfig + * @property {boolean|null} [skipHumanReview] BatchProcessRequest skipHumanReview + * @property {google.cloud.documentai.v1beta3.IProcessOptions|null} [processOptions] BatchProcessRequest processOptions + * @property {Object.|null} [labels] BatchProcessRequest labels + */ + + /** + * Constructs a new BatchProcessRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a BatchProcessRequest. + * @implements IBatchProcessRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IBatchProcessRequest=} [properties] Properties to set + */ + function BatchProcessRequest(properties) { + this.inputConfigs = []; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchProcessRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.name = ""; + + /** + * BatchProcessRequest inputConfigs. + * @member {Array.} inputConfigs + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.inputConfigs = $util.emptyArray; + + /** + * BatchProcessRequest outputConfig. + * @member {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.outputConfig = null; + + /** + * BatchProcessRequest inputDocuments. + * @member {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null|undefined} inputDocuments + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.inputDocuments = null; + + /** + * BatchProcessRequest documentOutputConfig. + * @member {google.cloud.documentai.v1beta3.IDocumentOutputConfig|null|undefined} documentOutputConfig + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.documentOutputConfig = null; + + /** + * BatchProcessRequest skipHumanReview. + * @member {boolean} skipHumanReview + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.skipHumanReview = false; + + /** + * BatchProcessRequest processOptions. + * @member {google.cloud.documentai.v1beta3.IProcessOptions|null|undefined} processOptions + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.processOptions = null; + + /** + * BatchProcessRequest labels. + * @member {Object.} labels + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @instance + */ + BatchProcessRequest.prototype.labels = $util.emptyObject; + + /** + * Creates a new BatchProcessRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @static + * @param {google.cloud.documentai.v1beta3.IBatchProcessRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest} BatchProcessRequest instance + */ + BatchProcessRequest.create = function create(properties) { + return new BatchProcessRequest(properties); + }; + + /** + * Encodes the specified BatchProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @static + * @param {google.cloud.documentai.v1beta3.IBatchProcessRequest} message BatchProcessRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProcessRequest.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.inputConfigs != null && message.inputConfigs.length) + for (var i = 0; i < message.inputConfigs.length; ++i) + $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.skipHumanReview != null && Object.hasOwnProperty.call(message, "skipHumanReview")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipHumanReview); + if (message.inputDocuments != null && Object.hasOwnProperty.call(message, "inputDocuments")) + $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.encode(message.inputDocuments, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.documentOutputConfig != null && Object.hasOwnProperty.call(message, "documentOutputConfig")) + $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.encode(message.documentOutputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.processOptions != null && Object.hasOwnProperty.call(message, "processOptions")) + $root.google.cloud.documentai.v1beta3.ProcessOptions.encode(message.processOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @static + * @param {google.cloud.documentai.v1beta3.IBatchProcessRequest} message BatchProcessRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProcessRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchProcessRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest} BatchProcessRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProcessRequest.decode = function decode(reader, 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.v1beta3.BatchProcessRequest(), key, value; + 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.inputConfigs && message.inputConfigs.length)) + message.inputConfigs = []; + message.inputConfigs.push($root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.outputConfig = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.inputDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.documentOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.skipHumanReview = reader.bool(); + break; + } + case 7: { + message.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchProcessRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest} BatchProcessRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProcessRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchProcessRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchProcessRequest.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.inputConfigs != null && message.hasOwnProperty("inputConfigs")) { + if (!Array.isArray(message.inputConfigs)) + return "inputConfigs: array expected"; + for (var i = 0; i < message.inputConfigs.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.verify(message.inputConfigs[i]); + if (error) + return "inputConfigs." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.inputDocuments != null && message.hasOwnProperty("inputDocuments")) { + var error = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify(message.inputDocuments); + if (error) + return "inputDocuments." + error; + } + if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) { + var error = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.verify(message.documentOutputConfig); + if (error) + return "documentOutputConfig." + error; + } + if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) + if (typeof message.skipHumanReview !== "boolean") + return "skipHumanReview: boolean expected"; + if (message.processOptions != null && message.hasOwnProperty("processOptions")) { + var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.verify(message.processOptions); + if (error) + return "processOptions." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a BatchProcessRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest} BatchProcessRequest + */ + BatchProcessRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchProcessRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.BatchProcessRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.inputConfigs) { + if (!Array.isArray(object.inputConfigs)) + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.inputConfigs: array expected"); + message.inputConfigs = []; + for (var i = 0; i < object.inputConfigs.length; ++i) { + if (typeof object.inputConfigs[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.inputConfigs: object expected"); + message.inputConfigs[i] = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.fromObject(object.inputConfigs[i]); + } + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.fromObject(object.outputConfig); + } + if (object.inputDocuments != null) { + if (typeof object.inputDocuments !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.inputDocuments: object expected"); + message.inputDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.fromObject(object.inputDocuments); + } + if (object.documentOutputConfig != null) { + if (typeof object.documentOutputConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.documentOutputConfig: object expected"); + message.documentOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.fromObject(object.documentOutputConfig); + } + if (object.skipHumanReview != null) + message.skipHumanReview = Boolean(object.skipHumanReview); + if (object.processOptions != null) { + if (typeof object.processOptions !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.processOptions: object expected"); + message.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.fromObject(object.processOptions); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a BatchProcessRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessRequest} message BatchProcessRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchProcessRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inputConfigs = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.outputConfig = null; + object.skipHumanReview = false; + object.inputDocuments = null; + object.documentOutputConfig = null; + object.processOptions = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputConfigs && message.inputConfigs.length) { + object.inputConfigs = []; + for (var j = 0; j < message.inputConfigs.length; ++j) + object.inputConfigs[j] = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.toObject(message.inputConfigs[j], options); + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.toObject(message.outputConfig, options); + if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) + object.skipHumanReview = message.skipHumanReview; + if (message.inputDocuments != null && message.hasOwnProperty("inputDocuments")) + object.inputDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.toObject(message.inputDocuments, options); + if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) + object.documentOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.toObject(message.documentOutputConfig, options); + if (message.processOptions != null && message.hasOwnProperty("processOptions")) + object.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.toObject(message.processOptions, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this BatchProcessRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @instance + * @returns {Object.} JSON object + */ + BatchProcessRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchProcessRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchProcessRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchProcessRequest"; + }; + + BatchProcessRequest.BatchInputConfig = (function() { + + /** + * Properties of a BatchInputConfig. + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @interface IBatchInputConfig + * @property {string|null} [gcsSource] BatchInputConfig gcsSource + * @property {string|null} [mimeType] BatchInputConfig mimeType + */ + + /** + * Constructs a new BatchInputConfig. + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @classdesc Represents a BatchInputConfig. + * @implements IBatchInputConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig=} [properties] Properties to set + */ + function BatchInputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchInputConfig gcsSource. + * @member {string} gcsSource + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig + * @instance + */ + BatchInputConfig.prototype.gcsSource = ""; + + /** + * BatchInputConfig mimeType. + * @member {string} mimeType + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig + * @instance + */ + BatchInputConfig.prototype.mimeType = ""; + + /** + * Creates a new BatchInputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig} BatchInputConfig instance + */ + BatchInputConfig.create = function create(properties) { + return new BatchInputConfig(properties); + }; + + /** + * Encodes the specified BatchInputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig} message BatchInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchInputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsSource); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified BatchInputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig} message BatchInputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchInputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchInputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig} BatchInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchInputConfig.decode = function decode(reader, 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.v1beta3.BatchProcessRequest.BatchInputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsSource = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchInputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig} BatchInputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchInputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchInputConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchInputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + if (!$util.isString(message.gcsSource)) + return "gcsSource: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a BatchInputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig} BatchInputConfig + */ + BatchInputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig(); + if (object.gcsSource != null) + message.gcsSource = String(object.gcsSource); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a BatchInputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig} message BatchInputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchInputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsSource = ""; + object.mimeType = ""; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) + object.gcsSource = message.gcsSource; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this BatchInputConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchInputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchInputConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig"; + }; + + return BatchInputConfig; + })(); + + BatchProcessRequest.BatchOutputConfig = (function() { + + /** + * Properties of a BatchOutputConfig. + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @interface IBatchOutputConfig + * @property {string|null} [gcsDestination] BatchOutputConfig gcsDestination + */ + + /** + * Constructs a new BatchOutputConfig. + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest + * @classdesc Represents a BatchOutputConfig. + * @implements IBatchOutputConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig=} [properties] Properties to set + */ + function BatchOutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchOutputConfig gcsDestination. + * @member {string} gcsDestination + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig + * @instance + */ + BatchOutputConfig.prototype.gcsDestination = ""; + + /** + * Creates a new BatchOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig} BatchOutputConfig instance + */ + BatchOutputConfig.create = function create(properties) { + return new BatchOutputConfig(properties); + }; + + /** + * Encodes the specified BatchOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig} message BatchOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsDestination); + return writer; + }; + + /** + * Encodes the specified BatchOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig} message BatchOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig} BatchOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOutputConfig.decode = function decode(reader, 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.v1beta3.BatchProcessRequest.BatchOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsDestination = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig} BatchOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchOutputConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + if (!$util.isString(message.gcsDestination)) + return "gcsDestination: string expected"; + return null; + }; + + /** + * Creates a BatchOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig} BatchOutputConfig + */ + BatchOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig(); + if (object.gcsDestination != null) + message.gcsDestination = String(object.gcsDestination); + return message; + }; + + /** + * Creates a plain object from a BatchOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig} message BatchOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.gcsDestination = ""; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + object.gcsDestination = message.gcsDestination; + return object; + }; + + /** + * Converts this BatchOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig + * @instance + * @returns {Object.} JSON object + */ + BatchOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchOutputConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig"; + }; + + return BatchOutputConfig; + })(); + + return BatchProcessRequest; + })(); + + v1beta3.BatchProcessResponse = (function() { + + /** + * Properties of a BatchProcessResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IBatchProcessResponse + */ + + /** + * Constructs a new BatchProcessResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a BatchProcessResponse. + * @implements IBatchProcessResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IBatchProcessResponse=} [properties] Properties to set + */ + function BatchProcessResponse(properties) { + if (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 BatchProcessResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse + * @static + * @param {google.cloud.documentai.v1beta3.IBatchProcessResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchProcessResponse} BatchProcessResponse instance + */ + BatchProcessResponse.create = function create(properties) { + return new BatchProcessResponse(properties); + }; + + /** + * Encodes the specified BatchProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse + * @static + * @param {google.cloud.documentai.v1beta3.IBatchProcessResponse} message BatchProcessResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProcessResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BatchProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse + * @static + * @param {google.cloud.documentai.v1beta3.IBatchProcessResponse} message BatchProcessResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProcessResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchProcessResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchProcessResponse} BatchProcessResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProcessResponse.decode = function decode(reader, 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.v1beta3.BatchProcessResponse(); + 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 BatchProcessResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchProcessResponse} BatchProcessResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProcessResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchProcessResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchProcessResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BatchProcessResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchProcessResponse} BatchProcessResponse + */ + BatchProcessResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchProcessResponse) + return object; + return new $root.google.cloud.documentai.v1beta3.BatchProcessResponse(); + }; + + /** + * Creates a plain object from a BatchProcessResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessResponse} message BatchProcessResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchProcessResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BatchProcessResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse + * @instance + * @returns {Object.} JSON object + */ + BatchProcessResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchProcessResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchProcessResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchProcessResponse"; + }; + + return BatchProcessResponse; + })(); + + v1beta3.BatchProcessMetadata = (function() { + + /** + * Properties of a BatchProcessMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IBatchProcessMetadata + * @property {google.cloud.documentai.v1beta3.BatchProcessMetadata.State|null} [state] BatchProcessMetadata state + * @property {string|null} [stateMessage] BatchProcessMetadata stateMessage + * @property {google.protobuf.ITimestamp|null} [createTime] BatchProcessMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BatchProcessMetadata updateTime + * @property {Array.|null} [individualProcessStatuses] BatchProcessMetadata individualProcessStatuses + */ + + /** + * Constructs a new BatchProcessMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a BatchProcessMetadata. + * @implements IBatchProcessMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IBatchProcessMetadata=} [properties] Properties to set + */ + function BatchProcessMetadata(properties) { + this.individualProcessStatuses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchProcessMetadata state. + * @member {google.cloud.documentai.v1beta3.BatchProcessMetadata.State} state + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @instance + */ + BatchProcessMetadata.prototype.state = 0; + + /** + * BatchProcessMetadata stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @instance + */ + BatchProcessMetadata.prototype.stateMessage = ""; + + /** + * BatchProcessMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @instance + */ + BatchProcessMetadata.prototype.createTime = null; + + /** + * BatchProcessMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @instance + */ + BatchProcessMetadata.prototype.updateTime = null; + + /** + * BatchProcessMetadata individualProcessStatuses. + * @member {Array.} individualProcessStatuses + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @instance + */ + BatchProcessMetadata.prototype.individualProcessStatuses = $util.emptyArray; + + /** + * Creates a new BatchProcessMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IBatchProcessMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata} BatchProcessMetadata instance + */ + BatchProcessMetadata.create = function create(properties) { + return new BatchProcessMetadata(properties); + }; + + /** + * Encodes the specified BatchProcessMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IBatchProcessMetadata} message BatchProcessMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProcessMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); + 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.individualProcessStatuses != null && message.individualProcessStatuses.length) + for (var i = 0; i < message.individualProcessStatuses.length; ++i) + $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.encode(message.individualProcessStatuses[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchProcessMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IBatchProcessMetadata} message BatchProcessMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchProcessMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchProcessMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata} BatchProcessMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProcessMetadata.decode = function decode(reader, 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.v1beta3.BatchProcessMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.stateMessage = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.individualProcessStatuses && message.individualProcessStatuses.length)) + message.individualProcessStatuses = []; + message.individualProcessStatuses.push($root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchProcessMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata} BatchProcessMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchProcessMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchProcessMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchProcessMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.individualProcessStatuses != null && message.hasOwnProperty("individualProcessStatuses")) { + if (!Array.isArray(message.individualProcessStatuses)) + return "individualProcessStatuses: array expected"; + for (var i = 0; i < message.individualProcessStatuses.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.verify(message.individualProcessStatuses[i]); + if (error) + return "individualProcessStatuses." + error; + } + } + return null; + }; + + /** + * Creates a BatchProcessMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata} BatchProcessMetadata + */ + BatchProcessMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchProcessMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.BatchProcessMetadata(); + 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 "WAITING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "CANCELLING": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.individualProcessStatuses) { + if (!Array.isArray(object.individualProcessStatuses)) + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessMetadata.individualProcessStatuses: array expected"); + message.individualProcessStatuses = []; + for (var i = 0; i < object.individualProcessStatuses.length; ++i) { + if (typeof object.individualProcessStatuses[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessMetadata.individualProcessStatuses: object expected"); + message.individualProcessStatuses[i] = $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.fromObject(object.individualProcessStatuses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchProcessMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessMetadata} message BatchProcessMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchProcessMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.individualProcessStatuses = []; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.individualProcessStatuses && message.individualProcessStatuses.length) { + object.individualProcessStatuses = []; + for (var j = 0; j < message.individualProcessStatuses.length; ++j) + object.individualProcessStatuses[j] = $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.toObject(message.individualProcessStatuses[j], options); + } + return object; + }; + + /** + * Converts this BatchProcessMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchProcessMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchProcessMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchProcessMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchProcessMetadata"; + }; + + BatchProcessMetadata.IndividualProcessStatus = (function() { + + /** + * Properties of an IndividualProcessStatus. + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @interface IIndividualProcessStatus + * @property {string|null} [inputGcsSource] IndividualProcessStatus inputGcsSource + * @property {google.rpc.IStatus|null} [status] IndividualProcessStatus status + * @property {string|null} [outputGcsDestination] IndividualProcessStatus outputGcsDestination + * @property {string|null} [humanReviewOperation] IndividualProcessStatus humanReviewOperation + * @property {google.cloud.documentai.v1beta3.IHumanReviewStatus|null} [humanReviewStatus] IndividualProcessStatus humanReviewStatus + */ + + /** + * Constructs a new IndividualProcessStatus. + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata + * @classdesc Represents an IndividualProcessStatus. + * @implements IIndividualProcessStatus + * @constructor + * @param {google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus=} [properties] Properties to set + */ + function IndividualProcessStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndividualProcessStatus inputGcsSource. + * @member {string} inputGcsSource + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @instance + */ + IndividualProcessStatus.prototype.inputGcsSource = ""; + + /** + * IndividualProcessStatus status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @instance + */ + IndividualProcessStatus.prototype.status = null; + + /** + * IndividualProcessStatus outputGcsDestination. + * @member {string} outputGcsDestination + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @instance + */ + IndividualProcessStatus.prototype.outputGcsDestination = ""; + + /** + * IndividualProcessStatus humanReviewOperation. + * @member {string} humanReviewOperation + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @instance + */ + IndividualProcessStatus.prototype.humanReviewOperation = ""; + + /** + * IndividualProcessStatus humanReviewStatus. + * @member {google.cloud.documentai.v1beta3.IHumanReviewStatus|null|undefined} humanReviewStatus + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @instance + */ + IndividualProcessStatus.prototype.humanReviewStatus = null; + + /** + * Creates a new IndividualProcessStatus instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus instance + */ + IndividualProcessStatus.create = function create(properties) { + return new IndividualProcessStatus(properties); + }; + + /** + * Encodes the specified IndividualProcessStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus} message IndividualProcessStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualProcessStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputGcsSource != null && Object.hasOwnProperty.call(message, "inputGcsSource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputGcsSource); + 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(); + if (message.outputGcsDestination != null && Object.hasOwnProperty.call(message, "outputGcsDestination")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputGcsDestination); + if (message.humanReviewOperation != null && Object.hasOwnProperty.call(message, "humanReviewOperation")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.humanReviewOperation); + if (message.humanReviewStatus != null && Object.hasOwnProperty.call(message, "humanReviewStatus")) + $root.google.cloud.documentai.v1beta3.HumanReviewStatus.encode(message.humanReviewStatus, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IndividualProcessStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus} message IndividualProcessStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualProcessStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndividualProcessStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualProcessStatus.decode = function decode(reader, 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.v1beta3.BatchProcessMetadata.IndividualProcessStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputGcsSource = reader.string(); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 3: { + message.outputGcsDestination = reader.string(); + break; + } + case 4: { + message.humanReviewOperation = reader.string(); + break; + } + case 5: { + message.humanReviewStatus = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndividualProcessStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualProcessStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndividualProcessStatus message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndividualProcessStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) + if (!$util.isString(message.inputGcsSource)) + return "inputGcsSource: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.outputGcsDestination != null && message.hasOwnProperty("outputGcsDestination")) + if (!$util.isString(message.outputGcsDestination)) + return "outputGcsDestination: string expected"; + if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) + if (!$util.isString(message.humanReviewOperation)) + return "humanReviewOperation: string expected"; + if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) { + var error = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.verify(message.humanReviewStatus); + if (error) + return "humanReviewStatus." + error; + } + return null; + }; + + /** + * Creates an IndividualProcessStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus + */ + IndividualProcessStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus) + return object; + var message = new $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus(); + if (object.inputGcsSource != null) + message.inputGcsSource = String(object.inputGcsSource); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.outputGcsDestination != null) + message.outputGcsDestination = String(object.outputGcsDestination); + if (object.humanReviewOperation != null) + message.humanReviewOperation = String(object.humanReviewOperation); + if (object.humanReviewStatus != null) { + if (typeof object.humanReviewStatus !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.humanReviewStatus: object expected"); + message.humanReviewStatus = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.fromObject(object.humanReviewStatus); + } + return message; + }; + + /** + * Creates a plain object from an IndividualProcessStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus} message IndividualProcessStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndividualProcessStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputGcsSource = ""; + object.status = null; + object.outputGcsDestination = ""; + object.humanReviewOperation = ""; + object.humanReviewStatus = null; + } + if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) + object.inputGcsSource = message.inputGcsSource; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.outputGcsDestination != null && message.hasOwnProperty("outputGcsDestination")) + object.outputGcsDestination = message.outputGcsDestination; + if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) + object.humanReviewOperation = message.humanReviewOperation; + if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) + object.humanReviewStatus = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.toObject(message.humanReviewStatus, options); + return object; + }; + + /** + * Converts this IndividualProcessStatus to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @instance + * @returns {Object.} JSON object + */ + IndividualProcessStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndividualProcessStatus + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndividualProcessStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus"; + }; + + return IndividualProcessStatus; + })(); + + /** + * State enum. + * @name google.cloud.documentai.v1beta3.BatchProcessMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} WAITING=1 WAITING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} CANCELLING=4 CANCELLING value + * @property {number} CANCELLED=5 CANCELLED value + * @property {number} FAILED=6 FAILED value + */ + BatchProcessMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "WAITING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "CANCELLING"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + values[valuesById[6] = "FAILED"] = 6; + return values; + })(); + + return BatchProcessMetadata; + })(); + + v1beta3.FetchProcessorTypesRequest = (function() { + + /** + * Properties of a FetchProcessorTypesRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IFetchProcessorTypesRequest + * @property {string|null} [parent] FetchProcessorTypesRequest parent + */ + + /** + * Constructs a new FetchProcessorTypesRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a FetchProcessorTypesRequest. + * @implements IFetchProcessorTypesRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest=} [properties] Properties to set + */ + function FetchProcessorTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchProcessorTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + * @instance + */ + FetchProcessorTypesRequest.prototype.parent = ""; + + /** + * Creates a new FetchProcessorTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesRequest} FetchProcessorTypesRequest instance + */ + FetchProcessorTypesRequest.create = function create(properties) { + return new FetchProcessorTypesRequest(properties); + }; + + /** + * Encodes the specified FetchProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest} message FetchProcessorTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchProcessorTypesRequest.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); + return writer; + }; + + /** + * Encodes the specified FetchProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest} message FetchProcessorTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchProcessorTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesRequest} FetchProcessorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchProcessorTypesRequest.decode = function decode(reader, 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.v1beta3.FetchProcessorTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesRequest} FetchProcessorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchProcessorTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchProcessorTypesRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchProcessorTypesRequest.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"; + return null; + }; + + /** + * Creates a FetchProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesRequest} FetchProcessorTypesRequest + */ + FetchProcessorTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a FetchProcessorTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1beta3.FetchProcessorTypesRequest} message FetchProcessorTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchProcessorTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this FetchProcessorTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + * @instance + * @returns {Object.} JSON object + */ + FetchProcessorTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchProcessorTypesRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchProcessorTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.FetchProcessorTypesRequest"; + }; + + return FetchProcessorTypesRequest; + })(); + + v1beta3.FetchProcessorTypesResponse = (function() { + + /** + * Properties of a FetchProcessorTypesResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IFetchProcessorTypesResponse + * @property {Array.|null} [processorTypes] FetchProcessorTypesResponse processorTypes + */ + + /** + * Constructs a new FetchProcessorTypesResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a FetchProcessorTypesResponse. + * @implements IFetchProcessorTypesResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse=} [properties] Properties to set + */ + function FetchProcessorTypesResponse(properties) { + this.processorTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchProcessorTypesResponse processorTypes. + * @member {Array.} processorTypes + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + * @instance + */ + FetchProcessorTypesResponse.prototype.processorTypes = $util.emptyArray; + + /** + * Creates a new FetchProcessorTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} FetchProcessorTypesResponse instance + */ + FetchProcessorTypesResponse.create = function create(properties) { + return new FetchProcessorTypesResponse(properties); + }; + + /** + * Encodes the specified FetchProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse} message FetchProcessorTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchProcessorTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorTypes != null && message.processorTypes.length) + for (var i = 0; i < message.processorTypes.length; ++i) + $root.google.cloud.documentai.v1beta3.ProcessorType.encode(message.processorTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FetchProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse} message FetchProcessorTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchProcessorTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} FetchProcessorTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchProcessorTypesResponse.decode = function decode(reader, 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.v1beta3.FetchProcessorTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.processorTypes && message.processorTypes.length)) + message.processorTypes = []; + message.processorTypes.push($root.google.cloud.documentai.v1beta3.ProcessorType.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} FetchProcessorTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchProcessorTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchProcessorTypesResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchProcessorTypesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorTypes != null && message.hasOwnProperty("processorTypes")) { + if (!Array.isArray(message.processorTypes)) + return "processorTypes: array expected"; + for (var i = 0; i < message.processorTypes.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.ProcessorType.verify(message.processorTypes[i]); + if (error) + return "processorTypes." + error; + } + } + return null; + }; + + /** + * Creates a FetchProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} FetchProcessorTypesResponse + */ + FetchProcessorTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse) + return object; + var message = new $root.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse(); + if (object.processorTypes) { + if (!Array.isArray(object.processorTypes)) + throw TypeError(".google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.processorTypes: array expected"); + message.processorTypes = []; + for (var i = 0; i < object.processorTypes.length; ++i) { + if (typeof object.processorTypes[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.processorTypes: object expected"); + message.processorTypes[i] = $root.google.cloud.documentai.v1beta3.ProcessorType.fromObject(object.processorTypes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FetchProcessorTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} message FetchProcessorTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchProcessorTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.processorTypes = []; + if (message.processorTypes && message.processorTypes.length) { + object.processorTypes = []; + for (var j = 0; j < message.processorTypes.length; ++j) + object.processorTypes[j] = $root.google.cloud.documentai.v1beta3.ProcessorType.toObject(message.processorTypes[j], options); + } + return object; + }; + + /** + * Converts this FetchProcessorTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + * @instance + * @returns {Object.} JSON object + */ + FetchProcessorTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchProcessorTypesResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchProcessorTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.FetchProcessorTypesResponse"; + }; + + return FetchProcessorTypesResponse; + })(); + + v1beta3.ListProcessorTypesRequest = (function() { + + /** + * Properties of a ListProcessorTypesRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IListProcessorTypesRequest + * @property {string|null} [parent] ListProcessorTypesRequest parent + * @property {number|null} [pageSize] ListProcessorTypesRequest pageSize + * @property {string|null} [pageToken] ListProcessorTypesRequest pageToken + */ + + /** + * Constructs a new ListProcessorTypesRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ListProcessorTypesRequest. + * @implements IListProcessorTypesRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IListProcessorTypesRequest=} [properties] Properties to set + */ + function ListProcessorTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @instance + */ + ListProcessorTypesRequest.prototype.parent = ""; + + /** + * ListProcessorTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @instance + */ + ListProcessorTypesRequest.prototype.pageSize = 0; + + /** + * ListProcessorTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @instance + */ + ListProcessorTypesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProcessorTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorTypesRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesRequest} ListProcessorTypesRequest instance + */ + ListProcessorTypesRequest.create = function create(properties) { + return new ListProcessorTypesRequest(properties); + }; + + /** + * Encodes the specified ListProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorTypesRequest} message ListProcessorTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorTypesRequest.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 ListProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorTypesRequest} message ListProcessorTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesRequest} ListProcessorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorTypesRequest.decode = function decode(reader, 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.v1beta3.ListProcessorTypesRequest(); + 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 ListProcessorTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesRequest} ListProcessorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorTypesRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorTypesRequest.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 ListProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesRequest} ListProcessorTypesRequest + */ + ListProcessorTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ListProcessorTypesRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ListProcessorTypesRequest(); + 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 ListProcessorTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @static + * @param {google.cloud.documentai.v1beta3.ListProcessorTypesRequest} message ListProcessorTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorTypesRequest.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 ListProcessorTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListProcessorTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorTypesRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListProcessorTypesRequest"; + }; + + return ListProcessorTypesRequest; + })(); + + v1beta3.ListProcessorTypesResponse = (function() { + + /** + * Properties of a ListProcessorTypesResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IListProcessorTypesResponse + * @property {Array.|null} [processorTypes] ListProcessorTypesResponse processorTypes + * @property {string|null} [nextPageToken] ListProcessorTypesResponse nextPageToken + */ + + /** + * Constructs a new ListProcessorTypesResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ListProcessorTypesResponse. + * @implements IListProcessorTypesResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IListProcessorTypesResponse=} [properties] Properties to set + */ + function ListProcessorTypesResponse(properties) { + this.processorTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorTypesResponse processorTypes. + * @member {Array.} processorTypes + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse + * @instance + */ + ListProcessorTypesResponse.prototype.processorTypes = $util.emptyArray; + + /** + * ListProcessorTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse + * @instance + */ + ListProcessorTypesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProcessorTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorTypesResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesResponse} ListProcessorTypesResponse instance + */ + ListProcessorTypesResponse.create = function create(properties) { + return new ListProcessorTypesResponse(properties); + }; + + /** + * Encodes the specified ListProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorTypesResponse} message ListProcessorTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorTypes != null && message.processorTypes.length) + for (var i = 0; i < message.processorTypes.length; ++i) + $root.google.cloud.documentai.v1beta3.ProcessorType.encode(message.processorTypes[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 ListProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorTypesResponse} message ListProcessorTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesResponse} ListProcessorTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorTypesResponse.decode = function decode(reader, 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.v1beta3.ListProcessorTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.processorTypes && message.processorTypes.length)) + message.processorTypes = []; + message.processorTypes.push($root.google.cloud.documentai.v1beta3.ProcessorType.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProcessorTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesResponse} ListProcessorTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorTypesResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorTypesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorTypes != null && message.hasOwnProperty("processorTypes")) { + if (!Array.isArray(message.processorTypes)) + return "processorTypes: array expected"; + for (var i = 0; i < message.processorTypes.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.ProcessorType.verify(message.processorTypes[i]); + if (error) + return "processorTypes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesResponse} ListProcessorTypesResponse + */ + ListProcessorTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ListProcessorTypesResponse) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ListProcessorTypesResponse(); + if (object.processorTypes) { + if (!Array.isArray(object.processorTypes)) + throw TypeError(".google.cloud.documentai.v1beta3.ListProcessorTypesResponse.processorTypes: array expected"); + message.processorTypes = []; + for (var i = 0; i < object.processorTypes.length; ++i) { + if (typeof object.processorTypes[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ListProcessorTypesResponse.processorTypes: object expected"); + message.processorTypes[i] = $root.google.cloud.documentai.v1beta3.ProcessorType.fromObject(object.processorTypes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProcessorTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse + * @static + * @param {google.cloud.documentai.v1beta3.ListProcessorTypesResponse} message ListProcessorTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.processorTypes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.processorTypes && message.processorTypes.length) { + object.processorTypes = []; + for (var j = 0; j < message.processorTypes.length; ++j) + object.processorTypes[j] = $root.google.cloud.documentai.v1beta3.ProcessorType.toObject(message.processorTypes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProcessorTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ListProcessorTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorTypesResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListProcessorTypesResponse"; + }; + + return ListProcessorTypesResponse; + })(); + + v1beta3.ListProcessorsRequest = (function() { + + /** + * Properties of a ListProcessorsRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IListProcessorsRequest + * @property {string|null} [parent] ListProcessorsRequest parent + * @property {number|null} [pageSize] ListProcessorsRequest pageSize + * @property {string|null} [pageToken] ListProcessorsRequest pageToken + */ + + /** + * Constructs a new ListProcessorsRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ListProcessorsRequest. + * @implements IListProcessorsRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IListProcessorsRequest=} [properties] Properties to set + */ + function ListProcessorsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorsRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @instance + */ + ListProcessorsRequest.prototype.parent = ""; + + /** + * ListProcessorsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @instance + */ + ListProcessorsRequest.prototype.pageSize = 0; + + /** + * ListProcessorsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @instance + */ + ListProcessorsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProcessorsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorsRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ListProcessorsRequest} ListProcessorsRequest instance + */ + ListProcessorsRequest.create = function create(properties) { + return new ListProcessorsRequest(properties); + }; + + /** + * Encodes the specified ListProcessorsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorsRequest} message ListProcessorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorsRequest.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 ListProcessorsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorsRequest} message ListProcessorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ListProcessorsRequest} ListProcessorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorsRequest.decode = function decode(reader, 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.v1beta3.ListProcessorsRequest(); + 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 ListProcessorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ListProcessorsRequest} ListProcessorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorsRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorsRequest.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 ListProcessorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ListProcessorsRequest} ListProcessorsRequest + */ + ListProcessorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ListProcessorsRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ListProcessorsRequest(); + 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 ListProcessorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @static + * @param {google.cloud.documentai.v1beta3.ListProcessorsRequest} message ListProcessorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorsRequest.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 ListProcessorsRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProcessorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorsRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListProcessorsRequest"; + }; + + return ListProcessorsRequest; + })(); + + v1beta3.ListProcessorsResponse = (function() { + + /** + * Properties of a ListProcessorsResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IListProcessorsResponse + * @property {Array.|null} [processors] ListProcessorsResponse processors + * @property {string|null} [nextPageToken] ListProcessorsResponse nextPageToken + */ + + /** + * Constructs a new ListProcessorsResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ListProcessorsResponse. + * @implements IListProcessorsResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IListProcessorsResponse=} [properties] Properties to set + */ + function ListProcessorsResponse(properties) { + this.processors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorsResponse processors. + * @member {Array.} processors + * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse + * @instance + */ + ListProcessorsResponse.prototype.processors = $util.emptyArray; + + /** + * ListProcessorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse + * @instance + */ + ListProcessorsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProcessorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorsResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ListProcessorsResponse} ListProcessorsResponse instance + */ + ListProcessorsResponse.create = function create(properties) { + return new ListProcessorsResponse(properties); + }; + + /** + * Encodes the specified ListProcessorsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorsResponse} message ListProcessorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processors != null && message.processors.length) + for (var i = 0; i < message.processors.length; ++i) + $root.google.cloud.documentai.v1beta3.Processor.encode(message.processors[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 ListProcessorsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorsResponse} message ListProcessorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ListProcessorsResponse} ListProcessorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorsResponse.decode = function decode(reader, 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.v1beta3.ListProcessorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.processors && message.processors.length)) + message.processors = []; + message.processors.push($root.google.cloud.documentai.v1beta3.Processor.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProcessorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ListProcessorsResponse} ListProcessorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorsResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processors != null && message.hasOwnProperty("processors")) { + if (!Array.isArray(message.processors)) + return "processors: array expected"; + for (var i = 0; i < message.processors.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.Processor.verify(message.processors[i]); + if (error) + return "processors." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProcessorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ListProcessorsResponse} ListProcessorsResponse + */ + ListProcessorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ListProcessorsResponse) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ListProcessorsResponse(); + if (object.processors) { + if (!Array.isArray(object.processors)) + throw TypeError(".google.cloud.documentai.v1beta3.ListProcessorsResponse.processors: array expected"); + message.processors = []; + for (var i = 0; i < object.processors.length; ++i) { + if (typeof object.processors[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ListProcessorsResponse.processors: object expected"); + message.processors[i] = $root.google.cloud.documentai.v1beta3.Processor.fromObject(object.processors[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProcessorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse + * @static + * @param {google.cloud.documentai.v1beta3.ListProcessorsResponse} message ListProcessorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.processors = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.processors && message.processors.length) { + object.processors = []; + for (var j = 0; j < message.processors.length; ++j) + object.processors[j] = $root.google.cloud.documentai.v1beta3.Processor.toObject(message.processors[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProcessorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProcessorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorsResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListProcessorsResponse"; + }; + + return ListProcessorsResponse; + })(); + + v1beta3.GetProcessorTypeRequest = (function() { + + /** + * Properties of a GetProcessorTypeRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGetProcessorTypeRequest + * @property {string|null} [name] GetProcessorTypeRequest name + */ + + /** + * Constructs a new GetProcessorTypeRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a GetProcessorTypeRequest. + * @implements IGetProcessorTypeRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IGetProcessorTypeRequest=} [properties] Properties to set + */ + function GetProcessorTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProcessorTypeRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest + * @instance + */ + GetProcessorTypeRequest.prototype.name = ""; + + /** + * Creates a new GetProcessorTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetProcessorTypeRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.GetProcessorTypeRequest} GetProcessorTypeRequest instance + */ + GetProcessorTypeRequest.create = function create(properties) { + return new GetProcessorTypeRequest(properties); + }; + + /** + * Encodes the specified GetProcessorTypeRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetProcessorTypeRequest} message GetProcessorTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorTypeRequest.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 GetProcessorTypeRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetProcessorTypeRequest} message GetProcessorTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProcessorTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.GetProcessorTypeRequest} GetProcessorTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorTypeRequest.decode = function decode(reader, 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.v1beta3.GetProcessorTypeRequest(); + 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 GetProcessorTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.GetProcessorTypeRequest} GetProcessorTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProcessorTypeRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProcessorTypeRequest.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 GetProcessorTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.GetProcessorTypeRequest} GetProcessorTypeRequest + */ + GetProcessorTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.GetProcessorTypeRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.GetProcessorTypeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProcessorTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest + * @static + * @param {google.cloud.documentai.v1beta3.GetProcessorTypeRequest} message GetProcessorTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProcessorTypeRequest.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 GetProcessorTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetProcessorTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProcessorTypeRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProcessorTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetProcessorTypeRequest"; + }; + + return GetProcessorTypeRequest; + })(); + + v1beta3.GetProcessorRequest = (function() { + + /** + * Properties of a GetProcessorRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGetProcessorRequest + * @property {string|null} [name] GetProcessorRequest name + */ + + /** + * Constructs a new GetProcessorRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a GetProcessorRequest. + * @implements IGetProcessorRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IGetProcessorRequest=} [properties] Properties to set + */ + function GetProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProcessorRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest + * @instance + */ + GetProcessorRequest.prototype.name = ""; + + /** + * Creates a new GetProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.GetProcessorRequest} GetProcessorRequest instance + */ + GetProcessorRequest.create = function create(properties) { + return new GetProcessorRequest(properties); + }; + + /** + * Encodes the specified GetProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetProcessorRequest} message GetProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorRequest.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 GetProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetProcessorRequest} message GetProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.GetProcessorRequest} GetProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorRequest.decode = function decode(reader, 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.v1beta3.GetProcessorRequest(); + 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 GetProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.GetProcessorRequest} GetProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProcessorRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProcessorRequest.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 GetProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.GetProcessorRequest} GetProcessorRequest + */ + GetProcessorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.GetProcessorRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.GetProcessorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.GetProcessorRequest} message GetProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProcessorRequest.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 GetProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + GetProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetProcessorRequest"; + }; + + return GetProcessorRequest; + })(); + + v1beta3.GetProcessorVersionRequest = (function() { + + /** + * Properties of a GetProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGetProcessorVersionRequest + * @property {string|null} [name] GetProcessorVersionRequest name + */ + + /** + * Constructs a new GetProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a GetProcessorVersionRequest. + * @implements IGetProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IGetProcessorVersionRequest=} [properties] Properties to set + */ + function GetProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetProcessorVersionRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest + * @instance + */ + GetProcessorVersionRequest.prototype.name = ""; + + /** + * Creates a new GetProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.GetProcessorVersionRequest} GetProcessorVersionRequest instance + */ + GetProcessorVersionRequest.create = function create(properties) { + return new GetProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified GetProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetProcessorVersionRequest} message GetProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorVersionRequest.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 GetProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetProcessorVersionRequest} message GetProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.GetProcessorVersionRequest} GetProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.GetProcessorVersionRequest(); + 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 GetProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.GetProcessorVersionRequest} GetProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetProcessorVersionRequest.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 GetProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.GetProcessorVersionRequest} GetProcessorVersionRequest + */ + GetProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.GetProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.GetProcessorVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.GetProcessorVersionRequest} message GetProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetProcessorVersionRequest.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 GetProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetProcessorVersionRequest"; + }; + + return GetProcessorVersionRequest; + })(); + + v1beta3.ListProcessorVersionsRequest = (function() { + + /** + * Properties of a ListProcessorVersionsRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IListProcessorVersionsRequest + * @property {string|null} [parent] ListProcessorVersionsRequest parent + * @property {number|null} [pageSize] ListProcessorVersionsRequest pageSize + * @property {string|null} [pageToken] ListProcessorVersionsRequest pageToken + */ + + /** + * Constructs a new ListProcessorVersionsRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ListProcessorVersionsRequest. + * @implements IListProcessorVersionsRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsRequest=} [properties] Properties to set + */ + function ListProcessorVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @instance + */ + ListProcessorVersionsRequest.prototype.parent = ""; + + /** + * ListProcessorVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @instance + */ + ListProcessorVersionsRequest.prototype.pageSize = 0; + + /** + * ListProcessorVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @instance + */ + ListProcessorVersionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListProcessorVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsRequest} ListProcessorVersionsRequest instance + */ + ListProcessorVersionsRequest.create = function create(properties) { + return new ListProcessorVersionsRequest(properties); + }; + + /** + * Encodes the specified ListProcessorVersionsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsRequest} message ListProcessorVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorVersionsRequest.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 ListProcessorVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsRequest} message ListProcessorVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsRequest} ListProcessorVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorVersionsRequest.decode = function decode(reader, 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.v1beta3.ListProcessorVersionsRequest(); + 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 ListProcessorVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsRequest} ListProcessorVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorVersionsRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorVersionsRequest.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 ListProcessorVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsRequest} ListProcessorVersionsRequest + */ + ListProcessorVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest(); + 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 ListProcessorVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @static + * @param {google.cloud.documentai.v1beta3.ListProcessorVersionsRequest} message ListProcessorVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorVersionsRequest.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 ListProcessorVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListProcessorVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListProcessorVersionsRequest"; + }; + + return ListProcessorVersionsRequest; + })(); + + v1beta3.ListProcessorVersionsResponse = (function() { + + /** + * Properties of a ListProcessorVersionsResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IListProcessorVersionsResponse + * @property {Array.|null} [processorVersions] ListProcessorVersionsResponse processorVersions + * @property {string|null} [nextPageToken] ListProcessorVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListProcessorVersionsResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ListProcessorVersionsResponse. + * @implements IListProcessorVersionsResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsResponse=} [properties] Properties to set + */ + function ListProcessorVersionsResponse(properties) { + this.processorVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListProcessorVersionsResponse processorVersions. + * @member {Array.} processorVersions + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + * @instance + */ + ListProcessorVersionsResponse.prototype.processorVersions = $util.emptyArray; + + /** + * ListProcessorVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + * @instance + */ + ListProcessorVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListProcessorVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} ListProcessorVersionsResponse instance + */ + ListProcessorVersionsResponse.create = function create(properties) { + return new ListProcessorVersionsResponse(properties); + }; + + /** + * Encodes the specified ListProcessorVersionsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsResponse} message ListProcessorVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorVersions != null && message.processorVersions.length) + for (var i = 0; i < message.processorVersions.length; ++i) + $root.google.cloud.documentai.v1beta3.ProcessorVersion.encode(message.processorVersions[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 ListProcessorVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsResponse} message ListProcessorVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListProcessorVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} ListProcessorVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorVersionsResponse.decode = function decode(reader, 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.v1beta3.ListProcessorVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.processorVersions && message.processorVersions.length)) + message.processorVersions = []; + message.processorVersions.push($root.google.cloud.documentai.v1beta3.ProcessorVersion.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} ListProcessorVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListProcessorVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListProcessorVersionsResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListProcessorVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorVersions != null && message.hasOwnProperty("processorVersions")) { + if (!Array.isArray(message.processorVersions)) + return "processorVersions: array expected"; + for (var i = 0; i < message.processorVersions.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.ProcessorVersion.verify(message.processorVersions[i]); + if (error) + return "processorVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListProcessorVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} ListProcessorVersionsResponse + */ + ListProcessorVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse(); + if (object.processorVersions) { + if (!Array.isArray(object.processorVersions)) + throw TypeError(".google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.processorVersions: array expected"); + message.processorVersions = []; + for (var i = 0; i < object.processorVersions.length; ++i) { + if (typeof object.processorVersions[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.processorVersions: object expected"); + message.processorVersions[i] = $root.google.cloud.documentai.v1beta3.ProcessorVersion.fromObject(object.processorVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListProcessorVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + * @static + * @param {google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} message ListProcessorVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListProcessorVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.processorVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.processorVersions && message.processorVersions.length) { + object.processorVersions = []; + for (var j = 0; j < message.processorVersions.length; ++j) + object.processorVersions[j] = $root.google.cloud.documentai.v1beta3.ProcessorVersion.toObject(message.processorVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListProcessorVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListProcessorVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListProcessorVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListProcessorVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListProcessorVersionsResponse"; + }; + + return ListProcessorVersionsResponse; + })(); + + v1beta3.DeleteProcessorVersionRequest = (function() { + + /** + * Properties of a DeleteProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDeleteProcessorVersionRequest + * @property {string|null} [name] DeleteProcessorVersionRequest name + */ + + /** + * Constructs a new DeleteProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DeleteProcessorVersionRequest. + * @implements IDeleteProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest=} [properties] Properties to set + */ + function DeleteProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteProcessorVersionRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + * @instance + */ + DeleteProcessorVersionRequest.prototype.name = ""; + + /** + * Creates a new DeleteProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest instance + */ + DeleteProcessorVersionRequest.create = function create(properties) { + return new DeleteProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest} message DeleteProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorVersionRequest.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 DeleteProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest} message DeleteProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.DeleteProcessorVersionRequest(); + 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 DeleteProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProcessorVersionRequest.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 DeleteProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest + */ + DeleteProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest} message DeleteProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProcessorVersionRequest.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 DeleteProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest"; + }; + + return DeleteProcessorVersionRequest; + })(); + + v1beta3.DeleteProcessorVersionMetadata = (function() { + + /** + * Properties of a DeleteProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDeleteProcessorVersionMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] DeleteProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new DeleteProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DeleteProcessorVersionMetadata. + * @implements IDeleteProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata=} [properties] Properties to set + */ + function DeleteProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + * @instance + */ + DeleteProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new DeleteProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata instance + */ + DeleteProcessorVersionMetadata.create = function create(properties) { + return new DeleteProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified DeleteProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata} message DeleteProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata} message DeleteProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.DeleteProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates a DeleteProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata + */ + DeleteProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from a DeleteProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata} message DeleteProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this DeleteProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata"; + }; + + return DeleteProcessorVersionMetadata; + })(); + + v1beta3.DeployProcessorVersionRequest = (function() { + + /** + * Properties of a DeployProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDeployProcessorVersionRequest + * @property {string|null} [name] DeployProcessorVersionRequest name + */ + + /** + * Constructs a new DeployProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DeployProcessorVersionRequest. + * @implements IDeployProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest=} [properties] Properties to set + */ + function DeployProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployProcessorVersionRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + * @instance + */ + DeployProcessorVersionRequest.prototype.name = ""; + + /** + * Creates a new DeployProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionRequest} DeployProcessorVersionRequest instance + */ + DeployProcessorVersionRequest.create = function create(properties) { + return new DeployProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified DeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest} message DeployProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployProcessorVersionRequest.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 DeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest} message DeployProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionRequest} DeployProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.DeployProcessorVersionRequest(); + 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 DeployProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionRequest} DeployProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployProcessorVersionRequest.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 DeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionRequest} DeployProcessorVersionRequest + */ + DeployProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeployProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.DeployProcessorVersionRequest} message DeployProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployProcessorVersionRequest.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 DeployProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeployProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeployProcessorVersionRequest"; + }; + + return DeployProcessorVersionRequest; + })(); + + v1beta3.DeployProcessorVersionResponse = (function() { + + /** + * Properties of a DeployProcessorVersionResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDeployProcessorVersionResponse + */ + + /** + * Constructs a new DeployProcessorVersionResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DeployProcessorVersionResponse. + * @implements IDeployProcessorVersionResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse=} [properties] Properties to set + */ + function DeployProcessorVersionResponse(properties) { + if (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 DeployProcessorVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionResponse} DeployProcessorVersionResponse instance + */ + DeployProcessorVersionResponse.create = function create(properties) { + return new DeployProcessorVersionResponse(properties); + }; + + /** + * Encodes the specified DeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse} message DeployProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployProcessorVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse} message DeployProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployProcessorVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionResponse} DeployProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployProcessorVersionResponse.decode = function decode(reader, 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.v1beta3.DeployProcessorVersionResponse(); + 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 DeployProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionResponse} DeployProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployProcessorVersionResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployProcessorVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionResponse} DeployProcessorVersionResponse + */ + DeployProcessorVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse) + return object; + return new $root.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse(); + }; + + /** + * Creates a plain object from a DeployProcessorVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.DeployProcessorVersionResponse} message DeployProcessorVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployProcessorVersionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeployProcessorVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + * @instance + * @returns {Object.} JSON object + */ + DeployProcessorVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployProcessorVersionResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeployProcessorVersionResponse"; + }; + + return DeployProcessorVersionResponse; + })(); + + v1beta3.DeployProcessorVersionMetadata = (function() { + + /** + * Properties of a DeployProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDeployProcessorVersionMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] DeployProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new DeployProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DeployProcessorVersionMetadata. + * @implements IDeployProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata=} [properties] Properties to set + */ + function DeployProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + * @instance + */ + DeployProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new DeployProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata instance + */ + DeployProcessorVersionMetadata.create = function create(properties) { + return new DeployProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified DeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata} message DeployProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata} message DeployProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.DeployProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates a DeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata + */ + DeployProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from a DeployProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata} message DeployProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this DeployProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata"; + }; + + return DeployProcessorVersionMetadata; + })(); + + v1beta3.UndeployProcessorVersionRequest = (function() { + + /** + * Properties of an UndeployProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IUndeployProcessorVersionRequest + * @property {string|null} [name] UndeployProcessorVersionRequest name + */ + + /** + * Constructs a new UndeployProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an UndeployProcessorVersionRequest. + * @implements IUndeployProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest=} [properties] Properties to set + */ + function UndeployProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeployProcessorVersionRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + * @instance + */ + UndeployProcessorVersionRequest.prototype.name = ""; + + /** + * Creates a new UndeployProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest instance + */ + UndeployProcessorVersionRequest.create = function create(properties) { + return new UndeployProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified UndeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest} message UndeployProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployProcessorVersionRequest.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 UndeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest} message UndeployProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.UndeployProcessorVersionRequest(); + 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 an UndeployProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployProcessorVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an UndeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest + */ + UndeployProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UndeployProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest} message UndeployProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployProcessorVersionRequest.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 UndeployProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + UndeployProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest"; + }; + + return UndeployProcessorVersionRequest; + })(); + + v1beta3.UndeployProcessorVersionResponse = (function() { + + /** + * Properties of an UndeployProcessorVersionResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IUndeployProcessorVersionResponse + */ + + /** + * Constructs a new UndeployProcessorVersionResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an UndeployProcessorVersionResponse. + * @implements IUndeployProcessorVersionResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse=} [properties] Properties to set + */ + function UndeployProcessorVersionResponse(properties) { + if (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 UndeployProcessorVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse instance + */ + UndeployProcessorVersionResponse.create = function create(properties) { + return new UndeployProcessorVersionResponse(properties); + }; + + /** + * Encodes the specified UndeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse} message UndeployProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployProcessorVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UndeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse} message UndeployProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployProcessorVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployProcessorVersionResponse.decode = function decode(reader, 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.v1beta3.UndeployProcessorVersionResponse(); + 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 UndeployProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployProcessorVersionResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployProcessorVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an UndeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse + */ + UndeployProcessorVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse) + return object; + return new $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse(); + }; + + /** + * Creates a plain object from an UndeployProcessorVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse} message UndeployProcessorVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployProcessorVersionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UndeployProcessorVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + * @instance + * @returns {Object.} JSON object + */ + UndeployProcessorVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployProcessorVersionResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse"; + }; + + return UndeployProcessorVersionResponse; + })(); + + v1beta3.UndeployProcessorVersionMetadata = (function() { + + /** + * Properties of an UndeployProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IUndeployProcessorVersionMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] UndeployProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new UndeployProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an UndeployProcessorVersionMetadata. + * @implements IUndeployProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata=} [properties] Properties to set + */ + function UndeployProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeployProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + * @instance + */ + UndeployProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new UndeployProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata instance + */ + UndeployProcessorVersionMetadata.create = function create(properties) { + return new UndeployProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified UndeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata} message UndeployProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UndeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata} message UndeployProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeployProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.UndeployProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeployProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeployProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeployProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates an UndeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata + */ + UndeployProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from an UndeployProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata} message UndeployProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeployProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this UndeployProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + UndeployProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeployProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeployProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata"; + }; + + return UndeployProcessorVersionMetadata; + })(); + + v1beta3.CreateProcessorRequest = (function() { + + /** + * Properties of a CreateProcessorRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface ICreateProcessorRequest + * @property {string|null} [parent] CreateProcessorRequest parent + * @property {google.cloud.documentai.v1beta3.IProcessor|null} [processor] CreateProcessorRequest processor + */ + + /** + * Constructs a new CreateProcessorRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a CreateProcessorRequest. + * @implements ICreateProcessorRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.ICreateProcessorRequest=} [properties] Properties to set + */ + function CreateProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateProcessorRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest + * @instance + */ + CreateProcessorRequest.prototype.parent = ""; + + /** + * CreateProcessorRequest processor. + * @member {google.cloud.documentai.v1beta3.IProcessor|null|undefined} processor + * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest + * @instance + */ + CreateProcessorRequest.prototype.processor = null; + + /** + * Creates a new CreateProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.ICreateProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.CreateProcessorRequest} CreateProcessorRequest instance + */ + CreateProcessorRequest.create = function create(properties) { + return new CreateProcessorRequest(properties); + }; + + /** + * Encodes the specified CreateProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.CreateProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.ICreateProcessorRequest} message CreateProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProcessorRequest.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.processor != null && Object.hasOwnProperty.call(message, "processor")) + $root.google.cloud.documentai.v1beta3.Processor.encode(message.processor, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.CreateProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.ICreateProcessorRequest} message CreateProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.CreateProcessorRequest} CreateProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProcessorRequest.decode = function decode(reader, 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.v1beta3.CreateProcessorRequest(); + 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.processor = $root.google.cloud.documentai.v1beta3.Processor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.CreateProcessorRequest} CreateProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateProcessorRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateProcessorRequest.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.processor != null && message.hasOwnProperty("processor")) { + var error = $root.google.cloud.documentai.v1beta3.Processor.verify(message.processor); + if (error) + return "processor." + error; + } + return null; + }; + + /** + * Creates a CreateProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.CreateProcessorRequest} CreateProcessorRequest + */ + CreateProcessorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.CreateProcessorRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.CreateProcessorRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.processor != null) { + if (typeof object.processor !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.CreateProcessorRequest.processor: object expected"); + message.processor = $root.google.cloud.documentai.v1beta3.Processor.fromObject(object.processor); + } + return message; + }; + + /** + * Creates a plain object from a CreateProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.CreateProcessorRequest} message CreateProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateProcessorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.processor = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.processor != null && message.hasOwnProperty("processor")) + object.processor = $root.google.cloud.documentai.v1beta3.Processor.toObject(message.processor, options); + return object; + }; + + /** + * Converts this CreateProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + CreateProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.CreateProcessorRequest"; + }; + + return CreateProcessorRequest; + })(); + + v1beta3.DeleteProcessorRequest = (function() { + + /** + * Properties of a DeleteProcessorRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDeleteProcessorRequest + * @property {string|null} [name] DeleteProcessorRequest name + */ + + /** + * Constructs a new DeleteProcessorRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DeleteProcessorRequest. + * @implements IDeleteProcessorRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorRequest=} [properties] Properties to set + */ + function DeleteProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteProcessorRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest + * @instance + */ + DeleteProcessorRequest.prototype.name = ""; + + /** + * Creates a new DeleteProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorRequest} DeleteProcessorRequest instance + */ + DeleteProcessorRequest.create = function create(properties) { + return new DeleteProcessorRequest(properties); + }; + + /** + * Encodes the specified DeleteProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorRequest} message DeleteProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorRequest.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 DeleteProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorRequest} message DeleteProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorRequest} DeleteProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorRequest.decode = function decode(reader, 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.v1beta3.DeleteProcessorRequest(); + 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 DeleteProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorRequest} DeleteProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProcessorRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProcessorRequest.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 DeleteProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorRequest} DeleteProcessorRequest + */ + DeleteProcessorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DeleteProcessorRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DeleteProcessorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.DeleteProcessorRequest} message DeleteProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProcessorRequest.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 DeleteProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeleteProcessorRequest"; + }; + + return DeleteProcessorRequest; + })(); + + v1beta3.DeleteProcessorMetadata = (function() { + + /** + * Properties of a DeleteProcessorMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDeleteProcessorMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] DeleteProcessorMetadata commonMetadata + */ + + /** + * Constructs a new DeleteProcessorMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DeleteProcessorMetadata. + * @implements IDeleteProcessorMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorMetadata=} [properties] Properties to set + */ + function DeleteProcessorMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteProcessorMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata + * @instance + */ + DeleteProcessorMetadata.prototype.commonMetadata = null; + + /** + * Creates a new DeleteProcessorMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorMetadata} DeleteProcessorMetadata instance + */ + DeleteProcessorMetadata.create = function create(properties) { + return new DeleteProcessorMetadata(properties); + }; + + /** + * Encodes the specified DeleteProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorMetadata} message DeleteProcessorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDeleteProcessorMetadata} message DeleteProcessorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteProcessorMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteProcessorMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorMetadata} DeleteProcessorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorMetadata.decode = function decode(reader, 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.v1beta3.DeleteProcessorMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteProcessorMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorMetadata} DeleteProcessorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteProcessorMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteProcessorMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteProcessorMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates a DeleteProcessorMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DeleteProcessorMetadata} DeleteProcessorMetadata + */ + DeleteProcessorMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DeleteProcessorMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DeleteProcessorMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DeleteProcessorMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from a DeleteProcessorMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata + * @static + * @param {google.cloud.documentai.v1beta3.DeleteProcessorMetadata} message DeleteProcessorMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteProcessorMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this DeleteProcessorMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteProcessorMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteProcessorMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteProcessorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeleteProcessorMetadata"; + }; + + return DeleteProcessorMetadata; + })(); + + v1beta3.EnableProcessorRequest = (function() { + + /** + * Properties of an EnableProcessorRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IEnableProcessorRequest + * @property {string|null} [name] EnableProcessorRequest name + */ + + /** + * Constructs a new EnableProcessorRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an EnableProcessorRequest. + * @implements IEnableProcessorRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IEnableProcessorRequest=} [properties] Properties to set + */ + function EnableProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnableProcessorRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest + * @instance + */ + EnableProcessorRequest.prototype.name = ""; + + /** + * Creates a new EnableProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.IEnableProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.EnableProcessorRequest} EnableProcessorRequest instance + */ + EnableProcessorRequest.create = function create(properties) { + return new EnableProcessorRequest(properties); + }; + + /** + * Encodes the specified EnableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.IEnableProcessorRequest} message EnableProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProcessorRequest.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 EnableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.IEnableProcessorRequest} message EnableProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.EnableProcessorRequest} EnableProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProcessorRequest.decode = function decode(reader, 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.v1beta3.EnableProcessorRequest(); + 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 an EnableProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.EnableProcessorRequest} EnableProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableProcessorRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableProcessorRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an EnableProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.EnableProcessorRequest} EnableProcessorRequest + */ + EnableProcessorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.EnableProcessorRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.EnableProcessorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an EnableProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.EnableProcessorRequest} message EnableProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableProcessorRequest.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 EnableProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + EnableProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnableProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnableProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EnableProcessorRequest"; + }; + + return EnableProcessorRequest; + })(); + + v1beta3.EnableProcessorResponse = (function() { + + /** + * Properties of an EnableProcessorResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IEnableProcessorResponse + */ + + /** + * Constructs a new EnableProcessorResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an EnableProcessorResponse. + * @implements IEnableProcessorResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IEnableProcessorResponse=} [properties] Properties to set + */ + function EnableProcessorResponse(properties) { + if (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 EnableProcessorResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse + * @static + * @param {google.cloud.documentai.v1beta3.IEnableProcessorResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.EnableProcessorResponse} EnableProcessorResponse instance + */ + EnableProcessorResponse.create = function create(properties) { + return new EnableProcessorResponse(properties); + }; + + /** + * Encodes the specified EnableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse + * @static + * @param {google.cloud.documentai.v1beta3.IEnableProcessorResponse} message EnableProcessorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProcessorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified EnableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse + * @static + * @param {google.cloud.documentai.v1beta3.IEnableProcessorResponse} message EnableProcessorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProcessorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableProcessorResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.EnableProcessorResponse} EnableProcessorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProcessorResponse.decode = function decode(reader, 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.v1beta3.EnableProcessorResponse(); + 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 EnableProcessorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.EnableProcessorResponse} EnableProcessorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProcessorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableProcessorResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableProcessorResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an EnableProcessorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.EnableProcessorResponse} EnableProcessorResponse + */ + EnableProcessorResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.EnableProcessorResponse) + return object; + return new $root.google.cloud.documentai.v1beta3.EnableProcessorResponse(); + }; + + /** + * Creates a plain object from an EnableProcessorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse + * @static + * @param {google.cloud.documentai.v1beta3.EnableProcessorResponse} message EnableProcessorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableProcessorResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this EnableProcessorResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse + * @instance + * @returns {Object.} JSON object + */ + EnableProcessorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnableProcessorResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnableProcessorResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EnableProcessorResponse"; + }; + + return EnableProcessorResponse; + })(); + + v1beta3.EnableProcessorMetadata = (function() { + + /** + * Properties of an EnableProcessorMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IEnableProcessorMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] EnableProcessorMetadata commonMetadata + */ + + /** + * Constructs a new EnableProcessorMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an EnableProcessorMetadata. + * @implements IEnableProcessorMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IEnableProcessorMetadata=} [properties] Properties to set + */ + function EnableProcessorMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnableProcessorMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata + * @instance + */ + EnableProcessorMetadata.prototype.commonMetadata = null; + + /** + * Creates a new EnableProcessorMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IEnableProcessorMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.EnableProcessorMetadata} EnableProcessorMetadata instance + */ + EnableProcessorMetadata.create = function create(properties) { + return new EnableProcessorMetadata(properties); + }; + + /** + * Encodes the specified EnableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IEnableProcessorMetadata} message EnableProcessorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProcessorMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IEnableProcessorMetadata} message EnableProcessorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableProcessorMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableProcessorMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.EnableProcessorMetadata} EnableProcessorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProcessorMetadata.decode = function decode(reader, 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.v1beta3.EnableProcessorMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnableProcessorMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.EnableProcessorMetadata} EnableProcessorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableProcessorMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableProcessorMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableProcessorMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates an EnableProcessorMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.EnableProcessorMetadata} EnableProcessorMetadata + */ + EnableProcessorMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.EnableProcessorMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.EnableProcessorMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.EnableProcessorMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from an EnableProcessorMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1beta3.EnableProcessorMetadata} message EnableProcessorMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableProcessorMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this EnableProcessorMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata + * @instance + * @returns {Object.} JSON object + */ + EnableProcessorMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnableProcessorMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnableProcessorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EnableProcessorMetadata"; + }; + + return EnableProcessorMetadata; + })(); + + v1beta3.DisableProcessorRequest = (function() { + + /** + * Properties of a DisableProcessorRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDisableProcessorRequest + * @property {string|null} [name] DisableProcessorRequest name + */ + + /** + * Constructs a new DisableProcessorRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DisableProcessorRequest. + * @implements IDisableProcessorRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IDisableProcessorRequest=} [properties] Properties to set + */ + function DisableProcessorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisableProcessorRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest + * @instance + */ + DisableProcessorRequest.prototype.name = ""; + + /** + * Creates a new DisableProcessorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.IDisableProcessorRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DisableProcessorRequest} DisableProcessorRequest instance + */ + DisableProcessorRequest.create = function create(properties) { + return new DisableProcessorRequest(properties); + }; + + /** + * Encodes the specified DisableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.IDisableProcessorRequest} message DisableProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProcessorRequest.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 DisableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.IDisableProcessorRequest} message DisableProcessorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableProcessorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DisableProcessorRequest} DisableProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProcessorRequest.decode = function decode(reader, 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.v1beta3.DisableProcessorRequest(); + 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 DisableProcessorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DisableProcessorRequest} DisableProcessorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProcessorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableProcessorRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableProcessorRequest.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 DisableProcessorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DisableProcessorRequest} DisableProcessorRequest + */ + DisableProcessorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DisableProcessorRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DisableProcessorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DisableProcessorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest + * @static + * @param {google.cloud.documentai.v1beta3.DisableProcessorRequest} message DisableProcessorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableProcessorRequest.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 DisableProcessorRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest + * @instance + * @returns {Object.} JSON object + */ + DisableProcessorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisableProcessorRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisableProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DisableProcessorRequest"; + }; + + return DisableProcessorRequest; + })(); + + v1beta3.DisableProcessorResponse = (function() { + + /** + * Properties of a DisableProcessorResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDisableProcessorResponse + */ + + /** + * Constructs a new DisableProcessorResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DisableProcessorResponse. + * @implements IDisableProcessorResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IDisableProcessorResponse=} [properties] Properties to set + */ + function DisableProcessorResponse(properties) { + if (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 DisableProcessorResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse + * @static + * @param {google.cloud.documentai.v1beta3.IDisableProcessorResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DisableProcessorResponse} DisableProcessorResponse instance + */ + DisableProcessorResponse.create = function create(properties) { + return new DisableProcessorResponse(properties); + }; + + /** + * Encodes the specified DisableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse + * @static + * @param {google.cloud.documentai.v1beta3.IDisableProcessorResponse} message DisableProcessorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProcessorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DisableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse + * @static + * @param {google.cloud.documentai.v1beta3.IDisableProcessorResponse} message DisableProcessorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProcessorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableProcessorResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DisableProcessorResponse} DisableProcessorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProcessorResponse.decode = function decode(reader, 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.v1beta3.DisableProcessorResponse(); + 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 DisableProcessorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DisableProcessorResponse} DisableProcessorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProcessorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableProcessorResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableProcessorResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DisableProcessorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DisableProcessorResponse} DisableProcessorResponse + */ + DisableProcessorResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DisableProcessorResponse) + return object; + return new $root.google.cloud.documentai.v1beta3.DisableProcessorResponse(); + }; + + /** + * Creates a plain object from a DisableProcessorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse + * @static + * @param {google.cloud.documentai.v1beta3.DisableProcessorResponse} message DisableProcessorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableProcessorResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DisableProcessorResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse + * @instance + * @returns {Object.} JSON object + */ + DisableProcessorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisableProcessorResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisableProcessorResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DisableProcessorResponse"; + }; + + return DisableProcessorResponse; + })(); + + v1beta3.DisableProcessorMetadata = (function() { + + /** + * Properties of a DisableProcessorMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDisableProcessorMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] DisableProcessorMetadata commonMetadata + */ + + /** + * Constructs a new DisableProcessorMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DisableProcessorMetadata. + * @implements IDisableProcessorMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IDisableProcessorMetadata=} [properties] Properties to set + */ + function DisableProcessorMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisableProcessorMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata + * @instance + */ + DisableProcessorMetadata.prototype.commonMetadata = null; + + /** + * Creates a new DisableProcessorMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDisableProcessorMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DisableProcessorMetadata} DisableProcessorMetadata instance + */ + DisableProcessorMetadata.create = function create(properties) { + return new DisableProcessorMetadata(properties); + }; + + /** + * Encodes the specified DisableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDisableProcessorMetadata} message DisableProcessorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProcessorMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DisableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDisableProcessorMetadata} message DisableProcessorMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableProcessorMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableProcessorMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DisableProcessorMetadata} DisableProcessorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProcessorMetadata.decode = function decode(reader, 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.v1beta3.DisableProcessorMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisableProcessorMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DisableProcessorMetadata} DisableProcessorMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableProcessorMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableProcessorMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableProcessorMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates a DisableProcessorMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DisableProcessorMetadata} DisableProcessorMetadata + */ + DisableProcessorMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DisableProcessorMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DisableProcessorMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DisableProcessorMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from a DisableProcessorMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata + * @static + * @param {google.cloud.documentai.v1beta3.DisableProcessorMetadata} message DisableProcessorMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableProcessorMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this DisableProcessorMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata + * @instance + * @returns {Object.} JSON object + */ + DisableProcessorMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisableProcessorMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisableProcessorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DisableProcessorMetadata"; + }; + + return DisableProcessorMetadata; + })(); + + v1beta3.SetDefaultProcessorVersionRequest = (function() { + + /** + * Properties of a SetDefaultProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface ISetDefaultProcessorVersionRequest + * @property {string|null} [processor] SetDefaultProcessorVersionRequest processor + * @property {string|null} [defaultProcessorVersion] SetDefaultProcessorVersionRequest defaultProcessorVersion + */ + + /** + * Constructs a new SetDefaultProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a SetDefaultProcessorVersionRequest. + * @implements ISetDefaultProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest=} [properties] Properties to set + */ + function SetDefaultProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetDefaultProcessorVersionRequest processor. + * @member {string} processor + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + * @instance + */ + SetDefaultProcessorVersionRequest.prototype.processor = ""; + + /** + * SetDefaultProcessorVersionRequest defaultProcessorVersion. + * @member {string} defaultProcessorVersion + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + * @instance + */ + SetDefaultProcessorVersionRequest.prototype.defaultProcessorVersion = ""; + + /** + * Creates a new SetDefaultProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest instance + */ + SetDefaultProcessorVersionRequest.create = function create(properties) { + return new SetDefaultProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified SetDefaultProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest} message SetDefaultProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultProcessorVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processor != null && Object.hasOwnProperty.call(message, "processor")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.processor); + if (message.defaultProcessorVersion != null && Object.hasOwnProperty.call(message, "defaultProcessorVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.defaultProcessorVersion); + return writer; + }; + + /** + * Encodes the specified SetDefaultProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest} message SetDefaultProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.SetDefaultProcessorVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.processor = reader.string(); + break; + } + case 2: { + message.defaultProcessorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetDefaultProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetDefaultProcessorVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processor != null && message.hasOwnProperty("processor")) + if (!$util.isString(message.processor)) + return "processor: string expected"; + if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) + if (!$util.isString(message.defaultProcessorVersion)) + return "defaultProcessorVersion: string expected"; + return null; + }; + + /** + * Creates a SetDefaultProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest + */ + SetDefaultProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest(); + if (object.processor != null) + message.processor = String(object.processor); + if (object.defaultProcessorVersion != null) + message.defaultProcessorVersion = String(object.defaultProcessorVersion); + return message; + }; + + /** + * Creates a plain object from a SetDefaultProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest} message SetDefaultProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetDefaultProcessorVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.processor = ""; + object.defaultProcessorVersion = ""; + } + if (message.processor != null && message.hasOwnProperty("processor")) + object.processor = message.processor; + if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) + object.defaultProcessorVersion = message.defaultProcessorVersion; + return object; + }; + + /** + * Converts this SetDefaultProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + SetDefaultProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetDefaultProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetDefaultProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest"; + }; + + return SetDefaultProcessorVersionRequest; + })(); + + v1beta3.SetDefaultProcessorVersionResponse = (function() { + + /** + * Properties of a SetDefaultProcessorVersionResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface ISetDefaultProcessorVersionResponse + */ + + /** + * Constructs a new SetDefaultProcessorVersionResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a SetDefaultProcessorVersionResponse. + * @implements ISetDefaultProcessorVersionResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse=} [properties] Properties to set + */ + function SetDefaultProcessorVersionResponse(properties) { + if (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 SetDefaultProcessorVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse instance + */ + SetDefaultProcessorVersionResponse.create = function create(properties) { + return new SetDefaultProcessorVersionResponse(properties); + }; + + /** + * Encodes the specified SetDefaultProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse} message SetDefaultProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultProcessorVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SetDefaultProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse} message SetDefaultProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetDefaultProcessorVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultProcessorVersionResponse.decode = function decode(reader, 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.v1beta3.SetDefaultProcessorVersionResponse(); + 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 SetDefaultProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetDefaultProcessorVersionResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetDefaultProcessorVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a SetDefaultProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse + */ + SetDefaultProcessorVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse) + return object; + return new $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse(); + }; + + /** + * Creates a plain object from a SetDefaultProcessorVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse} message SetDefaultProcessorVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetDefaultProcessorVersionResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SetDefaultProcessorVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + * @instance + * @returns {Object.} JSON object + */ + SetDefaultProcessorVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetDefaultProcessorVersionResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetDefaultProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse"; + }; + + return SetDefaultProcessorVersionResponse; + })(); + + v1beta3.SetDefaultProcessorVersionMetadata = (function() { + + /** + * Properties of a SetDefaultProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface ISetDefaultProcessorVersionMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] SetDefaultProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new SetDefaultProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a SetDefaultProcessorVersionMetadata. + * @implements ISetDefaultProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata=} [properties] Properties to set + */ + function SetDefaultProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetDefaultProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + * @instance + */ + SetDefaultProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new SetDefaultProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata instance + */ + SetDefaultProcessorVersionMetadata.create = function create(properties) { + return new SetDefaultProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified SetDefaultProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata} message SetDefaultProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetDefaultProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata} message SetDefaultProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.SetDefaultProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetDefaultProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetDefaultProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates a SetDefaultProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata + */ + SetDefaultProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from a SetDefaultProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata} message SetDefaultProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetDefaultProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this SetDefaultProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + SetDefaultProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetDefaultProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetDefaultProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata"; + }; + + return SetDefaultProcessorVersionMetadata; + })(); + + v1beta3.TrainProcessorVersionRequest = (function() { + + /** + * Properties of a TrainProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface ITrainProcessorVersionRequest + * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null} [customDocumentExtractionOptions] TrainProcessorVersionRequest customDocumentExtractionOptions + * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null} [foundationModelTuningOptions] TrainProcessorVersionRequest foundationModelTuningOptions + * @property {string|null} [parent] TrainProcessorVersionRequest parent + * @property {google.cloud.documentai.v1beta3.IProcessorVersion|null} [processorVersion] TrainProcessorVersionRequest processorVersion + * @property {google.cloud.documentai.v1beta3.IDocumentSchema|null} [documentSchema] TrainProcessorVersionRequest documentSchema + * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData|null} [inputData] TrainProcessorVersionRequest inputData + * @property {string|null} [baseProcessorVersion] TrainProcessorVersionRequest baseProcessorVersion + */ + + /** + * Constructs a new TrainProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a TrainProcessorVersionRequest. + * @implements ITrainProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest=} [properties] Properties to set + */ + function TrainProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainProcessorVersionRequest customDocumentExtractionOptions. + * @member {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null|undefined} customDocumentExtractionOptions + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.customDocumentExtractionOptions = null; + + /** + * TrainProcessorVersionRequest foundationModelTuningOptions. + * @member {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null|undefined} foundationModelTuningOptions + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.foundationModelTuningOptions = null; + + /** + * TrainProcessorVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.parent = ""; + + /** + * TrainProcessorVersionRequest processorVersion. + * @member {google.cloud.documentai.v1beta3.IProcessorVersion|null|undefined} processorVersion + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.processorVersion = null; + + /** + * TrainProcessorVersionRequest documentSchema. + * @member {google.cloud.documentai.v1beta3.IDocumentSchema|null|undefined} documentSchema + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.documentSchema = null; + + /** + * TrainProcessorVersionRequest inputData. + * @member {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData|null|undefined} inputData + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.inputData = null; + + /** + * TrainProcessorVersionRequest baseProcessorVersion. + * @member {string} baseProcessorVersion + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @instance + */ + TrainProcessorVersionRequest.prototype.baseProcessorVersion = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TrainProcessorVersionRequest processorFlags. + * @member {"customDocumentExtractionOptions"|"foundationModelTuningOptions"|undefined} processorFlags + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @instance + */ + Object.defineProperty(TrainProcessorVersionRequest.prototype, "processorFlags", { + get: $util.oneOfGetter($oneOfFields = ["customDocumentExtractionOptions", "foundationModelTuningOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TrainProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest} TrainProcessorVersionRequest instance + */ + TrainProcessorVersionRequest.create = function create(properties) { + return new TrainProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified TrainProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest} message TrainProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainProcessorVersionRequest.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.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) + $root.google.cloud.documentai.v1beta3.ProcessorVersion.encode(message.processorVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inputData != null && Object.hasOwnProperty.call(message, "inputData")) + $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.encode(message.inputData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.customDocumentExtractionOptions != null && Object.hasOwnProperty.call(message, "customDocumentExtractionOptions")) + $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.encode(message.customDocumentExtractionOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.baseProcessorVersion != null && Object.hasOwnProperty.call(message, "baseProcessorVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.baseProcessorVersion); + if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) + $root.google.cloud.documentai.v1beta3.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.foundationModelTuningOptions != null && Object.hasOwnProperty.call(message, "foundationModelTuningOptions")) + $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.encode(message.foundationModelTuningOptions, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrainProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest} message TrainProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest} TrainProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.customDocumentExtractionOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.decode(reader, reader.uint32()); + break; + } + case 12: { + message.foundationModelTuningOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.processorVersion = $root.google.cloud.documentai.v1beta3.ProcessorVersion.decode(reader, reader.uint32()); + break; + } + case 10: { + message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.inputData = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.decode(reader, reader.uint32()); + break; + } + case 8: { + message.baseProcessorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest} TrainProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainProcessorVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.customDocumentExtractionOptions != null && message.hasOwnProperty("customDocumentExtractionOptions")) { + properties.processorFlags = 1; + { + var error = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify(message.customDocumentExtractionOptions); + if (error) + return "customDocumentExtractionOptions." + error; + } + } + if (message.foundationModelTuningOptions != null && message.hasOwnProperty("foundationModelTuningOptions")) { + if (properties.processorFlags === 1) + return "processorFlags: multiple values"; + properties.processorFlags = 1; + { + var error = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify(message.foundationModelTuningOptions); + if (error) + return "foundationModelTuningOptions." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) { + var error = $root.google.cloud.documentai.v1beta3.ProcessorVersion.verify(message.processorVersion); + if (error) + return "processorVersion." + error; + } + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) { + var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.verify(message.documentSchema); + if (error) + return "documentSchema." + error; + } + if (message.inputData != null && message.hasOwnProperty("inputData")) { + var error = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.verify(message.inputData); + if (error) + return "inputData." + error; + } + if (message.baseProcessorVersion != null && message.hasOwnProperty("baseProcessorVersion")) + if (!$util.isString(message.baseProcessorVersion)) + return "baseProcessorVersion: string expected"; + return null; + }; + + /** + * Creates a TrainProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest} TrainProcessorVersionRequest + */ + TrainProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest(); + if (object.customDocumentExtractionOptions != null) { + if (typeof object.customDocumentExtractionOptions !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.customDocumentExtractionOptions: object expected"); + message.customDocumentExtractionOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.fromObject(object.customDocumentExtractionOptions); + } + if (object.foundationModelTuningOptions != null) { + if (typeof object.foundationModelTuningOptions !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.foundationModelTuningOptions: object expected"); + message.foundationModelTuningOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.fromObject(object.foundationModelTuningOptions); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.processorVersion != null) { + if (typeof object.processorVersion !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.processorVersion: object expected"); + message.processorVersion = $root.google.cloud.documentai.v1beta3.ProcessorVersion.fromObject(object.processorVersion); + } + if (object.documentSchema != null) { + if (typeof object.documentSchema !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.documentSchema: object expected"); + message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.fromObject(object.documentSchema); + } + if (object.inputData != null) { + if (typeof object.inputData !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.inputData: object expected"); + message.inputData = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.fromObject(object.inputData); + } + if (object.baseProcessorVersion != null) + message.baseProcessorVersion = String(object.baseProcessorVersion); + return message; + }; + + /** + * Creates a plain object from a TrainProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest} message TrainProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainProcessorVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.processorVersion = null; + object.inputData = null; + object.baseProcessorVersion = ""; + object.documentSchema = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + object.processorVersion = $root.google.cloud.documentai.v1beta3.ProcessorVersion.toObject(message.processorVersion, options); + if (message.inputData != null && message.hasOwnProperty("inputData")) + object.inputData = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.toObject(message.inputData, options); + if (message.customDocumentExtractionOptions != null && message.hasOwnProperty("customDocumentExtractionOptions")) { + object.customDocumentExtractionOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.toObject(message.customDocumentExtractionOptions, options); + if (options.oneofs) + object.processorFlags = "customDocumentExtractionOptions"; + } + if (message.baseProcessorVersion != null && message.hasOwnProperty("baseProcessorVersion")) + object.baseProcessorVersion = message.baseProcessorVersion; + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) + object.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.toObject(message.documentSchema, options); + if (message.foundationModelTuningOptions != null && message.hasOwnProperty("foundationModelTuningOptions")) { + object.foundationModelTuningOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.toObject(message.foundationModelTuningOptions, options); + if (options.oneofs) + object.processorFlags = "foundationModelTuningOptions"; + } + return object; + }; + + /** + * Converts this TrainProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + TrainProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrainProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrainProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionRequest"; + }; + + TrainProcessorVersionRequest.InputData = (function() { + + /** + * Properties of an InputData. + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @interface IInputData + * @property {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null} [trainingDocuments] InputData trainingDocuments + * @property {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null} [testDocuments] InputData testDocuments + */ + + /** + * Constructs a new InputData. + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @classdesc Represents an InputData. + * @implements IInputData + * @constructor + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData=} [properties] Properties to set + */ + function InputData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputData trainingDocuments. + * @member {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null|undefined} trainingDocuments + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData + * @instance + */ + InputData.prototype.trainingDocuments = null; + + /** + * InputData testDocuments. + * @member {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null|undefined} testDocuments + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData + * @instance + */ + InputData.prototype.testDocuments = null; + + /** + * Creates a new InputData instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} InputData instance + */ + InputData.create = function create(properties) { + return new InputData(properties); + }; + + /** + * Encodes the specified InputData message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData} message InputData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trainingDocuments != null && Object.hasOwnProperty.call(message, "trainingDocuments")) + $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.encode(message.trainingDocuments, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.testDocuments != null && Object.hasOwnProperty.call(message, "testDocuments")) + $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.encode(message.testDocuments, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputData message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData} message InputData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} InputData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputData.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionRequest.InputData(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.trainingDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.testDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} InputData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputData message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trainingDocuments != null && message.hasOwnProperty("trainingDocuments")) { + var error = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify(message.trainingDocuments); + if (error) + return "trainingDocuments." + error; + } + if (message.testDocuments != null && message.hasOwnProperty("testDocuments")) { + var error = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify(message.testDocuments); + if (error) + return "testDocuments." + error; + } + return null; + }; + + /** + * Creates an InputData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} InputData + */ + InputData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData) + return object; + var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData(); + if (object.trainingDocuments != null) { + if (typeof object.trainingDocuments !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.trainingDocuments: object expected"); + message.trainingDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.fromObject(object.trainingDocuments); + } + if (object.testDocuments != null) { + if (typeof object.testDocuments !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.testDocuments: object expected"); + message.testDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.fromObject(object.testDocuments); + } + return message; + }; + + /** + * Creates a plain object from an InputData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} message InputData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.trainingDocuments = null; + object.testDocuments = null; + } + if (message.trainingDocuments != null && message.hasOwnProperty("trainingDocuments")) + object.trainingDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.toObject(message.trainingDocuments, options); + if (message.testDocuments != null && message.hasOwnProperty("testDocuments")) + object.testDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.toObject(message.testDocuments, options); + return object; + }; + + /** + * Converts this InputData to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData + * @instance + * @returns {Object.} JSON object + */ + InputData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputData + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData"; + }; + + return InputData; + })(); + + TrainProcessorVersionRequest.CustomDocumentExtractionOptions = (function() { + + /** + * Properties of a CustomDocumentExtractionOptions. + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @interface ICustomDocumentExtractionOptions + * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|null} [trainingMethod] CustomDocumentExtractionOptions trainingMethod + */ + + /** + * Constructs a new CustomDocumentExtractionOptions. + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @classdesc Represents a CustomDocumentExtractionOptions. + * @implements ICustomDocumentExtractionOptions + * @constructor + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions=} [properties] Properties to set + */ + function CustomDocumentExtractionOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomDocumentExtractionOptions trainingMethod. + * @member {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod} trainingMethod + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @instance + */ + CustomDocumentExtractionOptions.prototype.trainingMethod = 0; + + /** + * Creates a new CustomDocumentExtractionOptions instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions instance + */ + CustomDocumentExtractionOptions.create = function create(properties) { + return new CustomDocumentExtractionOptions(properties); + }; + + /** + * Encodes the specified CustomDocumentExtractionOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions} message CustomDocumentExtractionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomDocumentExtractionOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trainingMethod != null && Object.hasOwnProperty.call(message, "trainingMethod")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.trainingMethod); + return writer; + }; + + /** + * Encodes the specified CustomDocumentExtractionOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions} message CustomDocumentExtractionOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomDocumentExtractionOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomDocumentExtractionOptions.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.trainingMethod = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomDocumentExtractionOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomDocumentExtractionOptions message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomDocumentExtractionOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trainingMethod != null && message.hasOwnProperty("trainingMethod")) + switch (message.trainingMethod) { + default: + return "trainingMethod: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a CustomDocumentExtractionOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions + */ + CustomDocumentExtractionOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions) + return object; + var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions(); + switch (object.trainingMethod) { + default: + if (typeof object.trainingMethod === "number") { + message.trainingMethod = object.trainingMethod; + break; + } + break; + case "TRAINING_METHOD_UNSPECIFIED": + case 0: + message.trainingMethod = 0; + break; + case "MODEL_BASED": + case 1: + message.trainingMethod = 1; + break; + case "TEMPLATE_BASED": + case 2: + message.trainingMethod = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CustomDocumentExtractionOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} message CustomDocumentExtractionOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomDocumentExtractionOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.trainingMethod = options.enums === String ? "TRAINING_METHOD_UNSPECIFIED" : 0; + if (message.trainingMethod != null && message.hasOwnProperty("trainingMethod")) + object.trainingMethod = options.enums === String ? $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod[message.trainingMethod] === undefined ? message.trainingMethod : $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod[message.trainingMethod] : message.trainingMethod; + return object; + }; + + /** + * Converts this CustomDocumentExtractionOptions to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @instance + * @returns {Object.} JSON object + */ + CustomDocumentExtractionOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomDocumentExtractionOptions + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomDocumentExtractionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions"; + }; + + /** + * TrainingMethod enum. + * @name google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod + * @enum {number} + * @property {number} TRAINING_METHOD_UNSPECIFIED=0 TRAINING_METHOD_UNSPECIFIED value + * @property {number} MODEL_BASED=1 MODEL_BASED value + * @property {number} TEMPLATE_BASED=2 TEMPLATE_BASED value + */ + CustomDocumentExtractionOptions.TrainingMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRAINING_METHOD_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODEL_BASED"] = 1; + values[valuesById[2] = "TEMPLATE_BASED"] = 2; + return values; + })(); + + return CustomDocumentExtractionOptions; + })(); + + TrainProcessorVersionRequest.FoundationModelTuningOptions = (function() { + + /** + * Properties of a FoundationModelTuningOptions. + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @interface IFoundationModelTuningOptions + * @property {number|null} [trainSteps] FoundationModelTuningOptions trainSteps + * @property {number|null} [learningRateMultiplier] FoundationModelTuningOptions learningRateMultiplier + */ + + /** + * Constructs a new FoundationModelTuningOptions. + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest + * @classdesc Represents a FoundationModelTuningOptions. + * @implements IFoundationModelTuningOptions + * @constructor + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions=} [properties] Properties to set + */ + function FoundationModelTuningOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FoundationModelTuningOptions trainSteps. + * @member {number} trainSteps + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @instance + */ + FoundationModelTuningOptions.prototype.trainSteps = 0; + + /** + * FoundationModelTuningOptions learningRateMultiplier. + * @member {number} learningRateMultiplier + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @instance + */ + FoundationModelTuningOptions.prototype.learningRateMultiplier = 0; + + /** + * Creates a new FoundationModelTuningOptions instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions instance + */ + FoundationModelTuningOptions.create = function create(properties) { + return new FoundationModelTuningOptions(properties); + }; + + /** + * Encodes the specified FoundationModelTuningOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions} message FoundationModelTuningOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FoundationModelTuningOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trainSteps != null && Object.hasOwnProperty.call(message, "trainSteps")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.trainSteps); + if (message.learningRateMultiplier != null && Object.hasOwnProperty.call(message, "learningRateMultiplier")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.learningRateMultiplier); + return writer; + }; + + /** + * Encodes the specified FoundationModelTuningOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions} message FoundationModelTuningOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FoundationModelTuningOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FoundationModelTuningOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FoundationModelTuningOptions.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.trainSteps = reader.int32(); + break; + } + case 3: { + message.learningRateMultiplier = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FoundationModelTuningOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FoundationModelTuningOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FoundationModelTuningOptions message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FoundationModelTuningOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trainSteps != null && message.hasOwnProperty("trainSteps")) + if (!$util.isInteger(message.trainSteps)) + return "trainSteps: integer expected"; + if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) + if (typeof message.learningRateMultiplier !== "number") + return "learningRateMultiplier: number expected"; + return null; + }; + + /** + * Creates a FoundationModelTuningOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions + */ + FoundationModelTuningOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions) + return object; + var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions(); + if (object.trainSteps != null) + message.trainSteps = object.trainSteps | 0; + if (object.learningRateMultiplier != null) + message.learningRateMultiplier = Number(object.learningRateMultiplier); + return message; + }; + + /** + * Creates a plain object from a FoundationModelTuningOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions} message FoundationModelTuningOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FoundationModelTuningOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.trainSteps = 0; + object.learningRateMultiplier = 0; + } + if (message.trainSteps != null && message.hasOwnProperty("trainSteps")) + object.trainSteps = message.trainSteps; + if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) + object.learningRateMultiplier = options.json && !isFinite(message.learningRateMultiplier) ? String(message.learningRateMultiplier) : message.learningRateMultiplier; + return object; + }; + + /** + * Converts this FoundationModelTuningOptions to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @instance + * @returns {Object.} JSON object + */ + FoundationModelTuningOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FoundationModelTuningOptions + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FoundationModelTuningOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions"; + }; + + return FoundationModelTuningOptions; + })(); + + return TrainProcessorVersionRequest; + })(); + + v1beta3.TrainProcessorVersionResponse = (function() { + + /** + * Properties of a TrainProcessorVersionResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface ITrainProcessorVersionResponse + * @property {string|null} [processorVersion] TrainProcessorVersionResponse processorVersion + */ + + /** + * Constructs a new TrainProcessorVersionResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a TrainProcessorVersionResponse. + * @implements ITrainProcessorVersionResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse=} [properties] Properties to set + */ + function TrainProcessorVersionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainProcessorVersionResponse processorVersion. + * @member {string} processorVersion + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse + * @instance + */ + TrainProcessorVersionResponse.prototype.processorVersion = ""; + + /** + * Creates a new TrainProcessorVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionResponse} TrainProcessorVersionResponse instance + */ + TrainProcessorVersionResponse.create = function create(properties) { + return new TrainProcessorVersionResponse(properties); + }; + + /** + * Encodes the specified TrainProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse} message TrainProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainProcessorVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorVersion); + return writer; + }; + + /** + * Encodes the specified TrainProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse} message TrainProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionResponse} TrainProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainProcessorVersionResponse.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.processorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionResponse} TrainProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainProcessorVersionResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainProcessorVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + if (!$util.isString(message.processorVersion)) + return "processorVersion: string expected"; + return null; + }; + + /** + * Creates a TrainProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionResponse} TrainProcessorVersionResponse + */ + TrainProcessorVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionResponse) + return object; + var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionResponse(); + if (object.processorVersion != null) + message.processorVersion = String(object.processorVersion); + return message; + }; + + /** + * Creates a plain object from a TrainProcessorVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionResponse} message TrainProcessorVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainProcessorVersionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.processorVersion = ""; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + object.processorVersion = message.processorVersion; + return object; + }; + + /** + * Converts this TrainProcessorVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse + * @instance + * @returns {Object.} JSON object + */ + TrainProcessorVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrainProcessorVersionResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrainProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionResponse"; + }; + + return TrainProcessorVersionResponse; + })(); + + v1beta3.TrainProcessorVersionMetadata = (function() { + + /** + * Properties of a TrainProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface ITrainProcessorVersionMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] TrainProcessorVersionMetadata commonMetadata + * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null} [trainingDatasetValidation] TrainProcessorVersionMetadata trainingDatasetValidation + * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null} [testDatasetValidation] TrainProcessorVersionMetadata testDatasetValidation + */ + + /** + * Constructs a new TrainProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a TrainProcessorVersionMetadata. + * @implements ITrainProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata=} [properties] Properties to set + */ + function TrainProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @instance + */ + TrainProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * TrainProcessorVersionMetadata trainingDatasetValidation. + * @member {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null|undefined} trainingDatasetValidation + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @instance + */ + TrainProcessorVersionMetadata.prototype.trainingDatasetValidation = null; + + /** + * TrainProcessorVersionMetadata testDatasetValidation. + * @member {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null|undefined} testDatasetValidation + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @instance + */ + TrainProcessorVersionMetadata.prototype.testDatasetValidation = null; + + /** + * Creates a new TrainProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata instance + */ + TrainProcessorVersionMetadata.create = function create(properties) { + return new TrainProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified TrainProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata} message TrainProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.trainingDatasetValidation != null && Object.hasOwnProperty.call(message, "trainingDatasetValidation")) + $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.encode(message.trainingDatasetValidation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.testDatasetValidation != null && Object.hasOwnProperty.call(message, "testDatasetValidation")) + $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.encode(message.testDatasetValidation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrainProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata} message TrainProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.trainingDatasetValidation = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.testDatasetValidation = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + if (message.trainingDatasetValidation != null && message.hasOwnProperty("trainingDatasetValidation")) { + var error = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.verify(message.trainingDatasetValidation); + if (error) + return "trainingDatasetValidation." + error; + } + if (message.testDatasetValidation != null && message.hasOwnProperty("testDatasetValidation")) { + var error = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.verify(message.testDatasetValidation); + if (error) + return "testDatasetValidation." + error; + } + return null; + }; + + /** + * Creates a TrainProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata + */ + TrainProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + if (object.trainingDatasetValidation != null) { + if (typeof object.trainingDatasetValidation !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.trainingDatasetValidation: object expected"); + message.trainingDatasetValidation = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.fromObject(object.trainingDatasetValidation); + } + if (object.testDatasetValidation != null) { + if (typeof object.testDatasetValidation !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.testDatasetValidation: object expected"); + message.testDatasetValidation = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.fromObject(object.testDatasetValidation); + } + return message; + }; + + /** + * Creates a plain object from a TrainProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata} message TrainProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.commonMetadata = null; + object.trainingDatasetValidation = null; + object.testDatasetValidation = null; + } + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + if (message.trainingDatasetValidation != null && message.hasOwnProperty("trainingDatasetValidation")) + object.trainingDatasetValidation = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.toObject(message.trainingDatasetValidation, options); + if (message.testDatasetValidation != null && message.hasOwnProperty("testDatasetValidation")) + object.testDatasetValidation = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.toObject(message.testDatasetValidation, options); + return object; + }; + + /** + * Converts this TrainProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + TrainProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrainProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrainProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata"; + }; + + TrainProcessorVersionMetadata.DatasetValidation = (function() { + + /** + * Properties of a DatasetValidation. + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @interface IDatasetValidation + * @property {number|null} [documentErrorCount] DatasetValidation documentErrorCount + * @property {number|null} [datasetErrorCount] DatasetValidation datasetErrorCount + * @property {Array.|null} [documentErrors] DatasetValidation documentErrors + * @property {Array.|null} [datasetErrors] DatasetValidation datasetErrors + */ + + /** + * Constructs a new DatasetValidation. + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata + * @classdesc Represents a DatasetValidation. + * @implements IDatasetValidation + * @constructor + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation=} [properties] Properties to set + */ + function DatasetValidation(properties) { + this.documentErrors = []; + this.datasetErrors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DatasetValidation documentErrorCount. + * @member {number} documentErrorCount + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @instance + */ + DatasetValidation.prototype.documentErrorCount = 0; + + /** + * DatasetValidation datasetErrorCount. + * @member {number} datasetErrorCount + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @instance + */ + DatasetValidation.prototype.datasetErrorCount = 0; + + /** + * DatasetValidation documentErrors. + * @member {Array.} documentErrors + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @instance + */ + DatasetValidation.prototype.documentErrors = $util.emptyArray; + + /** + * DatasetValidation datasetErrors. + * @member {Array.} datasetErrors + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @instance + */ + DatasetValidation.prototype.datasetErrors = $util.emptyArray; + + /** + * Creates a new DatasetValidation instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation instance + */ + DatasetValidation.create = function create(properties) { + return new DatasetValidation(properties); + }; + + /** + * Encodes the specified DatasetValidation message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation} message DatasetValidation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetValidation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentErrors != null && message.documentErrors.length) + for (var i = 0; i < message.documentErrors.length; ++i) + $root.google.rpc.Status.encode(message.documentErrors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.datasetErrors != null && message.datasetErrors.length) + for (var i = 0; i < message.datasetErrors.length; ++i) + $root.google.rpc.Status.encode(message.datasetErrors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.documentErrorCount != null && Object.hasOwnProperty.call(message, "documentErrorCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.documentErrorCount); + if (message.datasetErrorCount != null && Object.hasOwnProperty.call(message, "datasetErrorCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.datasetErrorCount); + return writer; + }; + + /** + * Encodes the specified DatasetValidation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation} message DatasetValidation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatasetValidation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DatasetValidation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetValidation.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionMetadata.DatasetValidation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.documentErrorCount = reader.int32(); + break; + } + case 4: { + message.datasetErrorCount = reader.int32(); + break; + } + case 1: { + if (!(message.documentErrors && message.documentErrors.length)) + message.documentErrors = []; + message.documentErrors.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.datasetErrors && message.datasetErrors.length)) + message.datasetErrors = []; + message.datasetErrors.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatasetValidation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatasetValidation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DatasetValidation message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatasetValidation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentErrorCount != null && message.hasOwnProperty("documentErrorCount")) + if (!$util.isInteger(message.documentErrorCount)) + return "documentErrorCount: integer expected"; + if (message.datasetErrorCount != null && message.hasOwnProperty("datasetErrorCount")) + if (!$util.isInteger(message.datasetErrorCount)) + return "datasetErrorCount: integer expected"; + if (message.documentErrors != null && message.hasOwnProperty("documentErrors")) { + if (!Array.isArray(message.documentErrors)) + return "documentErrors: array expected"; + for (var i = 0; i < message.documentErrors.length; ++i) { + var error = $root.google.rpc.Status.verify(message.documentErrors[i]); + if (error) + return "documentErrors." + error; + } + } + if (message.datasetErrors != null && message.hasOwnProperty("datasetErrors")) { + if (!Array.isArray(message.datasetErrors)) + return "datasetErrors: array expected"; + for (var i = 0; i < message.datasetErrors.length; ++i) { + var error = $root.google.rpc.Status.verify(message.datasetErrors[i]); + if (error) + return "datasetErrors." + error; + } + } + return null; + }; + + /** + * Creates a DatasetValidation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation + */ + DatasetValidation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation) + return object; + var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation(); + if (object.documentErrorCount != null) + message.documentErrorCount = object.documentErrorCount | 0; + if (object.datasetErrorCount != null) + message.datasetErrorCount = object.datasetErrorCount | 0; + if (object.documentErrors) { + if (!Array.isArray(object.documentErrors)) + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.documentErrors: array expected"); + message.documentErrors = []; + for (var i = 0; i < object.documentErrors.length; ++i) { + if (typeof object.documentErrors[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.documentErrors: object expected"); + message.documentErrors[i] = $root.google.rpc.Status.fromObject(object.documentErrors[i]); + } + } + if (object.datasetErrors) { + if (!Array.isArray(object.datasetErrors)) + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.datasetErrors: array expected"); + message.datasetErrors = []; + for (var i = 0; i < object.datasetErrors.length; ++i) { + if (typeof object.datasetErrors[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.datasetErrors: object expected"); + message.datasetErrors[i] = $root.google.rpc.Status.fromObject(object.datasetErrors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DatasetValidation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation} message DatasetValidation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatasetValidation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.documentErrors = []; + object.datasetErrors = []; + } + if (options.defaults) { + object.documentErrorCount = 0; + object.datasetErrorCount = 0; + } + if (message.documentErrors && message.documentErrors.length) { + object.documentErrors = []; + for (var j = 0; j < message.documentErrors.length; ++j) + object.documentErrors[j] = $root.google.rpc.Status.toObject(message.documentErrors[j], options); + } + if (message.datasetErrors && message.datasetErrors.length) { + object.datasetErrors = []; + for (var j = 0; j < message.datasetErrors.length; ++j) + object.datasetErrors[j] = $root.google.rpc.Status.toObject(message.datasetErrors[j], options); + } + if (message.documentErrorCount != null && message.hasOwnProperty("documentErrorCount")) + object.documentErrorCount = message.documentErrorCount; + if (message.datasetErrorCount != null && message.hasOwnProperty("datasetErrorCount")) + object.datasetErrorCount = message.datasetErrorCount; + return object; + }; + + /** + * Converts this DatasetValidation to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @instance + * @returns {Object.} JSON object + */ + DatasetValidation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DatasetValidation + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DatasetValidation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation"; + }; + + return DatasetValidation; + })(); + + return TrainProcessorVersionMetadata; + })(); + + v1beta3.ReviewDocumentRequest = (function() { + + /** + * Properties of a ReviewDocumentRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IReviewDocumentRequest + * @property {google.cloud.documentai.v1beta3.IDocument|null} [inlineDocument] ReviewDocumentRequest inlineDocument + * @property {string|null} [humanReviewConfig] ReviewDocumentRequest humanReviewConfig + * @property {google.cloud.documentai.v1beta3.IDocument|null} [document] ReviewDocumentRequest document + * @property {boolean|null} [enableSchemaValidation] ReviewDocumentRequest enableSchemaValidation + * @property {google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority|null} [priority] ReviewDocumentRequest priority + * @property {google.cloud.documentai.v1beta3.IDocumentSchema|null} [documentSchema] ReviewDocumentRequest documentSchema + */ + + /** + * Constructs a new ReviewDocumentRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ReviewDocumentRequest. + * @implements IReviewDocumentRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IReviewDocumentRequest=} [properties] Properties to set + */ + function ReviewDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReviewDocumentRequest inlineDocument. + * @member {google.cloud.documentai.v1beta3.IDocument|null|undefined} inlineDocument + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @instance + */ + ReviewDocumentRequest.prototype.inlineDocument = null; + + /** + * ReviewDocumentRequest humanReviewConfig. + * @member {string} humanReviewConfig + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @instance + */ + ReviewDocumentRequest.prototype.humanReviewConfig = ""; + + /** + * ReviewDocumentRequest document. + * @member {google.cloud.documentai.v1beta3.IDocument|null|undefined} document + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @instance + */ + ReviewDocumentRequest.prototype.document = null; + + /** + * ReviewDocumentRequest enableSchemaValidation. + * @member {boolean} enableSchemaValidation + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @instance + */ + ReviewDocumentRequest.prototype.enableSchemaValidation = false; + + /** + * ReviewDocumentRequest priority. + * @member {google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority} priority + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @instance + */ + ReviewDocumentRequest.prototype.priority = 0; + + /** + * ReviewDocumentRequest documentSchema. + * @member {google.cloud.documentai.v1beta3.IDocumentSchema|null|undefined} documentSchema + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @instance + */ + ReviewDocumentRequest.prototype.documentSchema = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReviewDocumentRequest source. + * @member {"inlineDocument"|undefined} source + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @instance + */ + Object.defineProperty(ReviewDocumentRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["inlineDocument"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReviewDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @static + * @param {google.cloud.documentai.v1beta3.IReviewDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ReviewDocumentRequest} ReviewDocumentRequest instance + */ + ReviewDocumentRequest.create = function create(properties) { + return new ReviewDocumentRequest(properties); + }; + + /** + * Encodes the specified ReviewDocumentRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @static + * @param {google.cloud.documentai.v1beta3.IReviewDocumentRequest} message ReviewDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReviewDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.humanReviewConfig != null && Object.hasOwnProperty.call(message, "humanReviewConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.humanReviewConfig); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.documentai.v1beta3.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.enableSchemaValidation != null && Object.hasOwnProperty.call(message, "enableSchemaValidation")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableSchemaValidation); + if (message.inlineDocument != null && Object.hasOwnProperty.call(message, "inlineDocument")) + $root.google.cloud.documentai.v1beta3.Document.encode(message.inlineDocument, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.priority); + if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) + $root.google.cloud.documentai.v1beta3.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReviewDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @static + * @param {google.cloud.documentai.v1beta3.IReviewDocumentRequest} message ReviewDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReviewDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReviewDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ReviewDocumentRequest} ReviewDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReviewDocumentRequest.decode = function decode(reader, 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.v1beta3.ReviewDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 4: { + message.inlineDocument = $root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32()); + break; + } + case 1: { + message.humanReviewConfig = reader.string(); + break; + } + case 2: { + message.document = $root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32()); + break; + } + case 3: { + message.enableSchemaValidation = reader.bool(); + break; + } + case 5: { + message.priority = reader.int32(); + break; + } + case 6: { + message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReviewDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ReviewDocumentRequest} ReviewDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReviewDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReviewDocumentRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReviewDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1beta3.Document.verify(message.inlineDocument); + if (error) + return "inlineDocument." + error; + } + } + if (message.humanReviewConfig != null && message.hasOwnProperty("humanReviewConfig")) + if (!$util.isString(message.humanReviewConfig)) + return "humanReviewConfig: string expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.documentai.v1beta3.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.enableSchemaValidation != null && message.hasOwnProperty("enableSchemaValidation")) + if (typeof message.enableSchemaValidation !== "boolean") + return "enableSchemaValidation: boolean expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + switch (message.priority) { + default: + return "priority: enum value expected"; + case 0: + case 1: + break; + } + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) { + var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.verify(message.documentSchema); + if (error) + return "documentSchema." + error; + } + return null; + }; + + /** + * Creates a ReviewDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ReviewDocumentRequest} ReviewDocumentRequest + */ + ReviewDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest(); + if (object.inlineDocument != null) { + if (typeof object.inlineDocument !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ReviewDocumentRequest.inlineDocument: object expected"); + message.inlineDocument = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.inlineDocument); + } + if (object.humanReviewConfig != null) + message.humanReviewConfig = String(object.humanReviewConfig); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ReviewDocumentRequest.document: object expected"); + message.document = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.document); + } + if (object.enableSchemaValidation != null) + message.enableSchemaValidation = Boolean(object.enableSchemaValidation); + switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; + case "DEFAULT": + case 0: + message.priority = 0; + break; + case "URGENT": + case 1: + message.priority = 1; + break; + } + if (object.documentSchema != null) { + if (typeof object.documentSchema !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ReviewDocumentRequest.documentSchema: object expected"); + message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.fromObject(object.documentSchema); + } + return message; + }; + + /** + * Creates a plain object from a ReviewDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @static + * @param {google.cloud.documentai.v1beta3.ReviewDocumentRequest} message ReviewDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReviewDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.humanReviewConfig = ""; + object.document = null; + object.enableSchemaValidation = false; + object.priority = options.enums === String ? "DEFAULT" : 0; + object.documentSchema = null; + } + if (message.humanReviewConfig != null && message.hasOwnProperty("humanReviewConfig")) + object.humanReviewConfig = message.humanReviewConfig; + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.documentai.v1beta3.Document.toObject(message.document, options); + if (message.enableSchemaValidation != null && message.hasOwnProperty("enableSchemaValidation")) + object.enableSchemaValidation = message.enableSchemaValidation; + if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { + object.inlineDocument = $root.google.cloud.documentai.v1beta3.Document.toObject(message.inlineDocument, options); + if (options.oneofs) + object.source = "inlineDocument"; + } + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = options.enums === String ? $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority[message.priority] === undefined ? message.priority : $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority[message.priority] : message.priority; + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) + object.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.toObject(message.documentSchema, options); + return object; + }; + + /** + * Converts this ReviewDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + ReviewDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReviewDocumentRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReviewDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ReviewDocumentRequest"; + }; + + /** + * Priority enum. + * @name google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority + * @enum {number} + * @property {number} DEFAULT=0 DEFAULT value + * @property {number} URGENT=1 URGENT value + */ + ReviewDocumentRequest.Priority = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "URGENT"] = 1; + return values; + })(); + + return ReviewDocumentRequest; + })(); + + v1beta3.ReviewDocumentResponse = (function() { + + /** + * Properties of a ReviewDocumentResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IReviewDocumentResponse + * @property {string|null} [gcsDestination] ReviewDocumentResponse gcsDestination + * @property {google.cloud.documentai.v1beta3.ReviewDocumentResponse.State|null} [state] ReviewDocumentResponse state + * @property {string|null} [rejectionReason] ReviewDocumentResponse rejectionReason + */ + + /** + * Constructs a new ReviewDocumentResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ReviewDocumentResponse. + * @implements IReviewDocumentResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IReviewDocumentResponse=} [properties] Properties to set + */ + function ReviewDocumentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReviewDocumentResponse gcsDestination. + * @member {string} gcsDestination + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @instance + */ + ReviewDocumentResponse.prototype.gcsDestination = ""; + + /** + * ReviewDocumentResponse state. + * @member {google.cloud.documentai.v1beta3.ReviewDocumentResponse.State} state + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @instance + */ + ReviewDocumentResponse.prototype.state = 0; + + /** + * ReviewDocumentResponse rejectionReason. + * @member {string} rejectionReason + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @instance + */ + ReviewDocumentResponse.prototype.rejectionReason = ""; + + /** + * Creates a new ReviewDocumentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @static + * @param {google.cloud.documentai.v1beta3.IReviewDocumentResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ReviewDocumentResponse} ReviewDocumentResponse instance + */ + ReviewDocumentResponse.create = function create(properties) { + return new ReviewDocumentResponse(properties); + }; + + /** + * Encodes the specified ReviewDocumentResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @static + * @param {google.cloud.documentai.v1beta3.IReviewDocumentResponse} message ReviewDocumentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReviewDocumentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsDestination); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.rejectionReason != null && Object.hasOwnProperty.call(message, "rejectionReason")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.rejectionReason); + return writer; + }; + + /** + * Encodes the specified ReviewDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @static + * @param {google.cloud.documentai.v1beta3.IReviewDocumentResponse} message ReviewDocumentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReviewDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReviewDocumentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ReviewDocumentResponse} ReviewDocumentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReviewDocumentResponse.decode = function decode(reader, 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.v1beta3.ReviewDocumentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcsDestination = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.rejectionReason = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReviewDocumentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ReviewDocumentResponse} ReviewDocumentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReviewDocumentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReviewDocumentResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReviewDocumentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + if (!$util.isString(message.gcsDestination)) + return "gcsDestination: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.rejectionReason != null && message.hasOwnProperty("rejectionReason")) + if (!$util.isString(message.rejectionReason)) + return "rejectionReason: string expected"; + return null; + }; + + /** + * Creates a ReviewDocumentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ReviewDocumentResponse} ReviewDocumentResponse + */ + ReviewDocumentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ReviewDocumentResponse) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ReviewDocumentResponse(); + if (object.gcsDestination != null) + message.gcsDestination = String(object.gcsDestination); + 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 "REJECTED": + case 1: + message.state = 1; + break; + case "SUCCEEDED": + case 2: + message.state = 2; + break; + } + if (object.rejectionReason != null) + message.rejectionReason = String(object.rejectionReason); + return message; + }; + + /** + * Creates a plain object from a ReviewDocumentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @static + * @param {google.cloud.documentai.v1beta3.ReviewDocumentResponse} message ReviewDocumentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReviewDocumentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcsDestination = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.rejectionReason = ""; + } + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) + object.gcsDestination = message.gcsDestination; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State[message.state] : message.state; + if (message.rejectionReason != null && message.hasOwnProperty("rejectionReason")) + object.rejectionReason = message.rejectionReason; + return object; + }; + + /** + * Converts this ReviewDocumentResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @instance + * @returns {Object.} JSON object + */ + ReviewDocumentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReviewDocumentResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReviewDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ReviewDocumentResponse"; + }; + + /** + * State enum. + * @name google.cloud.documentai.v1beta3.ReviewDocumentResponse.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} REJECTED=1 REJECTED value + * @property {number} SUCCEEDED=2 SUCCEEDED value + */ + ReviewDocumentResponse.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REJECTED"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + return values; + })(); + + return ReviewDocumentResponse; + })(); + + v1beta3.ReviewDocumentOperationMetadata = (function() { + + /** + * Properties of a ReviewDocumentOperationMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IReviewDocumentOperationMetadata + * @property {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State|null} [state] ReviewDocumentOperationMetadata state + * @property {string|null} [stateMessage] ReviewDocumentOperationMetadata stateMessage + * @property {google.protobuf.ITimestamp|null} [createTime] ReviewDocumentOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ReviewDocumentOperationMetadata updateTime + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] ReviewDocumentOperationMetadata commonMetadata + * @property {string|null} [questionId] ReviewDocumentOperationMetadata questionId + */ + + /** + * Constructs a new ReviewDocumentOperationMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ReviewDocumentOperationMetadata. + * @implements IReviewDocumentOperationMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata=} [properties] Properties to set + */ + function ReviewDocumentOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReviewDocumentOperationMetadata state. + * @member {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State} state + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @instance + */ + ReviewDocumentOperationMetadata.prototype.state = 0; + + /** + * ReviewDocumentOperationMetadata stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @instance + */ + ReviewDocumentOperationMetadata.prototype.stateMessage = ""; + + /** + * ReviewDocumentOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @instance + */ + ReviewDocumentOperationMetadata.prototype.createTime = null; + + /** + * ReviewDocumentOperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @instance + */ + ReviewDocumentOperationMetadata.prototype.updateTime = null; + + /** + * ReviewDocumentOperationMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @instance + */ + ReviewDocumentOperationMetadata.prototype.commonMetadata = null; + + /** + * ReviewDocumentOperationMetadata questionId. + * @member {string} questionId + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @instance + */ + ReviewDocumentOperationMetadata.prototype.questionId = ""; + + /** + * Creates a new ReviewDocumentOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata instance + */ + ReviewDocumentOperationMetadata.create = function create(properties) { + return new ReviewDocumentOperationMetadata(properties); + }; + + /** + * Encodes the specified ReviewDocumentOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata} message ReviewDocumentOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReviewDocumentOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); + 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.questionId != null && Object.hasOwnProperty.call(message, "questionId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.questionId); + return writer; + }; + + /** + * Encodes the specified ReviewDocumentOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata} message ReviewDocumentOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReviewDocumentOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReviewDocumentOperationMetadata.decode = function decode(reader, 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.v1beta3.ReviewDocumentOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.stateMessage = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 6: { + message.questionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReviewDocumentOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReviewDocumentOperationMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReviewDocumentOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + if (message.questionId != null && message.hasOwnProperty("questionId")) + if (!$util.isString(message.questionId)) + return "questionId: string expected"; + return null; + }; + + /** + * Creates a ReviewDocumentOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata + */ + ReviewDocumentOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata(); + 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 "RUNNING": + case 1: + message.state = 1; + break; + case "CANCELLING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + if (object.questionId != null) + message.questionId = String(object.questionId); + return message; + }; + + /** + * Creates a plain object from a ReviewDocumentOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @static + * @param {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata} message ReviewDocumentOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReviewDocumentOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.createTime = null; + object.updateTime = null; + object.commonMetadata = null; + object.questionId = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + if (message.questionId != null && message.hasOwnProperty("questionId")) + object.questionId = message.questionId; + return object; + }; + + /** + * Converts this ReviewDocumentOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ReviewDocumentOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReviewDocumentOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReviewDocumentOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata"; + }; + + /** + * State enum. + * @name google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} CANCELLING=2 CANCELLING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} CANCELLED=5 CANCELLED value + */ + ReviewDocumentOperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "CANCELLING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return ReviewDocumentOperationMetadata; + })(); + + v1beta3.EvaluateProcessorVersionRequest = (function() { + + /** + * Properties of an EvaluateProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IEvaluateProcessorVersionRequest + * @property {string|null} [processorVersion] EvaluateProcessorVersionRequest processorVersion + * @property {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null} [evaluationDocuments] EvaluateProcessorVersionRequest evaluationDocuments + */ + + /** + * Constructs a new EvaluateProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an EvaluateProcessorVersionRequest. + * @implements IEvaluateProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest=} [properties] Properties to set + */ + function EvaluateProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluateProcessorVersionRequest processorVersion. + * @member {string} processorVersion + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + * @instance + */ + EvaluateProcessorVersionRequest.prototype.processorVersion = ""; + + /** + * EvaluateProcessorVersionRequest evaluationDocuments. + * @member {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null|undefined} evaluationDocuments + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + * @instance + */ + EvaluateProcessorVersionRequest.prototype.evaluationDocuments = null; + + /** + * Creates a new EvaluateProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest instance + */ + EvaluateProcessorVersionRequest.create = function create(properties) { + return new EvaluateProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified EvaluateProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest} message EvaluateProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateProcessorVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorVersion); + if (message.evaluationDocuments != null && Object.hasOwnProperty.call(message, "evaluationDocuments")) + $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.encode(message.evaluationDocuments, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluateProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest} message EvaluateProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.EvaluateProcessorVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.processorVersion = reader.string(); + break; + } + case 3: { + message.evaluationDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluateProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluateProcessorVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + if (!$util.isString(message.processorVersion)) + return "processorVersion: string expected"; + if (message.evaluationDocuments != null && message.hasOwnProperty("evaluationDocuments")) { + var error = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify(message.evaluationDocuments); + if (error) + return "evaluationDocuments." + error; + } + return null; + }; + + /** + * Creates an EvaluateProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest + */ + EvaluateProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest(); + if (object.processorVersion != null) + message.processorVersion = String(object.processorVersion); + if (object.evaluationDocuments != null) { + if (typeof object.evaluationDocuments !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest.evaluationDocuments: object expected"); + message.evaluationDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.fromObject(object.evaluationDocuments); + } + return message; + }; + + /** + * Creates a plain object from an EvaluateProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest} message EvaluateProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluateProcessorVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.processorVersion = ""; + object.evaluationDocuments = null; + } + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + object.processorVersion = message.processorVersion; + if (message.evaluationDocuments != null && message.hasOwnProperty("evaluationDocuments")) + object.evaluationDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.toObject(message.evaluationDocuments, options); + return object; + }; + + /** + * Converts this EvaluateProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + EvaluateProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluateProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluateProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest"; + }; + + return EvaluateProcessorVersionRequest; + })(); + + v1beta3.EvaluateProcessorVersionMetadata = (function() { + + /** + * Properties of an EvaluateProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IEvaluateProcessorVersionMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] EvaluateProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new EvaluateProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an EvaluateProcessorVersionMetadata. + * @implements IEvaluateProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata=} [properties] Properties to set + */ + function EvaluateProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluateProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata + * @instance + */ + EvaluateProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new EvaluateProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata instance + */ + EvaluateProcessorVersionMetadata.create = function create(properties) { + return new EvaluateProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified EvaluateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata} message EvaluateProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata} message EvaluateProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.EvaluateProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluateProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluateProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates an EvaluateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata + */ + EvaluateProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from an EvaluateProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata} message EvaluateProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluateProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this EvaluateProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + EvaluateProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluateProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluateProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata"; + }; + + return EvaluateProcessorVersionMetadata; + })(); + + v1beta3.EvaluateProcessorVersionResponse = (function() { + + /** + * Properties of an EvaluateProcessorVersionResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IEvaluateProcessorVersionResponse + * @property {string|null} [evaluation] EvaluateProcessorVersionResponse evaluation + */ + + /** + * Constructs a new EvaluateProcessorVersionResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an EvaluateProcessorVersionResponse. + * @implements IEvaluateProcessorVersionResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse=} [properties] Properties to set + */ + function EvaluateProcessorVersionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluateProcessorVersionResponse evaluation. + * @member {string} evaluation + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse + * @instance + */ + EvaluateProcessorVersionResponse.prototype.evaluation = ""; + + /** + * Creates a new EvaluateProcessorVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse instance + */ + EvaluateProcessorVersionResponse.create = function create(properties) { + return new EvaluateProcessorVersionResponse(properties); + }; + + /** + * Encodes the specified EvaluateProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse} message EvaluateProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateProcessorVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluation); + return writer; + }; + + /** + * Encodes the specified EvaluateProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse} message EvaluateProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateProcessorVersionResponse.decode = function decode(reader, 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.v1beta3.EvaluateProcessorVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.evaluation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluateProcessorVersionResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluateProcessorVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) + if (!$util.isString(message.evaluation)) + return "evaluation: string expected"; + return null; + }; + + /** + * Creates an EvaluateProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse + */ + EvaluateProcessorVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse) + return object; + var message = new $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse(); + if (object.evaluation != null) + message.evaluation = String(object.evaluation); + return message; + }; + + /** + * Creates a plain object from an EvaluateProcessorVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse} message EvaluateProcessorVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluateProcessorVersionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.evaluation = ""; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) + object.evaluation = message.evaluation; + return object; + }; + + /** + * Converts this EvaluateProcessorVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse + * @instance + * @returns {Object.} JSON object + */ + EvaluateProcessorVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluateProcessorVersionResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluateProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse"; + }; + + return EvaluateProcessorVersionResponse; + })(); + + v1beta3.GetEvaluationRequest = (function() { + + /** + * Properties of a GetEvaluationRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGetEvaluationRequest + * @property {string|null} [name] GetEvaluationRequest name + */ + + /** + * Constructs a new GetEvaluationRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a GetEvaluationRequest. + * @implements IGetEvaluationRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IGetEvaluationRequest=} [properties] Properties to set + */ + function GetEvaluationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEvaluationRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest + * @instance + */ + GetEvaluationRequest.prototype.name = ""; + + /** + * Creates a new GetEvaluationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetEvaluationRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.GetEvaluationRequest} GetEvaluationRequest instance + */ + GetEvaluationRequest.create = function create(properties) { + return new GetEvaluationRequest(properties); + }; + + /** + * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetEvaluationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRequest.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 GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetEvaluationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEvaluationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.GetEvaluationRequest} GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRequest.decode = function decode(reader, 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.v1beta3.GetEvaluationRequest(); + 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 GetEvaluationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.GetEvaluationRequest} GetEvaluationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEvaluationRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEvaluationRequest.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 GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.GetEvaluationRequest} GetEvaluationRequest + */ + GetEvaluationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.GetEvaluationRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.GetEvaluationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest + * @static + * @param {google.cloud.documentai.v1beta3.GetEvaluationRequest} message GetEvaluationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEvaluationRequest.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 GetEvaluationRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest + * @instance + * @returns {Object.} JSON object + */ + GetEvaluationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetEvaluationRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetEvaluationRequest"; + }; + + return GetEvaluationRequest; + })(); + + v1beta3.ListEvaluationsRequest = (function() { + + /** + * Properties of a ListEvaluationsRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IListEvaluationsRequest + * @property {string|null} [parent] ListEvaluationsRequest parent + * @property {number|null} [pageSize] ListEvaluationsRequest pageSize + * @property {string|null} [pageToken] ListEvaluationsRequest pageToken + */ + + /** + * Constructs a new ListEvaluationsRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ListEvaluationsRequest. + * @implements IListEvaluationsRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IListEvaluationsRequest=} [properties] Properties to set + */ + function ListEvaluationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationsRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.parent = ""; + + /** + * ListEvaluationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.pageSize = 0; + + /** + * ListEvaluationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @instance + */ + ListEvaluationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEvaluationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListEvaluationsRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ListEvaluationsRequest} ListEvaluationsRequest instance + */ + ListEvaluationsRequest.create = function create(properties) { + return new ListEvaluationsRequest(properties); + }; + + /** + * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsRequest.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 ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ListEvaluationsRequest} ListEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsRequest.decode = function decode(reader, 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.v1beta3.ListEvaluationsRequest(); + 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 ListEvaluationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ListEvaluationsRequest} ListEvaluationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationsRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationsRequest.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 ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ListEvaluationsRequest} ListEvaluationsRequest + */ + ListEvaluationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ListEvaluationsRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ListEvaluationsRequest(); + 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 ListEvaluationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @static + * @param {google.cloud.documentai.v1beta3.ListEvaluationsRequest} message ListEvaluationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationsRequest.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 ListEvaluationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationsRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListEvaluationsRequest"; + }; + + return ListEvaluationsRequest; + })(); + + v1beta3.ListEvaluationsResponse = (function() { + + /** + * Properties of a ListEvaluationsResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IListEvaluationsResponse + * @property {Array.|null} [evaluations] ListEvaluationsResponse evaluations + * @property {string|null} [nextPageToken] ListEvaluationsResponse nextPageToken + */ + + /** + * Constructs a new ListEvaluationsResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ListEvaluationsResponse. + * @implements IListEvaluationsResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IListEvaluationsResponse=} [properties] Properties to set + */ + function ListEvaluationsResponse(properties) { + this.evaluations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEvaluationsResponse evaluations. + * @member {Array.} evaluations + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse + * @instance + */ + ListEvaluationsResponse.prototype.evaluations = $util.emptyArray; + + /** + * ListEvaluationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse + * @instance + */ + ListEvaluationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEvaluationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListEvaluationsResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ListEvaluationsResponse} ListEvaluationsResponse instance + */ + ListEvaluationsResponse.create = function create(properties) { + return new ListEvaluationsResponse(properties); + }; + + /** + * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluations != null && message.evaluations.length) + for (var i = 0; i < message.evaluations.length; ++i) + $root.google.cloud.documentai.v1beta3.Evaluation.encode(message.evaluations[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 ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ListEvaluationsResponse} ListEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsResponse.decode = function decode(reader, 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.v1beta3.ListEvaluationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.evaluations && message.evaluations.length)) + message.evaluations = []; + message.evaluations.push($root.google.cloud.documentai.v1beta3.Evaluation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ListEvaluationsResponse} ListEvaluationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEvaluationsResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEvaluationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluations != null && message.hasOwnProperty("evaluations")) { + if (!Array.isArray(message.evaluations)) + return "evaluations: array expected"; + for (var i = 0; i < message.evaluations.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.verify(message.evaluations[i]); + if (error) + return "evaluations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ListEvaluationsResponse} ListEvaluationsResponse + */ + ListEvaluationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ListEvaluationsResponse) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ListEvaluationsResponse(); + if (object.evaluations) { + if (!Array.isArray(object.evaluations)) + throw TypeError(".google.cloud.documentai.v1beta3.ListEvaluationsResponse.evaluations: array expected"); + message.evaluations = []; + for (var i = 0; i < object.evaluations.length; ++i) { + if (typeof object.evaluations[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ListEvaluationsResponse.evaluations: object expected"); + message.evaluations[i] = $root.google.cloud.documentai.v1beta3.Evaluation.fromObject(object.evaluations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse + * @static + * @param {google.cloud.documentai.v1beta3.ListEvaluationsResponse} message ListEvaluationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEvaluationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.evaluations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.evaluations && message.evaluations.length) { + object.evaluations = []; + for (var j = 0; j < message.evaluations.length; ++j) + object.evaluations[j] = $root.google.cloud.documentai.v1beta3.Evaluation.toObject(message.evaluations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEvaluationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEvaluationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListEvaluationsResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListEvaluationsResponse"; + }; + + return ListEvaluationsResponse; + })(); + + v1beta3.ImportProcessorVersionRequest = (function() { + + /** + * Properties of an ImportProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IImportProcessorVersionRequest + * @property {string|null} [processorVersionSource] ImportProcessorVersionRequest processorVersionSource + * @property {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource|null} [externalProcessorVersionSource] ImportProcessorVersionRequest externalProcessorVersionSource + * @property {string|null} [parent] ImportProcessorVersionRequest parent + */ + + /** + * Constructs a new ImportProcessorVersionRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an ImportProcessorVersionRequest. + * @implements IImportProcessorVersionRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionRequest=} [properties] Properties to set + */ + function ImportProcessorVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportProcessorVersionRequest processorVersionSource. + * @member {string|null|undefined} processorVersionSource + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @instance + */ + ImportProcessorVersionRequest.prototype.processorVersionSource = null; + + /** + * ImportProcessorVersionRequest externalProcessorVersionSource. + * @member {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource|null|undefined} externalProcessorVersionSource + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @instance + */ + ImportProcessorVersionRequest.prototype.externalProcessorVersionSource = null; + + /** + * ImportProcessorVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @instance + */ + ImportProcessorVersionRequest.prototype.parent = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportProcessorVersionRequest source. + * @member {"processorVersionSource"|"externalProcessorVersionSource"|undefined} source + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @instance + */ + Object.defineProperty(ImportProcessorVersionRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["processorVersionSource", "externalProcessorVersionSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportProcessorVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest} ImportProcessorVersionRequest instance + */ + ImportProcessorVersionRequest.create = function create(properties) { + return new ImportProcessorVersionRequest(properties); + }; + + /** + * Encodes the specified ImportProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionRequest} message ImportProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProcessorVersionRequest.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.processorVersionSource != null && Object.hasOwnProperty.call(message, "processorVersionSource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.processorVersionSource); + if (message.externalProcessorVersionSource != null && Object.hasOwnProperty.call(message, "externalProcessorVersionSource")) + $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.encode(message.externalProcessorVersionSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionRequest} message ImportProcessorVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProcessorVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest} ImportProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.ImportProcessorVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.processorVersionSource = reader.string(); + break; + } + case 3: { + message.externalProcessorVersionSource = $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProcessorVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest} ImportProcessorVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProcessorVersionRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProcessorVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.processorVersionSource != null && message.hasOwnProperty("processorVersionSource")) { + properties.source = 1; + if (!$util.isString(message.processorVersionSource)) + return "processorVersionSource: string expected"; + } + if (message.externalProcessorVersionSource != null && message.hasOwnProperty("externalProcessorVersionSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.verify(message.externalProcessorVersionSource); + if (error) + return "externalProcessorVersionSource." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates an ImportProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest} ImportProcessorVersionRequest + */ + ImportProcessorVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest(); + if (object.processorVersionSource != null) + message.processorVersionSource = String(object.processorVersionSource); + if (object.externalProcessorVersionSource != null) { + if (typeof object.externalProcessorVersionSource !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.externalProcessorVersionSource: object expected"); + message.externalProcessorVersionSource = $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.fromObject(object.externalProcessorVersionSource); + } + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from an ImportProcessorVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @static + * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest} message ImportProcessorVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProcessorVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.processorVersionSource != null && message.hasOwnProperty("processorVersionSource")) { + object.processorVersionSource = message.processorVersionSource; + if (options.oneofs) + object.source = "processorVersionSource"; + } + if (message.externalProcessorVersionSource != null && message.hasOwnProperty("externalProcessorVersionSource")) { + object.externalProcessorVersionSource = $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.toObject(message.externalProcessorVersionSource, options); + if (options.oneofs) + object.source = "externalProcessorVersionSource"; + } + return object; + }; + + /** + * Converts this ImportProcessorVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @instance + * @returns {Object.} JSON object + */ + ImportProcessorVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportProcessorVersionRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportProcessorVersionRequest"; + }; + + ImportProcessorVersionRequest.ExternalProcessorVersionSource = (function() { + + /** + * Properties of an ExternalProcessorVersionSource. + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @interface IExternalProcessorVersionSource + * @property {string|null} [processorVersion] ExternalProcessorVersionSource processorVersion + * @property {string|null} [serviceEndpoint] ExternalProcessorVersionSource serviceEndpoint + */ + + /** + * Constructs a new ExternalProcessorVersionSource. + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest + * @classdesc Represents an ExternalProcessorVersionSource. + * @implements IExternalProcessorVersionSource + * @constructor + * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource=} [properties] Properties to set + */ + function ExternalProcessorVersionSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalProcessorVersionSource processorVersion. + * @member {string} processorVersion + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource + * @instance + */ + ExternalProcessorVersionSource.prototype.processorVersion = ""; + + /** + * ExternalProcessorVersionSource serviceEndpoint. + * @member {string} serviceEndpoint + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource + * @instance + */ + ExternalProcessorVersionSource.prototype.serviceEndpoint = ""; + + /** + * Creates a new ExternalProcessorVersionSource instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource + * @static + * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource} ExternalProcessorVersionSource instance + */ + ExternalProcessorVersionSource.create = function create(properties) { + return new ExternalProcessorVersionSource(properties); + }; + + /** + * Encodes the specified ExternalProcessorVersionSource message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource + * @static + * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource} message ExternalProcessorVersionSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalProcessorVersionSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorVersion); + if (message.serviceEndpoint != null && Object.hasOwnProperty.call(message, "serviceEndpoint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceEndpoint); + return writer; + }; + + /** + * Encodes the specified ExternalProcessorVersionSource message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource + * @static + * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource} message ExternalProcessorVersionSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalProcessorVersionSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExternalProcessorVersionSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource} ExternalProcessorVersionSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalProcessorVersionSource.decode = function decode(reader, 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.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.processorVersion = reader.string(); + break; + } + case 2: { + message.serviceEndpoint = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalProcessorVersionSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource} ExternalProcessorVersionSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalProcessorVersionSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalProcessorVersionSource message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalProcessorVersionSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + if (!$util.isString(message.processorVersion)) + return "processorVersion: string expected"; + if (message.serviceEndpoint != null && message.hasOwnProperty("serviceEndpoint")) + if (!$util.isString(message.serviceEndpoint)) + return "serviceEndpoint: string expected"; + return null; + }; + + /** + * Creates an ExternalProcessorVersionSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource} ExternalProcessorVersionSource + */ + ExternalProcessorVersionSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource(); + if (object.processorVersion != null) + message.processorVersion = String(object.processorVersion); + if (object.serviceEndpoint != null) + message.serviceEndpoint = String(object.serviceEndpoint); + return message; + }; + + /** + * Creates a plain object from an ExternalProcessorVersionSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource + * @static + * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource} message ExternalProcessorVersionSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalProcessorVersionSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.processorVersion = ""; + object.serviceEndpoint = ""; + } + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + object.processorVersion = message.processorVersion; + if (message.serviceEndpoint != null && message.hasOwnProperty("serviceEndpoint")) + object.serviceEndpoint = message.serviceEndpoint; + return object; + }; + + /** + * Converts this ExternalProcessorVersionSource to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource + * @instance + * @returns {Object.} JSON object + */ + ExternalProcessorVersionSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExternalProcessorVersionSource + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExternalProcessorVersionSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource"; + }; + + return ExternalProcessorVersionSource; + })(); + + return ImportProcessorVersionRequest; + })(); + + v1beta3.ImportProcessorVersionResponse = (function() { + + /** + * Properties of an ImportProcessorVersionResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IImportProcessorVersionResponse + * @property {string|null} [processorVersion] ImportProcessorVersionResponse processorVersion + */ + + /** + * Constructs a new ImportProcessorVersionResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an ImportProcessorVersionResponse. + * @implements IImportProcessorVersionResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionResponse=} [properties] Properties to set + */ + function ImportProcessorVersionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportProcessorVersionResponse processorVersion. + * @member {string} processorVersion + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse + * @instance + */ + ImportProcessorVersionResponse.prototype.processorVersion = ""; + + /** + * Creates a new ImportProcessorVersionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionResponse} ImportProcessorVersionResponse instance + */ + ImportProcessorVersionResponse.create = function create(properties) { + return new ImportProcessorVersionResponse(properties); + }; + + /** + * Encodes the specified ImportProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionResponse} message ImportProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProcessorVersionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorVersion); + return writer; + }; + + /** + * Encodes the specified ImportProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionResponse} message ImportProcessorVersionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProcessorVersionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionResponse} ImportProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProcessorVersionResponse.decode = function decode(reader, 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.v1beta3.ImportProcessorVersionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.processorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProcessorVersionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionResponse} ImportProcessorVersionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProcessorVersionResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProcessorVersionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + if (!$util.isString(message.processorVersion)) + return "processorVersion: string expected"; + return null; + }; + + /** + * Creates an ImportProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionResponse} ImportProcessorVersionResponse + */ + ImportProcessorVersionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ImportProcessorVersionResponse) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ImportProcessorVersionResponse(); + if (object.processorVersion != null) + message.processorVersion = String(object.processorVersion); + return message; + }; + + /** + * Creates a plain object from an ImportProcessorVersionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse + * @static + * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionResponse} message ImportProcessorVersionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProcessorVersionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.processorVersion = ""; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + object.processorVersion = message.processorVersion; + return object; + }; + + /** + * Converts this ImportProcessorVersionResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse + * @instance + * @returns {Object.} JSON object + */ + ImportProcessorVersionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportProcessorVersionResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportProcessorVersionResponse"; + }; + + return ImportProcessorVersionResponse; + })(); + + v1beta3.ImportProcessorVersionMetadata = (function() { + + /** + * Properties of an ImportProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IImportProcessorVersionMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] ImportProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new ImportProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an ImportProcessorVersionMetadata. + * @implements IImportProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata=} [properties] Properties to set + */ + function ImportProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata + * @instance + */ + ImportProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new ImportProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata} ImportProcessorVersionMetadata instance + */ + ImportProcessorVersionMetadata.create = function create(properties) { + return new ImportProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified ImportProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata} message ImportProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata} message ImportProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata} ImportProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.ImportProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata} ImportProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates an ImportProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata} ImportProcessorVersionMetadata + */ + ImportProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from an ImportProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata} message ImportProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this ImportProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata"; + }; + + return ImportProcessorVersionMetadata; + })(); + + v1beta3.UpdateProcessorVersionMetadata = (function() { + + /** + * Properties of an UpdateProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IUpdateProcessorVersionMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] UpdateProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new UpdateProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an UpdateProcessorVersionMetadata. + * @implements IUpdateProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata=} [properties] Properties to set + */ + function UpdateProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @instance + */ + UpdateProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new UpdateProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} UpdateProcessorVersionMetadata instance + */ + UpdateProcessorVersionMetadata.create = function create(properties) { + return new UpdateProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified UpdateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata} message UpdateProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata} message UpdateProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} UpdateProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.UpdateProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} UpdateProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates an UpdateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} UpdateProcessorVersionMetadata + */ + UpdateProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from an UpdateProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} message UpdateProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this UpdateProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata"; + }; + + return UpdateProcessorVersionMetadata; + })(); + + v1beta3.EvaluationReference = (function() { + + /** + * Properties of an EvaluationReference. + * @memberof google.cloud.documentai.v1beta3 + * @interface IEvaluationReference + * @property {string|null} [operation] EvaluationReference operation + * @property {string|null} [evaluation] EvaluationReference evaluation + * @property {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null} [aggregateMetrics] EvaluationReference aggregateMetrics + * @property {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null} [aggregateMetricsExact] EvaluationReference aggregateMetricsExact + */ + + /** + * Constructs a new EvaluationReference. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an EvaluationReference. + * @implements IEvaluationReference + * @constructor + * @param {google.cloud.documentai.v1beta3.IEvaluationReference=} [properties] Properties to set + */ + function EvaluationReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationReference operation. + * @member {string} operation + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @instance + */ + EvaluationReference.prototype.operation = ""; + + /** + * EvaluationReference evaluation. + * @member {string} evaluation + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @instance + */ + EvaluationReference.prototype.evaluation = ""; + + /** + * EvaluationReference aggregateMetrics. + * @member {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null|undefined} aggregateMetrics + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @instance + */ + EvaluationReference.prototype.aggregateMetrics = null; + + /** + * EvaluationReference aggregateMetricsExact. + * @member {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null|undefined} aggregateMetricsExact + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @instance + */ + EvaluationReference.prototype.aggregateMetricsExact = null; + + /** + * Creates a new EvaluationReference instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluationReference=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.EvaluationReference} EvaluationReference instance + */ + EvaluationReference.create = function create(properties) { + return new EvaluationReference(properties); + }; + + /** + * Encodes the specified EvaluationReference message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluationReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluationReference} message EvaluationReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); + if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluation); + if (message.aggregateMetrics != null && Object.hasOwnProperty.call(message, "aggregateMetrics")) + $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.encode(message.aggregateMetrics, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.aggregateMetricsExact != null && Object.hasOwnProperty.call(message, "aggregateMetricsExact")) + $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.encode(message.aggregateMetricsExact, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationReference message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluationReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluationReference} message EvaluationReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.EvaluationReference} EvaluationReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationReference.decode = function decode(reader, 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.v1beta3.EvaluationReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.operation = reader.string(); + break; + } + case 2: { + message.evaluation = reader.string(); + break; + } + case 4: { + message.aggregateMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.decode(reader, reader.uint32()); + break; + } + case 5: { + message.aggregateMetricsExact = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.EvaluationReference} EvaluationReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationReference message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) + if (!$util.isString(message.evaluation)) + return "evaluation: string expected"; + if (message.aggregateMetrics != null && message.hasOwnProperty("aggregateMetrics")) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.verify(message.aggregateMetrics); + if (error) + return "aggregateMetrics." + error; + } + if (message.aggregateMetricsExact != null && message.hasOwnProperty("aggregateMetricsExact")) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.verify(message.aggregateMetricsExact); + if (error) + return "aggregateMetricsExact." + error; + } + return null; + }; + + /** + * Creates an EvaluationReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.EvaluationReference} EvaluationReference + */ + EvaluationReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.EvaluationReference) + return object; + var message = new $root.google.cloud.documentai.v1beta3.EvaluationReference(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.evaluation != null) + message.evaluation = String(object.evaluation); + if (object.aggregateMetrics != null) { + if (typeof object.aggregateMetrics !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.EvaluationReference.aggregateMetrics: object expected"); + message.aggregateMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.fromObject(object.aggregateMetrics); + } + if (object.aggregateMetricsExact != null) { + if (typeof object.aggregateMetricsExact !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.EvaluationReference.aggregateMetricsExact: object expected"); + message.aggregateMetricsExact = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.fromObject(object.aggregateMetricsExact); + } + return message; + }; + + /** + * Creates a plain object from an EvaluationReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @static + * @param {google.cloud.documentai.v1beta3.EvaluationReference} message EvaluationReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operation = ""; + object.evaluation = ""; + object.aggregateMetrics = null; + object.aggregateMetricsExact = null; + } + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.evaluation != null && message.hasOwnProperty("evaluation")) + object.evaluation = message.evaluation; + if (message.aggregateMetrics != null && message.hasOwnProperty("aggregateMetrics")) + object.aggregateMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.toObject(message.aggregateMetrics, options); + if (message.aggregateMetricsExact != null && message.hasOwnProperty("aggregateMetricsExact")) + object.aggregateMetricsExact = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.toObject(message.aggregateMetricsExact, options); + return object; + }; + + /** + * Converts this EvaluationReference to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @instance + * @returns {Object.} JSON object + */ + EvaluationReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationReference + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.EvaluationReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EvaluationReference"; + }; + + return EvaluationReference; + })(); + + v1beta3.Evaluation = (function() { + + /** + * Properties of an Evaluation. + * @memberof google.cloud.documentai.v1beta3 + * @interface IEvaluation + * @property {string|null} [name] Evaluation name + * @property {google.protobuf.ITimestamp|null} [createTime] Evaluation createTime + * @property {google.cloud.documentai.v1beta3.Evaluation.ICounters|null} [documentCounters] Evaluation documentCounters + * @property {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null} [allEntitiesMetrics] Evaluation allEntitiesMetrics + * @property {Object.|null} [entityMetrics] Evaluation entityMetrics + * @property {string|null} [kmsKeyName] Evaluation kmsKeyName + * @property {string|null} [kmsKeyVersionName] Evaluation kmsKeyVersionName + * @property {Array.|null} [revisions] Evaluation revisions + */ + + /** + * Constructs a new Evaluation. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an Evaluation. + * @implements IEvaluation + * @constructor + * @param {google.cloud.documentai.v1beta3.IEvaluation=} [properties] Properties to set + */ + function Evaluation(properties) { + this.entityMetrics = {}; + this.revisions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Evaluation name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @instance + */ + Evaluation.prototype.name = ""; + + /** + * Evaluation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @instance + */ + Evaluation.prototype.createTime = null; + + /** + * Evaluation documentCounters. + * @member {google.cloud.documentai.v1beta3.Evaluation.ICounters|null|undefined} documentCounters + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @instance + */ + Evaluation.prototype.documentCounters = null; + + /** + * Evaluation allEntitiesMetrics. + * @member {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null|undefined} allEntitiesMetrics + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @instance + */ + Evaluation.prototype.allEntitiesMetrics = null; + + /** + * Evaluation entityMetrics. + * @member {Object.} entityMetrics + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @instance + */ + Evaluation.prototype.entityMetrics = $util.emptyObject; + + /** + * Evaluation kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @instance + */ + Evaluation.prototype.kmsKeyName = ""; + + /** + * Evaluation kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @instance + */ + Evaluation.prototype.kmsKeyVersionName = ""; + + /** + * Evaluation revisions. + * @member {Array.} revisions + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @instance + */ + Evaluation.prototype.revisions = $util.emptyArray; + + /** + * Creates a new Evaluation instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluation=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Evaluation} Evaluation instance + */ + Evaluation.create = function create(properties) { + return new Evaluation(properties); + }; + + /** + * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluation} message Evaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.allEntitiesMetrics != null && Object.hasOwnProperty.call(message, "allEntitiesMetrics")) + $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.encode(message.allEntitiesMetrics, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.entityMetrics != null && Object.hasOwnProperty.call(message, "entityMetrics")) + for (var keys = Object.keys(message.entityMetrics), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.encode(message.entityMetrics[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.documentCounters != null && Object.hasOwnProperty.call(message, "documentCounters")) + $root.google.cloud.documentai.v1beta3.Evaluation.Counters.encode(message.documentCounters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.kmsKeyName); + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.kmsKeyVersionName); + if (message.revisions != null && message.revisions.length) + for (var i = 0; i < message.revisions.length; ++i) + $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.encode(message.revisions[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @static + * @param {google.cloud.documentai.v1beta3.IEvaluation} message Evaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Evaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Evaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Evaluation} Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluation.decode = function decode(reader, 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.v1beta3.Evaluation(), key, value; + 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.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.entityMetrics === $util.emptyObject) + message.entityMetrics = {}; + 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.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.entityMetrics[key] = value; + break; + } + case 6: { + message.kmsKeyName = reader.string(); + break; + } + case 7: { + message.kmsKeyVersionName = reader.string(); + break; + } + case 9: { + if (!(message.revisions && message.revisions.length)) + message.revisions = []; + message.revisions.push($root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Evaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Evaluation} Evaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Evaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Evaluation message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Evaluation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.documentCounters != null && message.hasOwnProperty("documentCounters")) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.verify(message.documentCounters); + if (error) + return "documentCounters." + error; + } + if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify(message.allEntitiesMetrics); + if (error) + return "allEntitiesMetrics." + error; + } + if (message.entityMetrics != null && message.hasOwnProperty("entityMetrics")) { + if (!$util.isObject(message.entityMetrics)) + return "entityMetrics: object expected"; + var key = Object.keys(message.entityMetrics); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify(message.entityMetrics[key[i]]); + if (error) + return "entityMetrics." + error; + } + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (!$util.isString(message.kmsKeyVersionName)) + return "kmsKeyVersionName: string expected"; + 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.v1beta3.Evaluation.EvaluationRevision.verify(message.revisions[i]); + if (error) + return "revisions." + error; + } + } + return null; + }; + + /** + * Creates an Evaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Evaluation} Evaluation + */ + Evaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Evaluation(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.documentCounters != null) { + if (typeof object.documentCounters !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.documentCounters: object expected"); + message.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.fromObject(object.documentCounters); + } + if (object.allEntitiesMetrics != null) { + if (typeof object.allEntitiesMetrics !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.allEntitiesMetrics: object expected"); + message.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.fromObject(object.allEntitiesMetrics); + } + if (object.entityMetrics) { + if (typeof object.entityMetrics !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.entityMetrics: object expected"); + message.entityMetrics = {}; + for (var keys = Object.keys(object.entityMetrics), i = 0; i < keys.length; ++i) { + if (typeof object.entityMetrics[keys[i]] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.entityMetrics: object expected"); + message.entityMetrics[keys[i]] = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.fromObject(object.entityMetrics[keys[i]]); + } + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyVersionName != null) + message.kmsKeyVersionName = String(object.kmsKeyVersionName); + if (object.revisions) { + if (!Array.isArray(object.revisions)) + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.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.v1beta3.Evaluation.revisions: object expected"); + message.revisions[i] = $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.fromObject(object.revisions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Evaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation} message Evaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Evaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.revisions = []; + if (options.objects || options.defaults) + object.entityMetrics = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.allEntitiesMetrics = null; + object.documentCounters = null; + object.kmsKeyName = ""; + object.kmsKeyVersionName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) + object.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.toObject(message.allEntitiesMetrics, options); + var keys2; + if (message.entityMetrics && (keys2 = Object.keys(message.entityMetrics)).length) { + object.entityMetrics = {}; + for (var j = 0; j < keys2.length; ++j) + object.entityMetrics[keys2[j]] = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.toObject(message.entityMetrics[keys2[j]], options); + } + if (message.documentCounters != null && message.hasOwnProperty("documentCounters")) + object.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.toObject(message.documentCounters, options); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + object.kmsKeyVersionName = message.kmsKeyVersionName; + if (message.revisions && message.revisions.length) { + object.revisions = []; + for (var j = 0; j < message.revisions.length; ++j) + object.revisions[j] = $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.toObject(message.revisions[j], options); + } + return object; + }; + + /** + * Converts this Evaluation to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @instance + * @returns {Object.} JSON object + */ + Evaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Evaluation + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Evaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation"; + }; + + Evaluation.Counters = (function() { + + /** + * Properties of a Counters. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @interface ICounters + * @property {number|null} [inputDocumentsCount] Counters inputDocumentsCount + * @property {number|null} [invalidDocumentsCount] Counters invalidDocumentsCount + * @property {number|null} [failedDocumentsCount] Counters failedDocumentsCount + * @property {number|null} [evaluatedDocumentsCount] Counters evaluatedDocumentsCount + */ + + /** + * Constructs a new Counters. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @classdesc Represents a Counters. + * @implements ICounters + * @constructor + * @param {google.cloud.documentai.v1beta3.Evaluation.ICounters=} [properties] Properties to set + */ + function Counters(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Counters inputDocumentsCount. + * @member {number} inputDocumentsCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @instance + */ + Counters.prototype.inputDocumentsCount = 0; + + /** + * Counters invalidDocumentsCount. + * @member {number} invalidDocumentsCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @instance + */ + Counters.prototype.invalidDocumentsCount = 0; + + /** + * Counters failedDocumentsCount. + * @member {number} failedDocumentsCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @instance + */ + Counters.prototype.failedDocumentsCount = 0; + + /** + * Counters evaluatedDocumentsCount. + * @member {number} evaluatedDocumentsCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @instance + */ + Counters.prototype.evaluatedDocumentsCount = 0; + + /** + * Creates a new Counters instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.ICounters=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Evaluation.Counters} Counters instance + */ + Counters.create = function create(properties) { + return new Counters(properties); + }; + + /** + * Encodes the specified Counters message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Counters.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.ICounters} message Counters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Counters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputDocumentsCount != null && Object.hasOwnProperty.call(message, "inputDocumentsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.inputDocumentsCount); + if (message.invalidDocumentsCount != null && Object.hasOwnProperty.call(message, "invalidDocumentsCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidDocumentsCount); + if (message.failedDocumentsCount != null && Object.hasOwnProperty.call(message, "failedDocumentsCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.failedDocumentsCount); + if (message.evaluatedDocumentsCount != null && Object.hasOwnProperty.call(message, "evaluatedDocumentsCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.evaluatedDocumentsCount); + return writer; + }; + + /** + * Encodes the specified Counters message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Counters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.ICounters} message Counters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Counters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Counters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Evaluation.Counters} Counters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Counters.decode = function decode(reader, 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.v1beta3.Evaluation.Counters(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputDocumentsCount = reader.int32(); + break; + } + case 2: { + message.invalidDocumentsCount = reader.int32(); + break; + } + case 3: { + message.failedDocumentsCount = reader.int32(); + break; + } + case 4: { + message.evaluatedDocumentsCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Counters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Evaluation.Counters} Counters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Counters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Counters message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Counters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputDocumentsCount != null && message.hasOwnProperty("inputDocumentsCount")) + if (!$util.isInteger(message.inputDocumentsCount)) + return "inputDocumentsCount: integer expected"; + if (message.invalidDocumentsCount != null && message.hasOwnProperty("invalidDocumentsCount")) + if (!$util.isInteger(message.invalidDocumentsCount)) + return "invalidDocumentsCount: integer expected"; + if (message.failedDocumentsCount != null && message.hasOwnProperty("failedDocumentsCount")) + if (!$util.isInteger(message.failedDocumentsCount)) + return "failedDocumentsCount: integer expected"; + if (message.evaluatedDocumentsCount != null && message.hasOwnProperty("evaluatedDocumentsCount")) + if (!$util.isInteger(message.evaluatedDocumentsCount)) + return "evaluatedDocumentsCount: integer expected"; + return null; + }; + + /** + * Creates a Counters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Evaluation.Counters} Counters + */ + Counters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.Counters) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Evaluation.Counters(); + if (object.inputDocumentsCount != null) + message.inputDocumentsCount = object.inputDocumentsCount | 0; + if (object.invalidDocumentsCount != null) + message.invalidDocumentsCount = object.invalidDocumentsCount | 0; + if (object.failedDocumentsCount != null) + message.failedDocumentsCount = object.failedDocumentsCount | 0; + if (object.evaluatedDocumentsCount != null) + message.evaluatedDocumentsCount = object.evaluatedDocumentsCount | 0; + return message; + }; + + /** + * Creates a plain object from a Counters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.Counters} message Counters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Counters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputDocumentsCount = 0; + object.invalidDocumentsCount = 0; + object.failedDocumentsCount = 0; + object.evaluatedDocumentsCount = 0; + } + if (message.inputDocumentsCount != null && message.hasOwnProperty("inputDocumentsCount")) + object.inputDocumentsCount = message.inputDocumentsCount; + if (message.invalidDocumentsCount != null && message.hasOwnProperty("invalidDocumentsCount")) + object.invalidDocumentsCount = message.invalidDocumentsCount; + if (message.failedDocumentsCount != null && message.hasOwnProperty("failedDocumentsCount")) + object.failedDocumentsCount = message.failedDocumentsCount; + if (message.evaluatedDocumentsCount != null && message.hasOwnProperty("evaluatedDocumentsCount")) + object.evaluatedDocumentsCount = message.evaluatedDocumentsCount; + return object; + }; + + /** + * Converts this Counters to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @instance + * @returns {Object.} JSON object + */ + Counters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Counters + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Counters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.Counters"; + }; + + return Counters; + })(); + + Evaluation.Metrics = (function() { + + /** + * Properties of a Metrics. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @interface IMetrics + * @property {number|null} [precision] Metrics precision + * @property {number|null} [recall] Metrics recall + * @property {number|null} [f1Score] Metrics f1Score + * @property {number|null} [predictedOccurrencesCount] Metrics predictedOccurrencesCount + * @property {number|null} [groundTruthOccurrencesCount] Metrics groundTruthOccurrencesCount + * @property {number|null} [predictedDocumentCount] Metrics predictedDocumentCount + * @property {number|null} [groundTruthDocumentCount] Metrics groundTruthDocumentCount + * @property {number|null} [truePositivesCount] Metrics truePositivesCount + * @property {number|null} [falsePositivesCount] Metrics falsePositivesCount + * @property {number|null} [falseNegativesCount] Metrics falseNegativesCount + * @property {number|null} [totalDocumentsCount] Metrics totalDocumentsCount + */ + + /** + * Constructs a new Metrics. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @classdesc Represents a Metrics. + * @implements IMetrics + * @constructor + * @param {google.cloud.documentai.v1beta3.Evaluation.IMetrics=} [properties] Properties to set + */ + function Metrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metrics precision. + * @member {number} precision + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @instance + */ + Metrics.prototype.precision = 0; + + /** + * Metrics recall. + * @member {number} recall + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @instance + */ + Metrics.prototype.recall = 0; + + /** + * Metrics f1Score. + * @member {number} f1Score + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @instance + */ + Metrics.prototype.f1Score = 0; + + /** + * Metrics predictedOccurrencesCount. + * @member {number} predictedOccurrencesCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @instance + */ + Metrics.prototype.predictedOccurrencesCount = 0; + + /** + * Metrics groundTruthOccurrencesCount. + * @member {number} groundTruthOccurrencesCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @instance + */ + Metrics.prototype.groundTruthOccurrencesCount = 0; + + /** + * Metrics predictedDocumentCount. + * @member {number} predictedDocumentCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @instance + */ + Metrics.prototype.predictedDocumentCount = 0; + + /** + * Metrics groundTruthDocumentCount. + * @member {number} groundTruthDocumentCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @instance + */ + Metrics.prototype.groundTruthDocumentCount = 0; + + /** + * Metrics truePositivesCount. + * @member {number} truePositivesCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @instance + */ + Metrics.prototype.truePositivesCount = 0; + + /** + * Metrics falsePositivesCount. + * @member {number} falsePositivesCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @instance + */ + Metrics.prototype.falsePositivesCount = 0; + + /** + * Metrics falseNegativesCount. + * @member {number} falseNegativesCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @instance + */ + Metrics.prototype.falseNegativesCount = 0; + + /** + * Metrics totalDocumentsCount. + * @member {number} totalDocumentsCount + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @instance + */ + Metrics.prototype.totalDocumentsCount = 0; + + /** + * Creates a new Metrics instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IMetrics=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Evaluation.Metrics} Metrics instance + */ + Metrics.create = function create(properties) { + return new Metrics(properties); + }; + + /** + * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Metrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IMetrics} message Metrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.precision); + if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); + if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.f1Score); + if (message.predictedOccurrencesCount != null && Object.hasOwnProperty.call(message, "predictedOccurrencesCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.predictedOccurrencesCount); + if (message.groundTruthOccurrencesCount != null && Object.hasOwnProperty.call(message, "groundTruthOccurrencesCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.groundTruthOccurrencesCount); + if (message.truePositivesCount != null && Object.hasOwnProperty.call(message, "truePositivesCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.truePositivesCount); + if (message.falsePositivesCount != null && Object.hasOwnProperty.call(message, "falsePositivesCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.falsePositivesCount); + if (message.falseNegativesCount != null && Object.hasOwnProperty.call(message, "falseNegativesCount")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.falseNegativesCount); + if (message.totalDocumentsCount != null && Object.hasOwnProperty.call(message, "totalDocumentsCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.totalDocumentsCount); + if (message.predictedDocumentCount != null && Object.hasOwnProperty.call(message, "predictedDocumentCount")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.predictedDocumentCount); + if (message.groundTruthDocumentCount != null && Object.hasOwnProperty.call(message, "groundTruthDocumentCount")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.groundTruthDocumentCount); + return writer; + }; + + /** + * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Metrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IMetrics} message Metrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Evaluation.Metrics} Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metrics.decode = function decode(reader, 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.v1beta3.Evaluation.Metrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.precision = reader.float(); + break; + } + case 2: { + message.recall = reader.float(); + break; + } + case 3: { + message.f1Score = reader.float(); + break; + } + case 4: { + message.predictedOccurrencesCount = reader.int32(); + break; + } + case 5: { + message.groundTruthOccurrencesCount = reader.int32(); + break; + } + case 10: { + message.predictedDocumentCount = reader.int32(); + break; + } + case 11: { + message.groundTruthDocumentCount = reader.int32(); + break; + } + case 6: { + message.truePositivesCount = reader.int32(); + break; + } + case 7: { + message.falsePositivesCount = reader.int32(); + break; + } + case 8: { + message.falseNegativesCount = reader.int32(); + break; + } + case 9: { + message.totalDocumentsCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Evaluation.Metrics} Metrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metrics message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.precision != null && message.hasOwnProperty("precision")) + if (typeof message.precision !== "number") + return "precision: number expected"; + if (message.recall != null && message.hasOwnProperty("recall")) + if (typeof message.recall !== "number") + return "recall: number expected"; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + if (typeof message.f1Score !== "number") + return "f1Score: number expected"; + if (message.predictedOccurrencesCount != null && message.hasOwnProperty("predictedOccurrencesCount")) + if (!$util.isInteger(message.predictedOccurrencesCount)) + return "predictedOccurrencesCount: integer expected"; + if (message.groundTruthOccurrencesCount != null && message.hasOwnProperty("groundTruthOccurrencesCount")) + if (!$util.isInteger(message.groundTruthOccurrencesCount)) + return "groundTruthOccurrencesCount: integer expected"; + if (message.predictedDocumentCount != null && message.hasOwnProperty("predictedDocumentCount")) + if (!$util.isInteger(message.predictedDocumentCount)) + return "predictedDocumentCount: integer expected"; + if (message.groundTruthDocumentCount != null && message.hasOwnProperty("groundTruthDocumentCount")) + if (!$util.isInteger(message.groundTruthDocumentCount)) + return "groundTruthDocumentCount: integer expected"; + if (message.truePositivesCount != null && message.hasOwnProperty("truePositivesCount")) + if (!$util.isInteger(message.truePositivesCount)) + return "truePositivesCount: integer expected"; + if (message.falsePositivesCount != null && message.hasOwnProperty("falsePositivesCount")) + if (!$util.isInteger(message.falsePositivesCount)) + return "falsePositivesCount: integer expected"; + if (message.falseNegativesCount != null && message.hasOwnProperty("falseNegativesCount")) + if (!$util.isInteger(message.falseNegativesCount)) + return "falseNegativesCount: integer expected"; + if (message.totalDocumentsCount != null && message.hasOwnProperty("totalDocumentsCount")) + if (!$util.isInteger(message.totalDocumentsCount)) + return "totalDocumentsCount: integer expected"; + return null; + }; + + /** + * Creates a Metrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Evaluation.Metrics} Metrics + */ + Metrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.Metrics) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Evaluation.Metrics(); + if (object.precision != null) + message.precision = Number(object.precision); + if (object.recall != null) + message.recall = Number(object.recall); + if (object.f1Score != null) + message.f1Score = Number(object.f1Score); + if (object.predictedOccurrencesCount != null) + message.predictedOccurrencesCount = object.predictedOccurrencesCount | 0; + if (object.groundTruthOccurrencesCount != null) + message.groundTruthOccurrencesCount = object.groundTruthOccurrencesCount | 0; + if (object.predictedDocumentCount != null) + message.predictedDocumentCount = object.predictedDocumentCount | 0; + if (object.groundTruthDocumentCount != null) + message.groundTruthDocumentCount = object.groundTruthDocumentCount | 0; + if (object.truePositivesCount != null) + message.truePositivesCount = object.truePositivesCount | 0; + if (object.falsePositivesCount != null) + message.falsePositivesCount = object.falsePositivesCount | 0; + if (object.falseNegativesCount != null) + message.falseNegativesCount = object.falseNegativesCount | 0; + if (object.totalDocumentsCount != null) + message.totalDocumentsCount = object.totalDocumentsCount | 0; + return message; + }; + + /** + * Creates a plain object from a Metrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.Metrics} message Metrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.precision = 0; + object.recall = 0; + object.f1Score = 0; + object.predictedOccurrencesCount = 0; + object.groundTruthOccurrencesCount = 0; + object.truePositivesCount = 0; + object.falsePositivesCount = 0; + object.falseNegativesCount = 0; + object.totalDocumentsCount = 0; + object.predictedDocumentCount = 0; + object.groundTruthDocumentCount = 0; + } + if (message.precision != null && message.hasOwnProperty("precision")) + object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; + if (message.recall != null && message.hasOwnProperty("recall")) + object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; + if (message.f1Score != null && message.hasOwnProperty("f1Score")) + object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; + if (message.predictedOccurrencesCount != null && message.hasOwnProperty("predictedOccurrencesCount")) + object.predictedOccurrencesCount = message.predictedOccurrencesCount; + if (message.groundTruthOccurrencesCount != null && message.hasOwnProperty("groundTruthOccurrencesCount")) + object.groundTruthOccurrencesCount = message.groundTruthOccurrencesCount; + if (message.truePositivesCount != null && message.hasOwnProperty("truePositivesCount")) + object.truePositivesCount = message.truePositivesCount; + if (message.falsePositivesCount != null && message.hasOwnProperty("falsePositivesCount")) + object.falsePositivesCount = message.falsePositivesCount; + if (message.falseNegativesCount != null && message.hasOwnProperty("falseNegativesCount")) + object.falseNegativesCount = message.falseNegativesCount; + if (message.totalDocumentsCount != null && message.hasOwnProperty("totalDocumentsCount")) + object.totalDocumentsCount = message.totalDocumentsCount; + if (message.predictedDocumentCount != null && message.hasOwnProperty("predictedDocumentCount")) + object.predictedDocumentCount = message.predictedDocumentCount; + if (message.groundTruthDocumentCount != null && message.hasOwnProperty("groundTruthDocumentCount")) + object.groundTruthDocumentCount = message.groundTruthDocumentCount; + return object; + }; + + /** + * Converts this Metrics to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @instance + * @returns {Object.} JSON object + */ + Metrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metrics + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.Metrics"; + }; + + return Metrics; + })(); + + Evaluation.ConfidenceLevelMetrics = (function() { + + /** + * Properties of a ConfidenceLevelMetrics. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @interface IConfidenceLevelMetrics + * @property {number|null} [confidenceLevel] ConfidenceLevelMetrics confidenceLevel + * @property {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null} [metrics] ConfidenceLevelMetrics metrics + */ + + /** + * Constructs a new ConfidenceLevelMetrics. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @classdesc Represents a ConfidenceLevelMetrics. + * @implements IConfidenceLevelMetrics + * @constructor + * @param {google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics=} [properties] Properties to set + */ + function ConfidenceLevelMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidenceLevelMetrics confidenceLevel. + * @member {number} confidenceLevel + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @instance + */ + ConfidenceLevelMetrics.prototype.confidenceLevel = 0; + + /** + * ConfidenceLevelMetrics metrics. + * @member {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null|undefined} metrics + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @instance + */ + ConfidenceLevelMetrics.prototype.metrics = null; + + /** + * Creates a new ConfidenceLevelMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics instance + */ + ConfidenceLevelMetrics.create = function create(properties) { + return new ConfidenceLevelMetrics(properties); + }; + + /** + * Encodes the specified ConfidenceLevelMetrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics} message ConfidenceLevelMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceLevelMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceLevel != null && Object.hasOwnProperty.call(message, "confidenceLevel")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceLevel); + if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) + $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.encode(message.metrics, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConfidenceLevelMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics} message ConfidenceLevelMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidenceLevelMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceLevelMetrics.decode = function decode(reader, 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.v1beta3.Evaluation.ConfidenceLevelMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.confidenceLevel = reader.float(); + break; + } + case 2: { + message.metrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidenceLevelMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidenceLevelMetrics message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidenceLevelMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceLevel != null && message.hasOwnProperty("confidenceLevel")) + if (typeof message.confidenceLevel !== "number") + return "confidenceLevel: number expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.verify(message.metrics); + if (error) + return "metrics." + error; + } + return null; + }; + + /** + * Creates a ConfidenceLevelMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics + */ + ConfidenceLevelMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics(); + if (object.confidenceLevel != null) + message.confidenceLevel = Number(object.confidenceLevel); + if (object.metrics != null) { + if (typeof object.metrics !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.metrics: object expected"); + message.metrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.fromObject(object.metrics); + } + return message; + }; + + /** + * Creates a plain object from a ConfidenceLevelMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics} message ConfidenceLevelMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidenceLevelMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.confidenceLevel = 0; + object.metrics = null; + } + if (message.confidenceLevel != null && message.hasOwnProperty("confidenceLevel")) + object.confidenceLevel = options.json && !isFinite(message.confidenceLevel) ? String(message.confidenceLevel) : message.confidenceLevel; + if (message.metrics != null && message.hasOwnProperty("metrics")) + object.metrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.toObject(message.metrics, options); + return object; + }; + + /** + * Converts this ConfidenceLevelMetrics to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @instance + * @returns {Object.} JSON object + */ + ConfidenceLevelMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidenceLevelMetrics + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidenceLevelMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics"; + }; + + return ConfidenceLevelMetrics; + })(); + + Evaluation.MultiConfidenceMetrics = (function() { + + /** + * Properties of a MultiConfidenceMetrics. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @interface IMultiConfidenceMetrics + * @property {Array.|null} [confidenceLevelMetrics] MultiConfidenceMetrics confidenceLevelMetrics + * @property {Array.|null} [confidenceLevelMetricsExact] MultiConfidenceMetrics confidenceLevelMetricsExact + * @property {number|null} [auprc] MultiConfidenceMetrics auprc + * @property {number|null} [estimatedCalibrationError] MultiConfidenceMetrics estimatedCalibrationError + * @property {number|null} [auprcExact] MultiConfidenceMetrics auprcExact + * @property {number|null} [estimatedCalibrationErrorExact] MultiConfidenceMetrics estimatedCalibrationErrorExact + * @property {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType|null} [metricsType] MultiConfidenceMetrics metricsType + */ + + /** + * Constructs a new MultiConfidenceMetrics. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @classdesc Represents a MultiConfidenceMetrics. + * @implements IMultiConfidenceMetrics + * @constructor + * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics=} [properties] Properties to set + */ + function MultiConfidenceMetrics(properties) { + this.confidenceLevelMetrics = []; + this.confidenceLevelMetricsExact = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiConfidenceMetrics confidenceLevelMetrics. + * @member {Array.} confidenceLevelMetrics + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.confidenceLevelMetrics = $util.emptyArray; + + /** + * MultiConfidenceMetrics confidenceLevelMetricsExact. + * @member {Array.} confidenceLevelMetricsExact + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.confidenceLevelMetricsExact = $util.emptyArray; + + /** + * MultiConfidenceMetrics auprc. + * @member {number} auprc + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.auprc = 0; + + /** + * MultiConfidenceMetrics estimatedCalibrationError. + * @member {number} estimatedCalibrationError + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.estimatedCalibrationError = 0; + + /** + * MultiConfidenceMetrics auprcExact. + * @member {number} auprcExact + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.auprcExact = 0; + + /** + * MultiConfidenceMetrics estimatedCalibrationErrorExact. + * @member {number} estimatedCalibrationErrorExact + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.estimatedCalibrationErrorExact = 0; + + /** + * MultiConfidenceMetrics metricsType. + * @member {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType} metricsType + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @instance + */ + MultiConfidenceMetrics.prototype.metricsType = 0; + + /** + * Creates a new MultiConfidenceMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics instance + */ + MultiConfidenceMetrics.create = function create(properties) { + return new MultiConfidenceMetrics(properties); + }; + + /** + * Encodes the specified MultiConfidenceMetrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics} message MultiConfidenceMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiConfidenceMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confidenceLevelMetrics != null && message.confidenceLevelMetrics.length) + for (var i = 0; i < message.confidenceLevelMetrics.length; ++i) + $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.encode(message.confidenceLevelMetrics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auprc != null && Object.hasOwnProperty.call(message, "auprc")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.auprc); + if (message.estimatedCalibrationError != null && Object.hasOwnProperty.call(message, "estimatedCalibrationError")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.estimatedCalibrationError); + if (message.confidenceLevelMetricsExact != null && message.confidenceLevelMetricsExact.length) + for (var i = 0; i < message.confidenceLevelMetricsExact.length; ++i) + $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.encode(message.confidenceLevelMetricsExact[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auprcExact != null && Object.hasOwnProperty.call(message, "auprcExact")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.auprcExact); + if (message.estimatedCalibrationErrorExact != null && Object.hasOwnProperty.call(message, "estimatedCalibrationErrorExact")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.estimatedCalibrationErrorExact); + if (message.metricsType != null && Object.hasOwnProperty.call(message, "metricsType")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.metricsType); + return writer; + }; + + /** + * Encodes the specified MultiConfidenceMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics} message MultiConfidenceMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiConfidenceMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiConfidenceMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiConfidenceMetrics.decode = function decode(reader, 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.v1beta3.Evaluation.MultiConfidenceMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.confidenceLevelMetrics && message.confidenceLevelMetrics.length)) + message.confidenceLevelMetrics = []; + message.confidenceLevelMetrics.push($root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.confidenceLevelMetricsExact && message.confidenceLevelMetricsExact.length)) + message.confidenceLevelMetricsExact = []; + message.confidenceLevelMetricsExact.push($root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.decode(reader, reader.uint32())); + break; + } + case 2: { + message.auprc = reader.float(); + break; + } + case 3: { + message.estimatedCalibrationError = reader.float(); + break; + } + case 5: { + message.auprcExact = reader.float(); + break; + } + case 6: { + message.estimatedCalibrationErrorExact = reader.float(); + break; + } + case 7: { + message.metricsType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiConfidenceMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiConfidenceMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiConfidenceMetrics message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiConfidenceMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.confidenceLevelMetrics != null && message.hasOwnProperty("confidenceLevelMetrics")) { + if (!Array.isArray(message.confidenceLevelMetrics)) + return "confidenceLevelMetrics: array expected"; + for (var i = 0; i < message.confidenceLevelMetrics.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.verify(message.confidenceLevelMetrics[i]); + if (error) + return "confidenceLevelMetrics." + error; + } + } + if (message.confidenceLevelMetricsExact != null && message.hasOwnProperty("confidenceLevelMetricsExact")) { + if (!Array.isArray(message.confidenceLevelMetricsExact)) + return "confidenceLevelMetricsExact: array expected"; + for (var i = 0; i < message.confidenceLevelMetricsExact.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.verify(message.confidenceLevelMetricsExact[i]); + if (error) + return "confidenceLevelMetricsExact." + error; + } + } + if (message.auprc != null && message.hasOwnProperty("auprc")) + if (typeof message.auprc !== "number") + return "auprc: number expected"; + if (message.estimatedCalibrationError != null && message.hasOwnProperty("estimatedCalibrationError")) + if (typeof message.estimatedCalibrationError !== "number") + return "estimatedCalibrationError: number expected"; + if (message.auprcExact != null && message.hasOwnProperty("auprcExact")) + if (typeof message.auprcExact !== "number") + return "auprcExact: number expected"; + if (message.estimatedCalibrationErrorExact != null && message.hasOwnProperty("estimatedCalibrationErrorExact")) + if (typeof message.estimatedCalibrationErrorExact !== "number") + return "estimatedCalibrationErrorExact: number expected"; + if (message.metricsType != null && message.hasOwnProperty("metricsType")) + switch (message.metricsType) { + default: + return "metricsType: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a MultiConfidenceMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics + */ + MultiConfidenceMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics(); + if (object.confidenceLevelMetrics) { + if (!Array.isArray(object.confidenceLevelMetrics)) + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.confidenceLevelMetrics: array expected"); + message.confidenceLevelMetrics = []; + for (var i = 0; i < object.confidenceLevelMetrics.length; ++i) { + if (typeof object.confidenceLevelMetrics[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.confidenceLevelMetrics: object expected"); + message.confidenceLevelMetrics[i] = $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.fromObject(object.confidenceLevelMetrics[i]); + } + } + if (object.confidenceLevelMetricsExact) { + if (!Array.isArray(object.confidenceLevelMetricsExact)) + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.confidenceLevelMetricsExact: array expected"); + message.confidenceLevelMetricsExact = []; + for (var i = 0; i < object.confidenceLevelMetricsExact.length; ++i) { + if (typeof object.confidenceLevelMetricsExact[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.confidenceLevelMetricsExact: object expected"); + message.confidenceLevelMetricsExact[i] = $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.fromObject(object.confidenceLevelMetricsExact[i]); + } + } + if (object.auprc != null) + message.auprc = Number(object.auprc); + if (object.estimatedCalibrationError != null) + message.estimatedCalibrationError = Number(object.estimatedCalibrationError); + if (object.auprcExact != null) + message.auprcExact = Number(object.auprcExact); + if (object.estimatedCalibrationErrorExact != null) + message.estimatedCalibrationErrorExact = Number(object.estimatedCalibrationErrorExact); + switch (object.metricsType) { + default: + if (typeof object.metricsType === "number") { + message.metricsType = object.metricsType; + break; + } + break; + case "METRICS_TYPE_UNSPECIFIED": + case 0: + message.metricsType = 0; + break; + case "AGGREGATE": + case 1: + message.metricsType = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a MultiConfidenceMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} message MultiConfidenceMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiConfidenceMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.confidenceLevelMetrics = []; + object.confidenceLevelMetricsExact = []; + } + if (options.defaults) { + object.auprc = 0; + object.estimatedCalibrationError = 0; + object.auprcExact = 0; + object.estimatedCalibrationErrorExact = 0; + object.metricsType = options.enums === String ? "METRICS_TYPE_UNSPECIFIED" : 0; + } + if (message.confidenceLevelMetrics && message.confidenceLevelMetrics.length) { + object.confidenceLevelMetrics = []; + for (var j = 0; j < message.confidenceLevelMetrics.length; ++j) + object.confidenceLevelMetrics[j] = $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.toObject(message.confidenceLevelMetrics[j], options); + } + if (message.auprc != null && message.hasOwnProperty("auprc")) + object.auprc = options.json && !isFinite(message.auprc) ? String(message.auprc) : message.auprc; + if (message.estimatedCalibrationError != null && message.hasOwnProperty("estimatedCalibrationError")) + object.estimatedCalibrationError = options.json && !isFinite(message.estimatedCalibrationError) ? String(message.estimatedCalibrationError) : message.estimatedCalibrationError; + if (message.confidenceLevelMetricsExact && message.confidenceLevelMetricsExact.length) { + object.confidenceLevelMetricsExact = []; + for (var j = 0; j < message.confidenceLevelMetricsExact.length; ++j) + object.confidenceLevelMetricsExact[j] = $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.toObject(message.confidenceLevelMetricsExact[j], options); + } + if (message.auprcExact != null && message.hasOwnProperty("auprcExact")) + object.auprcExact = options.json && !isFinite(message.auprcExact) ? String(message.auprcExact) : message.auprcExact; + if (message.estimatedCalibrationErrorExact != null && message.hasOwnProperty("estimatedCalibrationErrorExact")) + object.estimatedCalibrationErrorExact = options.json && !isFinite(message.estimatedCalibrationErrorExact) ? String(message.estimatedCalibrationErrorExact) : message.estimatedCalibrationErrorExact; + if (message.metricsType != null && message.hasOwnProperty("metricsType")) + object.metricsType = options.enums === String ? $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType[message.metricsType] === undefined ? message.metricsType : $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType[message.metricsType] : message.metricsType; + return object; + }; + + /** + * Converts this MultiConfidenceMetrics to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @instance + * @returns {Object.} JSON object + */ + MultiConfidenceMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiConfidenceMetrics + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiConfidenceMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics"; + }; + + /** + * MetricsType enum. + * @name google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType + * @enum {number} + * @property {number} METRICS_TYPE_UNSPECIFIED=0 METRICS_TYPE_UNSPECIFIED value + * @property {number} AGGREGATE=1 AGGREGATE value + */ + MultiConfidenceMetrics.MetricsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRICS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AGGREGATE"] = 1; + return values; + })(); + + return MultiConfidenceMetrics; + })(); + + Evaluation.EvaluationRevision = (function() { + + /** + * Properties of an EvaluationRevision. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @interface IEvaluationRevision + * @property {string|null} [revisionId] EvaluationRevision revisionId + * @property {google.cloud.documentai.v1beta3.Evaluation.ICounters|null} [documentCounters] EvaluationRevision documentCounters + * @property {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null} [allEntitiesMetrics] EvaluationRevision allEntitiesMetrics + * @property {Object.|null} [entityMetrics] EvaluationRevision entityMetrics + */ + + /** + * Constructs a new EvaluationRevision. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @classdesc Represents an EvaluationRevision. + * @implements IEvaluationRevision + * @constructor + * @param {google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision=} [properties] Properties to set + */ + function EvaluationRevision(properties) { + this.entityMetrics = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationRevision revisionId. + * @member {string} revisionId + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @instance + */ + EvaluationRevision.prototype.revisionId = ""; + + /** + * EvaluationRevision documentCounters. + * @member {google.cloud.documentai.v1beta3.Evaluation.ICounters|null|undefined} documentCounters + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @instance + */ + EvaluationRevision.prototype.documentCounters = null; + + /** + * EvaluationRevision allEntitiesMetrics. + * @member {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null|undefined} allEntitiesMetrics + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @instance + */ + EvaluationRevision.prototype.allEntitiesMetrics = null; + + /** + * EvaluationRevision entityMetrics. + * @member {Object.} entityMetrics + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @instance + */ + EvaluationRevision.prototype.entityMetrics = $util.emptyObject; + + /** + * Creates a new EvaluationRevision instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} EvaluationRevision instance + */ + EvaluationRevision.create = function create(properties) { + return new EvaluationRevision(properties); + }; + + /** + * Encodes the specified EvaluationRevision message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision} message EvaluationRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationRevision.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.documentCounters != null && Object.hasOwnProperty.call(message, "documentCounters")) + $root.google.cloud.documentai.v1beta3.Evaluation.Counters.encode(message.documentCounters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.allEntitiesMetrics != null && Object.hasOwnProperty.call(message, "allEntitiesMetrics")) + $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.encode(message.allEntitiesMetrics, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.entityMetrics != null && Object.hasOwnProperty.call(message, "entityMetrics")) + for (var keys = Object.keys(message.entityMetrics), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.encode(message.entityMetrics[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified EvaluationRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision} message EvaluationRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationRevision.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationRevision message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} EvaluationRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationRevision.decode = function decode(reader, 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.v1beta3.Evaluation.EvaluationRevision(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.revisionId = reader.string(); + break; + } + case 2: { + message.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.entityMetrics === $util.emptyObject) + message.entityMetrics = {}; + 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.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.entityMetrics[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationRevision message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} EvaluationRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationRevision.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationRevision message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationRevision.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.documentCounters != null && message.hasOwnProperty("documentCounters")) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.verify(message.documentCounters); + if (error) + return "documentCounters." + error; + } + if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify(message.allEntitiesMetrics); + if (error) + return "allEntitiesMetrics." + error; + } + if (message.entityMetrics != null && message.hasOwnProperty("entityMetrics")) { + if (!$util.isObject(message.entityMetrics)) + return "entityMetrics: object expected"; + var key = Object.keys(message.entityMetrics); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify(message.entityMetrics[key[i]]); + if (error) + return "entityMetrics." + error; + } + } + return null; + }; + + /** + * Creates an EvaluationRevision message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} EvaluationRevision + */ + EvaluationRevision.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision(); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.documentCounters != null) { + if (typeof object.documentCounters !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.documentCounters: object expected"); + message.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.fromObject(object.documentCounters); + } + if (object.allEntitiesMetrics != null) { + if (typeof object.allEntitiesMetrics !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.allEntitiesMetrics: object expected"); + message.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.fromObject(object.allEntitiesMetrics); + } + if (object.entityMetrics) { + if (typeof object.entityMetrics !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.entityMetrics: object expected"); + message.entityMetrics = {}; + for (var keys = Object.keys(object.entityMetrics), i = 0; i < keys.length; ++i) { + if (typeof object.entityMetrics[keys[i]] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.entityMetrics: object expected"); + message.entityMetrics[keys[i]] = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.fromObject(object.entityMetrics[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an EvaluationRevision message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} message EvaluationRevision + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationRevision.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.entityMetrics = {}; + if (options.defaults) { + object.revisionId = ""; + object.documentCounters = null; + object.allEntitiesMetrics = null; + } + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.documentCounters != null && message.hasOwnProperty("documentCounters")) + object.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.toObject(message.documentCounters, options); + if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) + object.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.toObject(message.allEntitiesMetrics, options); + var keys2; + if (message.entityMetrics && (keys2 = Object.keys(message.entityMetrics)).length) { + object.entityMetrics = {}; + for (var j = 0; j < keys2.length; ++j) + object.entityMetrics[keys2[j]] = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.toObject(message.entityMetrics[keys2[j]], options); + } + return object; + }; + + /** + * Converts this EvaluationRevision to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @instance + * @returns {Object.} JSON object + */ + EvaluationRevision.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationRevision + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationRevision.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision"; + }; + + return EvaluationRevision; + })(); + + return Evaluation; + })(); + + v1beta3.CommonOperationMetadata = (function() { + + /** + * Properties of a CommonOperationMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface ICommonOperationMetadata + * @property {google.cloud.documentai.v1beta3.CommonOperationMetadata.State|null} [state] CommonOperationMetadata state + * @property {string|null} [stateMessage] CommonOperationMetadata stateMessage + * @property {string|null} [resource] CommonOperationMetadata resource + * @property {google.protobuf.ITimestamp|null} [createTime] CommonOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CommonOperationMetadata updateTime + */ + + /** + * Constructs a new CommonOperationMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a CommonOperationMetadata. + * @implements ICommonOperationMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.ICommonOperationMetadata=} [properties] Properties to set + */ + function CommonOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonOperationMetadata state. + * @member {google.cloud.documentai.v1beta3.CommonOperationMetadata.State} state + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.state = 0; + + /** + * CommonOperationMetadata stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.stateMessage = ""; + + /** + * CommonOperationMetadata resource. + * @member {string} resource + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.resource = ""; + + /** + * CommonOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.createTime = null; + + /** + * CommonOperationMetadata updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @instance + */ + CommonOperationMetadata.prototype.updateTime = null; + + /** + * Creates a new CommonOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @static + * @param {google.cloud.documentai.v1beta3.ICommonOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.CommonOperationMetadata} CommonOperationMetadata instance + */ + CommonOperationMetadata.create = function create(properties) { + return new CommonOperationMetadata(properties); + }; + + /** + * Encodes the specified CommonOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.CommonOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @static + * @param {google.cloud.documentai.v1beta3.ICommonOperationMetadata} message CommonOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); + 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.resource); + return writer; + }; + + /** + * Encodes the specified CommonOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.CommonOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @static + * @param {google.cloud.documentai.v1beta3.ICommonOperationMetadata} message CommonOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.CommonOperationMetadata} CommonOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonOperationMetadata.decode = function decode(reader, 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.v1beta3.CommonOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.stateMessage = reader.string(); + break; + } + case 5: { + message.resource = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.CommonOperationMetadata} CommonOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonOperationMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a CommonOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.CommonOperationMetadata} CommonOperationMetadata + */ + CommonOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.CommonOperationMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.CommonOperationMetadata(); + 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 "RUNNING": + case 1: + message.state = 1; + break; + case "CANCELLING": + case 2: + message.state = 2; + break; + case "SUCCEEDED": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.resource != null) + message.resource = String(object.resource); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.CommonOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.CommonOperationMetadata.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a CommonOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @static + * @param {google.cloud.documentai.v1beta3.CommonOperationMetadata} message CommonOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.createTime = null; + object.updateTime = null; + object.resource = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + return object; + }; + + /** + * Converts this CommonOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CommonOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.CommonOperationMetadata"; + }; + + /** + * State enum. + * @name google.cloud.documentai.v1beta3.CommonOperationMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} CANCELLING=2 CANCELLING value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + * @property {number} CANCELLED=5 CANCELLED value + */ + CommonOperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "CANCELLING"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return CommonOperationMetadata; + })(); + + v1beta3.ProcessorVersion = (function() { + + /** + * Properties of a ProcessorVersion. + * @memberof google.cloud.documentai.v1beta3 + * @interface IProcessorVersion + * @property {string|null} [name] ProcessorVersion name + * @property {string|null} [displayName] ProcessorVersion displayName + * @property {google.cloud.documentai.v1beta3.IDocumentSchema|null} [documentSchema] ProcessorVersion documentSchema + * @property {google.cloud.documentai.v1beta3.ProcessorVersion.State|null} [state] ProcessorVersion state + * @property {google.protobuf.ITimestamp|null} [createTime] ProcessorVersion createTime + * @property {google.cloud.documentai.v1beta3.IEvaluationReference|null} [latestEvaluation] ProcessorVersion latestEvaluation + * @property {string|null} [kmsKeyName] ProcessorVersion kmsKeyName + * @property {string|null} [kmsKeyVersionName] ProcessorVersion kmsKeyVersionName + * @property {boolean|null} [googleManaged] ProcessorVersion googleManaged + * @property {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo|null} [deprecationInfo] ProcessorVersion deprecationInfo + * @property {google.cloud.documentai.v1beta3.ProcessorVersion.ModelType|null} [modelType] ProcessorVersion modelType + * @property {boolean|null} [satisfiesPzs] ProcessorVersion satisfiesPzs + * @property {boolean|null} [satisfiesPzi] ProcessorVersion satisfiesPzi + * @property {google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo|null} [genAiModelInfo] ProcessorVersion genAiModelInfo + */ + + /** + * Constructs a new ProcessorVersion. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ProcessorVersion. + * @implements IProcessorVersion + * @constructor + * @param {google.cloud.documentai.v1beta3.IProcessorVersion=} [properties] Properties to set + */ + function ProcessorVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessorVersion name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.name = ""; + + /** + * ProcessorVersion displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.displayName = ""; + + /** + * ProcessorVersion documentSchema. + * @member {google.cloud.documentai.v1beta3.IDocumentSchema|null|undefined} documentSchema + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.documentSchema = null; + + /** + * ProcessorVersion state. + * @member {google.cloud.documentai.v1beta3.ProcessorVersion.State} state + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.state = 0; + + /** + * ProcessorVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.createTime = null; + + /** + * ProcessorVersion latestEvaluation. + * @member {google.cloud.documentai.v1beta3.IEvaluationReference|null|undefined} latestEvaluation + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.latestEvaluation = null; + + /** + * ProcessorVersion kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.kmsKeyName = ""; + + /** + * ProcessorVersion kmsKeyVersionName. + * @member {string} kmsKeyVersionName + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.kmsKeyVersionName = ""; + + /** + * ProcessorVersion googleManaged. + * @member {boolean} googleManaged + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.googleManaged = false; + + /** + * ProcessorVersion deprecationInfo. + * @member {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo|null|undefined} deprecationInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.deprecationInfo = null; + + /** + * ProcessorVersion modelType. + * @member {google.cloud.documentai.v1beta3.ProcessorVersion.ModelType} modelType + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.modelType = 0; + + /** + * ProcessorVersion satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.satisfiesPzs = false; + + /** + * ProcessorVersion satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.satisfiesPzi = false; + + /** + * ProcessorVersion genAiModelInfo. + * @member {google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo|null|undefined} genAiModelInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + */ + ProcessorVersion.prototype.genAiModelInfo = null; + + /** + * Creates a new ProcessorVersion instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @static + * @param {google.cloud.documentai.v1beta3.IProcessorVersion=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion} ProcessorVersion instance + */ + ProcessorVersion.create = function create(properties) { + return new ProcessorVersion(properties); + }; + + /** + * Encodes the specified ProcessorVersion message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @static + * @param {google.cloud.documentai.v1beta3.IProcessorVersion} message ProcessorVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorVersion.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.latestEvaluation != null && Object.hasOwnProperty.call(message, "latestEvaluation")) + $root.google.cloud.documentai.v1beta3.EvaluationReference.encode(message.latestEvaluation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.kmsKeyName); + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.kmsKeyVersionName); + if (message.googleManaged != null && Object.hasOwnProperty.call(message, "googleManaged")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.googleManaged); + if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) + $root.google.cloud.documentai.v1beta3.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.deprecationInfo != null && Object.hasOwnProperty.call(message, "deprecationInfo")) + $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.encode(message.deprecationInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.modelType); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.satisfiesPzi); + if (message.genAiModelInfo != null && Object.hasOwnProperty.call(message, "genAiModelInfo")) + $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.encode(message.genAiModelInfo, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProcessorVersion message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @static + * @param {google.cloud.documentai.v1beta3.IProcessorVersion} message ProcessorVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessorVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion} ProcessorVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorVersion.decode = function decode(reader, 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.v1beta3.ProcessorVersion(); + 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 12: { + message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.latestEvaluation = $root.google.cloud.documentai.v1beta3.EvaluationReference.decode(reader, reader.uint32()); + break; + } + case 9: { + message.kmsKeyName = reader.string(); + break; + } + case 10: { + message.kmsKeyVersionName = reader.string(); + break; + } + case 11: { + message.googleManaged = reader.bool(); + break; + } + case 13: { + message.deprecationInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.decode(reader, reader.uint32()); + break; + } + case 15: { + message.modelType = reader.int32(); + break; + } + case 16: { + message.satisfiesPzs = reader.bool(); + break; + } + case 17: { + message.satisfiesPzi = reader.bool(); + break; + } + case 18: { + message.genAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessorVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion} ProcessorVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessorVersion message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessorVersion.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.documentSchema != null && message.hasOwnProperty("documentSchema")) { + var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.verify(message.documentSchema); + if (error) + return "documentSchema." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.latestEvaluation != null && message.hasOwnProperty("latestEvaluation")) { + var error = $root.google.cloud.documentai.v1beta3.EvaluationReference.verify(message.latestEvaluation); + if (error) + return "latestEvaluation." + error; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (!$util.isString(message.kmsKeyVersionName)) + return "kmsKeyVersionName: string expected"; + if (message.googleManaged != null && message.hasOwnProperty("googleManaged")) + if (typeof message.googleManaged !== "boolean") + return "googleManaged: boolean expected"; + if (message.deprecationInfo != null && message.hasOwnProperty("deprecationInfo")) { + var error = $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.verify(message.deprecationInfo); + if (error) + return "deprecationInfo." + error; + } + if (message.modelType != null && message.hasOwnProperty("modelType")) + switch (message.modelType) { + default: + return "modelType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + if (message.genAiModelInfo != null && message.hasOwnProperty("genAiModelInfo")) { + var error = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.verify(message.genAiModelInfo); + if (error) + return "genAiModelInfo." + error; + } + return null; + }; + + /** + * Creates a ProcessorVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion} ProcessorVersion + */ + ProcessorVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersion) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.documentSchema != null) { + if (typeof object.documentSchema !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.documentSchema: object expected"); + message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.fromObject(object.documentSchema); + } + 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 "DEPLOYED": + case 1: + message.state = 1; + break; + case "DEPLOYING": + case 2: + message.state = 2; + break; + case "UNDEPLOYED": + case 3: + message.state = 3; + break; + case "UNDEPLOYING": + case 4: + message.state = 4; + break; + case "CREATING": + case 5: + message.state = 5; + break; + case "DELETING": + case 6: + message.state = 6; + break; + case "FAILED": + case 7: + message.state = 7; + break; + case "IMPORTING": + case 8: + message.state = 8; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.latestEvaluation != null) { + if (typeof object.latestEvaluation !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.latestEvaluation: object expected"); + message.latestEvaluation = $root.google.cloud.documentai.v1beta3.EvaluationReference.fromObject(object.latestEvaluation); + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyVersionName != null) + message.kmsKeyVersionName = String(object.kmsKeyVersionName); + if (object.googleManaged != null) + message.googleManaged = Boolean(object.googleManaged); + if (object.deprecationInfo != null) { + if (typeof object.deprecationInfo !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.deprecationInfo: object expected"); + message.deprecationInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.fromObject(object.deprecationInfo); + } + switch (object.modelType) { + default: + if (typeof object.modelType === "number") { + message.modelType = object.modelType; + break; + } + break; + case "MODEL_TYPE_UNSPECIFIED": + case 0: + message.modelType = 0; + break; + case "MODEL_TYPE_GENERATIVE": + case 1: + message.modelType = 1; + break; + case "MODEL_TYPE_CUSTOM": + case 2: + message.modelType = 2; + break; + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + if (object.genAiModelInfo != null) { + if (typeof object.genAiModelInfo !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.genAiModelInfo: object expected"); + message.genAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.fromObject(object.genAiModelInfo); + } + return message; + }; + + /** + * Creates a plain object from a ProcessorVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion} message ProcessorVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessorVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.latestEvaluation = null; + object.kmsKeyName = ""; + object.kmsKeyVersionName = ""; + object.googleManaged = false; + object.documentSchema = null; + object.deprecationInfo = null; + object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; + object.satisfiesPzs = false; + object.satisfiesPzi = false; + object.genAiModelInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.ProcessorVersion.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.ProcessorVersion.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.latestEvaluation != null && message.hasOwnProperty("latestEvaluation")) + object.latestEvaluation = $root.google.cloud.documentai.v1beta3.EvaluationReference.toObject(message.latestEvaluation, options); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + object.kmsKeyVersionName = message.kmsKeyVersionName; + if (message.googleManaged != null && message.hasOwnProperty("googleManaged")) + object.googleManaged = message.googleManaged; + if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) + object.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.toObject(message.documentSchema, options); + if (message.deprecationInfo != null && message.hasOwnProperty("deprecationInfo")) + object.deprecationInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.toObject(message.deprecationInfo, options); + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = options.enums === String ? $root.google.cloud.documentai.v1beta3.ProcessorVersion.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.documentai.v1beta3.ProcessorVersion.ModelType[message.modelType] : message.modelType; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + if (message.genAiModelInfo != null && message.hasOwnProperty("genAiModelInfo")) + object.genAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.toObject(message.genAiModelInfo, options); + return object; + }; + + /** + * Converts this ProcessorVersion to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @instance + * @returns {Object.} JSON object + */ + ProcessorVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessorVersion + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessorVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion"; + }; + + ProcessorVersion.DeprecationInfo = (function() { + + /** + * Properties of a DeprecationInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @interface IDeprecationInfo + * @property {google.protobuf.ITimestamp|null} [deprecationTime] DeprecationInfo deprecationTime + * @property {string|null} [replacementProcessorVersion] DeprecationInfo replacementProcessorVersion + */ + + /** + * Constructs a new DeprecationInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @classdesc Represents a DeprecationInfo. + * @implements IDeprecationInfo + * @constructor + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo=} [properties] Properties to set + */ + function DeprecationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeprecationInfo deprecationTime. + * @member {google.protobuf.ITimestamp|null|undefined} deprecationTime + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @instance + */ + DeprecationInfo.prototype.deprecationTime = null; + + /** + * DeprecationInfo replacementProcessorVersion. + * @member {string} replacementProcessorVersion + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @instance + */ + DeprecationInfo.prototype.replacementProcessorVersion = ""; + + /** + * Creates a new DeprecationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo instance + */ + DeprecationInfo.create = function create(properties) { + return new DeprecationInfo(properties); + }; + + /** + * Encodes the specified DeprecationInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo} message DeprecationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeprecationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecationTime != null && Object.hasOwnProperty.call(message, "deprecationTime")) + $root.google.protobuf.Timestamp.encode(message.deprecationTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.replacementProcessorVersion != null && Object.hasOwnProperty.call(message, "replacementProcessorVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.replacementProcessorVersion); + return writer; + }; + + /** + * Encodes the specified DeprecationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo} message DeprecationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeprecationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeprecationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeprecationInfo.decode = function decode(reader, 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.v1beta3.ProcessorVersion.DeprecationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.replacementProcessorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeprecationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeprecationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeprecationInfo message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeprecationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecationTime != null && message.hasOwnProperty("deprecationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deprecationTime); + if (error) + return "deprecationTime." + error; + } + if (message.replacementProcessorVersion != null && message.hasOwnProperty("replacementProcessorVersion")) + if (!$util.isString(message.replacementProcessorVersion)) + return "replacementProcessorVersion: string expected"; + return null; + }; + + /** + * Creates a DeprecationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo + */ + DeprecationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo(); + if (object.deprecationTime != null) { + if (typeof object.deprecationTime !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.deprecationTime: object expected"); + message.deprecationTime = $root.google.protobuf.Timestamp.fromObject(object.deprecationTime); + } + if (object.replacementProcessorVersion != null) + message.replacementProcessorVersion = String(object.replacementProcessorVersion); + return message; + }; + + /** + * Creates a plain object from a DeprecationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} message DeprecationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeprecationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deprecationTime = null; + object.replacementProcessorVersion = ""; + } + if (message.deprecationTime != null && message.hasOwnProperty("deprecationTime")) + object.deprecationTime = $root.google.protobuf.Timestamp.toObject(message.deprecationTime, options); + if (message.replacementProcessorVersion != null && message.hasOwnProperty("replacementProcessorVersion")) + object.replacementProcessorVersion = message.replacementProcessorVersion; + return object; + }; + + /** + * Converts this DeprecationInfo to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @instance + * @returns {Object.} JSON object + */ + DeprecationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeprecationInfo + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeprecationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo"; + }; + + return DeprecationInfo; + })(); + + ProcessorVersion.GenAiModelInfo = (function() { + + /** + * Properties of a GenAiModelInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @interface IGenAiModelInfo + * @property {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null} [foundationGenAiModelInfo] GenAiModelInfo foundationGenAiModelInfo + * @property {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null} [customGenAiModelInfo] GenAiModelInfo customGenAiModelInfo + */ + + /** + * Constructs a new GenAiModelInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion + * @classdesc Represents a GenAiModelInfo. + * @implements IGenAiModelInfo + * @constructor + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo=} [properties] Properties to set + */ + function GenAiModelInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenAiModelInfo foundationGenAiModelInfo. + * @member {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null|undefined} foundationGenAiModelInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @instance + */ + GenAiModelInfo.prototype.foundationGenAiModelInfo = null; + + /** + * GenAiModelInfo customGenAiModelInfo. + * @member {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null|undefined} customGenAiModelInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @instance + */ + GenAiModelInfo.prototype.customGenAiModelInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenAiModelInfo modelInfo. + * @member {"foundationGenAiModelInfo"|"customGenAiModelInfo"|undefined} modelInfo + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @instance + */ + Object.defineProperty(GenAiModelInfo.prototype, "modelInfo", { + get: $util.oneOfGetter($oneOfFields = ["foundationGenAiModelInfo", "customGenAiModelInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenAiModelInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo} GenAiModelInfo instance + */ + GenAiModelInfo.create = function create(properties) { + return new GenAiModelInfo(properties); + }; + + /** + * Encodes the specified GenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo} message GenAiModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiModelInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.foundationGenAiModelInfo != null && Object.hasOwnProperty.call(message, "foundationGenAiModelInfo")) + $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.encode(message.foundationGenAiModelInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customGenAiModelInfo != null && Object.hasOwnProperty.call(message, "customGenAiModelInfo")) + $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.encode(message.customGenAiModelInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo} message GenAiModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenAiModelInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenAiModelInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo} GenAiModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiModelInfo.decode = function decode(reader, 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.v1beta3.ProcessorVersion.GenAiModelInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.foundationGenAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + message.customGenAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenAiModelInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo} GenAiModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenAiModelInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenAiModelInfo message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenAiModelInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.foundationGenAiModelInfo != null && message.hasOwnProperty("foundationGenAiModelInfo")) { + properties.modelInfo = 1; + { + var error = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify(message.foundationGenAiModelInfo); + if (error) + return "foundationGenAiModelInfo." + error; + } + } + if (message.customGenAiModelInfo != null && message.hasOwnProperty("customGenAiModelInfo")) { + if (properties.modelInfo === 1) + return "modelInfo: multiple values"; + properties.modelInfo = 1; + { + var error = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify(message.customGenAiModelInfo); + if (error) + return "customGenAiModelInfo." + error; + } + } + return null; + }; + + /** + * Creates a GenAiModelInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo} GenAiModelInfo + */ + GenAiModelInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo(); + if (object.foundationGenAiModelInfo != null) { + if (typeof object.foundationGenAiModelInfo !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.foundationGenAiModelInfo: object expected"); + message.foundationGenAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.fromObject(object.foundationGenAiModelInfo); + } + if (object.customGenAiModelInfo != null) { + if (typeof object.customGenAiModelInfo !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.customGenAiModelInfo: object expected"); + message.customGenAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.fromObject(object.customGenAiModelInfo); + } + return message; + }; + + /** + * Creates a plain object from a GenAiModelInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo} message GenAiModelInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenAiModelInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.foundationGenAiModelInfo != null && message.hasOwnProperty("foundationGenAiModelInfo")) { + object.foundationGenAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.toObject(message.foundationGenAiModelInfo, options); + if (options.oneofs) + object.modelInfo = "foundationGenAiModelInfo"; + } + if (message.customGenAiModelInfo != null && message.hasOwnProperty("customGenAiModelInfo")) { + object.customGenAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.toObject(message.customGenAiModelInfo, options); + if (options.oneofs) + object.modelInfo = "customGenAiModelInfo"; + } + return object; + }; + + /** + * Converts this GenAiModelInfo to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @instance + * @returns {Object.} JSON object + */ + GenAiModelInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenAiModelInfo + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenAiModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo"; + }; + + GenAiModelInfo.FoundationGenAiModelInfo = (function() { + + /** + * Properties of a FoundationGenAiModelInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @interface IFoundationGenAiModelInfo + * @property {boolean|null} [finetuningAllowed] FoundationGenAiModelInfo finetuningAllowed + * @property {number|null} [minTrainLabeledDocuments] FoundationGenAiModelInfo minTrainLabeledDocuments + */ + + /** + * Constructs a new FoundationGenAiModelInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @classdesc Represents a FoundationGenAiModelInfo. + * @implements IFoundationGenAiModelInfo + * @constructor + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo=} [properties] Properties to set + */ + function FoundationGenAiModelInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FoundationGenAiModelInfo finetuningAllowed. + * @member {boolean} finetuningAllowed + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @instance + */ + FoundationGenAiModelInfo.prototype.finetuningAllowed = false; + + /** + * FoundationGenAiModelInfo minTrainLabeledDocuments. + * @member {number} minTrainLabeledDocuments + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @instance + */ + FoundationGenAiModelInfo.prototype.minTrainLabeledDocuments = 0; + + /** + * Creates a new FoundationGenAiModelInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo instance + */ + FoundationGenAiModelInfo.create = function create(properties) { + return new FoundationGenAiModelInfo(properties); + }; + + /** + * Encodes the specified FoundationGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo} message FoundationGenAiModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FoundationGenAiModelInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.finetuningAllowed != null && Object.hasOwnProperty.call(message, "finetuningAllowed")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.finetuningAllowed); + if (message.minTrainLabeledDocuments != null && Object.hasOwnProperty.call(message, "minTrainLabeledDocuments")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minTrainLabeledDocuments); + return writer; + }; + + /** + * Encodes the specified FoundationGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo} message FoundationGenAiModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FoundationGenAiModelInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FoundationGenAiModelInfo.decode = function decode(reader, 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.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.finetuningAllowed = reader.bool(); + break; + } + case 2: { + message.minTrainLabeledDocuments = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FoundationGenAiModelInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FoundationGenAiModelInfo message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FoundationGenAiModelInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.finetuningAllowed != null && message.hasOwnProperty("finetuningAllowed")) + if (typeof message.finetuningAllowed !== "boolean") + return "finetuningAllowed: boolean expected"; + if (message.minTrainLabeledDocuments != null && message.hasOwnProperty("minTrainLabeledDocuments")) + if (!$util.isInteger(message.minTrainLabeledDocuments)) + return "minTrainLabeledDocuments: integer expected"; + return null; + }; + + /** + * Creates a FoundationGenAiModelInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo + */ + FoundationGenAiModelInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo(); + if (object.finetuningAllowed != null) + message.finetuningAllowed = Boolean(object.finetuningAllowed); + if (object.minTrainLabeledDocuments != null) + message.minTrainLabeledDocuments = object.minTrainLabeledDocuments | 0; + return message; + }; + + /** + * Creates a plain object from a FoundationGenAiModelInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} message FoundationGenAiModelInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FoundationGenAiModelInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.finetuningAllowed = false; + object.minTrainLabeledDocuments = 0; + } + if (message.finetuningAllowed != null && message.hasOwnProperty("finetuningAllowed")) + object.finetuningAllowed = message.finetuningAllowed; + if (message.minTrainLabeledDocuments != null && message.hasOwnProperty("minTrainLabeledDocuments")) + object.minTrainLabeledDocuments = message.minTrainLabeledDocuments; + return object; + }; + + /** + * Converts this FoundationGenAiModelInfo to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @instance + * @returns {Object.} JSON object + */ + FoundationGenAiModelInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FoundationGenAiModelInfo + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FoundationGenAiModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo"; + }; + + return FoundationGenAiModelInfo; + })(); + + GenAiModelInfo.CustomGenAiModelInfo = (function() { + + /** + * Properties of a CustomGenAiModelInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @interface ICustomGenAiModelInfo + * @property {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|null} [customModelType] CustomGenAiModelInfo customModelType + * @property {string|null} [baseProcessorVersionId] CustomGenAiModelInfo baseProcessorVersionId + */ + + /** + * Constructs a new CustomGenAiModelInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo + * @classdesc Represents a CustomGenAiModelInfo. + * @implements ICustomGenAiModelInfo + * @constructor + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo=} [properties] Properties to set + */ + function CustomGenAiModelInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomGenAiModelInfo customModelType. + * @member {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType} customModelType + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @instance + */ + CustomGenAiModelInfo.prototype.customModelType = 0; + + /** + * CustomGenAiModelInfo baseProcessorVersionId. + * @member {string} baseProcessorVersionId + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @instance + */ + CustomGenAiModelInfo.prototype.baseProcessorVersionId = ""; + + /** + * Creates a new CustomGenAiModelInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo instance + */ + CustomGenAiModelInfo.create = function create(properties) { + return new CustomGenAiModelInfo(properties); + }; + + /** + * Encodes the specified CustomGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo} message CustomGenAiModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomGenAiModelInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customModelType != null && Object.hasOwnProperty.call(message, "customModelType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.customModelType); + if (message.baseProcessorVersionId != null && Object.hasOwnProperty.call(message, "baseProcessorVersionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseProcessorVersionId); + return writer; + }; + + /** + * Encodes the specified CustomGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo} message CustomGenAiModelInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomGenAiModelInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomGenAiModelInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomGenAiModelInfo.decode = function decode(reader, 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.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.customModelType = reader.int32(); + break; + } + case 2: { + message.baseProcessorVersionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomGenAiModelInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomGenAiModelInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomGenAiModelInfo message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomGenAiModelInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customModelType != null && message.hasOwnProperty("customModelType")) + switch (message.customModelType) { + default: + return "customModelType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.baseProcessorVersionId != null && message.hasOwnProperty("baseProcessorVersionId")) + if (!$util.isString(message.baseProcessorVersionId)) + return "baseProcessorVersionId: string expected"; + return null; + }; + + /** + * Creates a CustomGenAiModelInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo + */ + CustomGenAiModelInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo(); + switch (object.customModelType) { + default: + if (typeof object.customModelType === "number") { + message.customModelType = object.customModelType; + break; + } + break; + case "CUSTOM_MODEL_TYPE_UNSPECIFIED": + case 0: + message.customModelType = 0; + break; + case "VERSIONED_FOUNDATION": + case 1: + message.customModelType = 1; + break; + case "FINE_TUNED": + case 2: + message.customModelType = 2; + break; + } + if (object.baseProcessorVersionId != null) + message.baseProcessorVersionId = String(object.baseProcessorVersionId); + return message; + }; + + /** + * Creates a plain object from a CustomGenAiModelInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} message CustomGenAiModelInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomGenAiModelInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customModelType = options.enums === String ? "CUSTOM_MODEL_TYPE_UNSPECIFIED" : 0; + object.baseProcessorVersionId = ""; + } + if (message.customModelType != null && message.hasOwnProperty("customModelType")) + object.customModelType = options.enums === String ? $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType[message.customModelType] === undefined ? message.customModelType : $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType[message.customModelType] : message.customModelType; + if (message.baseProcessorVersionId != null && message.hasOwnProperty("baseProcessorVersionId")) + object.baseProcessorVersionId = message.baseProcessorVersionId; + return object; + }; + + /** + * Converts this CustomGenAiModelInfo to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @instance + * @returns {Object.} JSON object + */ + CustomGenAiModelInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomGenAiModelInfo + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomGenAiModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo"; + }; + + /** + * CustomModelType enum. + * @name google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType + * @enum {number} + * @property {number} CUSTOM_MODEL_TYPE_UNSPECIFIED=0 CUSTOM_MODEL_TYPE_UNSPECIFIED value + * @property {number} VERSIONED_FOUNDATION=1 VERSIONED_FOUNDATION value + * @property {number} FINE_TUNED=2 FINE_TUNED value + */ + CustomGenAiModelInfo.CustomModelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CUSTOM_MODEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VERSIONED_FOUNDATION"] = 1; + values[valuesById[2] = "FINE_TUNED"] = 2; + return values; + })(); + + return CustomGenAiModelInfo; + })(); + + return GenAiModelInfo; + })(); + + /** + * State enum. + * @name google.cloud.documentai.v1beta3.ProcessorVersion.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} DEPLOYED=1 DEPLOYED value + * @property {number} DEPLOYING=2 DEPLOYING value + * @property {number} UNDEPLOYED=3 UNDEPLOYED value + * @property {number} UNDEPLOYING=4 UNDEPLOYING value + * @property {number} CREATING=5 CREATING value + * @property {number} DELETING=6 DELETING value + * @property {number} FAILED=7 FAILED value + * @property {number} IMPORTING=8 IMPORTING value + */ + ProcessorVersion.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEPLOYED"] = 1; + values[valuesById[2] = "DEPLOYING"] = 2; + values[valuesById[3] = "UNDEPLOYED"] = 3; + values[valuesById[4] = "UNDEPLOYING"] = 4; + values[valuesById[5] = "CREATING"] = 5; + values[valuesById[6] = "DELETING"] = 6; + values[valuesById[7] = "FAILED"] = 7; + values[valuesById[8] = "IMPORTING"] = 8; + return values; + })(); + + /** + * ModelType enum. + * @name google.cloud.documentai.v1beta3.ProcessorVersion.ModelType + * @enum {number} + * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value + * @property {number} MODEL_TYPE_GENERATIVE=1 MODEL_TYPE_GENERATIVE value + * @property {number} MODEL_TYPE_CUSTOM=2 MODEL_TYPE_CUSTOM value + */ + ProcessorVersion.ModelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODEL_TYPE_GENERATIVE"] = 1; + values[valuesById[2] = "MODEL_TYPE_CUSTOM"] = 2; + return values; + })(); + + return ProcessorVersion; + })(); + + v1beta3.ProcessorVersionAlias = (function() { + + /** + * Properties of a ProcessorVersionAlias. + * @memberof google.cloud.documentai.v1beta3 + * @interface IProcessorVersionAlias + * @property {string|null} [alias] ProcessorVersionAlias alias + * @property {string|null} [processorVersion] ProcessorVersionAlias processorVersion + */ + + /** + * Constructs a new ProcessorVersionAlias. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ProcessorVersionAlias. + * @implements IProcessorVersionAlias + * @constructor + * @param {google.cloud.documentai.v1beta3.IProcessorVersionAlias=} [properties] Properties to set + */ + function ProcessorVersionAlias(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessorVersionAlias alias. + * @member {string} alias + * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias + * @instance + */ + ProcessorVersionAlias.prototype.alias = ""; + + /** + * ProcessorVersionAlias processorVersion. + * @member {string} processorVersion + * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias + * @instance + */ + ProcessorVersionAlias.prototype.processorVersion = ""; + + /** + * Creates a new ProcessorVersionAlias instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias + * @static + * @param {google.cloud.documentai.v1beta3.IProcessorVersionAlias=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessorVersionAlias} ProcessorVersionAlias instance + */ + ProcessorVersionAlias.create = function create(properties) { + return new ProcessorVersionAlias(properties); + }; + + /** + * Encodes the specified ProcessorVersionAlias message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersionAlias.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias + * @static + * @param {google.cloud.documentai.v1beta3.IProcessorVersionAlias} message ProcessorVersionAlias message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorVersionAlias.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.alias); + if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.processorVersion); + return writer; + }; + + /** + * Encodes the specified ProcessorVersionAlias message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersionAlias.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias + * @static + * @param {google.cloud.documentai.v1beta3.IProcessorVersionAlias} message ProcessorVersionAlias message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorVersionAlias.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessorVersionAlias message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessorVersionAlias} ProcessorVersionAlias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorVersionAlias.decode = function decode(reader, 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.v1beta3.ProcessorVersionAlias(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.alias = reader.string(); + break; + } + case 2: { + message.processorVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessorVersionAlias message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessorVersionAlias} ProcessorVersionAlias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorVersionAlias.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessorVersionAlias message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessorVersionAlias.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.alias != null && message.hasOwnProperty("alias")) + if (!$util.isString(message.alias)) + return "alias: string expected"; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + if (!$util.isString(message.processorVersion)) + return "processorVersion: string expected"; + return null; + }; + + /** + * Creates a ProcessorVersionAlias message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessorVersionAlias} ProcessorVersionAlias + */ + ProcessorVersionAlias.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersionAlias) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersionAlias(); + if (object.alias != null) + message.alias = String(object.alias); + if (object.processorVersion != null) + message.processorVersion = String(object.processorVersion); + return message; + }; + + /** + * Creates a plain object from a ProcessorVersionAlias message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorVersionAlias} message ProcessorVersionAlias + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessorVersionAlias.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.alias = ""; + object.processorVersion = ""; + } + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = message.alias; + if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) + object.processorVersion = message.processorVersion; + return object; + }; + + /** + * Converts this ProcessorVersionAlias to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias + * @instance + * @returns {Object.} JSON object + */ + ProcessorVersionAlias.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessorVersionAlias + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessorVersionAlias.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersionAlias"; + }; + + return ProcessorVersionAlias; + })(); + + v1beta3.Processor = (function() { + + /** + * Properties of a Processor. + * @memberof google.cloud.documentai.v1beta3 + * @interface IProcessor + * @property {string|null} [name] Processor name + * @property {string|null} [type] Processor type + * @property {string|null} [displayName] Processor displayName + * @property {google.cloud.documentai.v1beta3.Processor.State|null} [state] Processor state + * @property {string|null} [defaultProcessorVersion] Processor defaultProcessorVersion + * @property {Array.|null} [processorVersionAliases] Processor processorVersionAliases + * @property {string|null} [processEndpoint] Processor processEndpoint + * @property {google.protobuf.ITimestamp|null} [createTime] Processor createTime + * @property {string|null} [kmsKeyName] Processor kmsKeyName + * @property {boolean|null} [satisfiesPzs] Processor satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Processor satisfiesPzi + */ + + /** + * Constructs a new Processor. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a Processor. + * @implements IProcessor + * @constructor + * @param {google.cloud.documentai.v1beta3.IProcessor=} [properties] Properties to set + */ + function Processor(properties) { + this.processorVersionAliases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Processor name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.Processor + * @instance + */ + Processor.prototype.name = ""; + + /** + * Processor type. + * @member {string} type + * @memberof google.cloud.documentai.v1beta3.Processor + * @instance + */ + Processor.prototype.type = ""; + + /** + * Processor displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1beta3.Processor + * @instance + */ + Processor.prototype.displayName = ""; + + /** + * Processor state. + * @member {google.cloud.documentai.v1beta3.Processor.State} state + * @memberof google.cloud.documentai.v1beta3.Processor + * @instance + */ + Processor.prototype.state = 0; + + /** + * Processor defaultProcessorVersion. + * @member {string} defaultProcessorVersion + * @memberof google.cloud.documentai.v1beta3.Processor + * @instance + */ + Processor.prototype.defaultProcessorVersion = ""; + + /** + * Processor processorVersionAliases. + * @member {Array.} processorVersionAliases + * @memberof google.cloud.documentai.v1beta3.Processor + * @instance + */ + Processor.prototype.processorVersionAliases = $util.emptyArray; + + /** + * Processor processEndpoint. + * @member {string} processEndpoint + * @memberof google.cloud.documentai.v1beta3.Processor + * @instance + */ + Processor.prototype.processEndpoint = ""; + + /** + * Processor createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.documentai.v1beta3.Processor + * @instance + */ + Processor.prototype.createTime = null; + + /** + * Processor kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.documentai.v1beta3.Processor + * @instance + */ + Processor.prototype.kmsKeyName = ""; + + /** + * Processor satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.documentai.v1beta3.Processor + * @instance + */ + Processor.prototype.satisfiesPzs = false; + + /** + * Processor satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.documentai.v1beta3.Processor + * @instance + */ + Processor.prototype.satisfiesPzi = false; + + /** + * Creates a new Processor instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Processor + * @static + * @param {google.cloud.documentai.v1beta3.IProcessor=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Processor} Processor instance + */ + Processor.create = function create(properties) { + return new Processor(properties); + }; + + /** + * Encodes the specified Processor message. Does not implicitly {@link google.cloud.documentai.v1beta3.Processor.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Processor + * @static + * @param {google.cloud.documentai.v1beta3.IProcessor} message Processor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Processor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.processEndpoint != null && Object.hasOwnProperty.call(message, "processEndpoint")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.processEndpoint); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.kmsKeyName); + if (message.defaultProcessorVersion != null && Object.hasOwnProperty.call(message, "defaultProcessorVersion")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.defaultProcessorVersion); + if (message.processorVersionAliases != null && message.processorVersionAliases.length) + for (var i = 0; i < message.processorVersionAliases.length; ++i) + $root.google.cloud.documentai.v1beta3.ProcessorVersionAlias.encode(message.processorVersionAliases[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.satisfiesPzi); + return writer; + }; + + /** + * Encodes the specified Processor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Processor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Processor + * @static + * @param {google.cloud.documentai.v1beta3.IProcessor} message Processor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Processor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Processor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Processor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Processor} Processor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Processor.decode = function decode(reader, 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.v1beta3.Processor(); + 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.type = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 9: { + message.defaultProcessorVersion = reader.string(); + break; + } + case 10: { + if (!(message.processorVersionAliases && message.processorVersionAliases.length)) + message.processorVersionAliases = []; + message.processorVersionAliases.push($root.google.cloud.documentai.v1beta3.ProcessorVersionAlias.decode(reader, reader.uint32())); + break; + } + case 6: { + message.processEndpoint = reader.string(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.kmsKeyName = reader.string(); + break; + } + case 12: { + message.satisfiesPzs = reader.bool(); + break; + } + case 13: { + message.satisfiesPzi = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Processor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Processor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Processor} Processor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Processor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Processor message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Processor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Processor.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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) + if (!$util.isString(message.defaultProcessorVersion)) + return "defaultProcessorVersion: string expected"; + if (message.processorVersionAliases != null && message.hasOwnProperty("processorVersionAliases")) { + if (!Array.isArray(message.processorVersionAliases)) + return "processorVersionAliases: array expected"; + for (var i = 0; i < message.processorVersionAliases.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.ProcessorVersionAlias.verify(message.processorVersionAliases[i]); + if (error) + return "processorVersionAliases." + error; + } + } + if (message.processEndpoint != null && message.hasOwnProperty("processEndpoint")) + if (!$util.isString(message.processEndpoint)) + return "processEndpoint: 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.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + return null; + }; + + /** + * Creates a Processor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Processor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Processor} Processor + */ + Processor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Processor) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Processor(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.displayName != null) + message.displayName = String(object.displayName); + 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 "ENABLED": + case 1: + message.state = 1; + break; + case "DISABLED": + case 2: + message.state = 2; + break; + case "ENABLING": + case 3: + message.state = 3; + break; + case "DISABLING": + case 4: + message.state = 4; + break; + case "CREATING": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "DELETING": + case 7: + message.state = 7; + break; + } + if (object.defaultProcessorVersion != null) + message.defaultProcessorVersion = String(object.defaultProcessorVersion); + if (object.processorVersionAliases) { + if (!Array.isArray(object.processorVersionAliases)) + throw TypeError(".google.cloud.documentai.v1beta3.Processor.processorVersionAliases: array expected"); + message.processorVersionAliases = []; + for (var i = 0; i < object.processorVersionAliases.length; ++i) { + if (typeof object.processorVersionAliases[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Processor.processorVersionAliases: object expected"); + message.processorVersionAliases[i] = $root.google.cloud.documentai.v1beta3.ProcessorVersionAlias.fromObject(object.processorVersionAliases[i]); + } + } + if (object.processEndpoint != null) + message.processEndpoint = String(object.processEndpoint); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Processor.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + return message; + }; + + /** + * Creates a plain object from a Processor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Processor + * @static + * @param {google.cloud.documentai.v1beta3.Processor} message Processor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Processor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.processorVersionAliases = []; + if (options.defaults) { + object.name = ""; + object.type = ""; + object.displayName = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.processEndpoint = ""; + object.createTime = null; + object.kmsKeyName = ""; + object.defaultProcessorVersion = ""; + object.satisfiesPzs = false; + object.satisfiesPzi = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.Processor.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.Processor.State[message.state] : message.state; + if (message.processEndpoint != null && message.hasOwnProperty("processEndpoint")) + object.processEndpoint = message.processEndpoint; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) + object.defaultProcessorVersion = message.defaultProcessorVersion; + if (message.processorVersionAliases && message.processorVersionAliases.length) { + object.processorVersionAliases = []; + for (var j = 0; j < message.processorVersionAliases.length; ++j) + object.processorVersionAliases[j] = $root.google.cloud.documentai.v1beta3.ProcessorVersionAlias.toObject(message.processorVersionAliases[j], options); + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + return object; + }; + + /** + * Converts this Processor to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Processor + * @instance + * @returns {Object.} JSON object + */ + Processor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Processor + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Processor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Processor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Processor"; + }; + + /** + * State enum. + * @name google.cloud.documentai.v1beta3.Processor.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + * @property {number} ENABLING=3 ENABLING value + * @property {number} DISABLING=4 DISABLING value + * @property {number} CREATING=5 CREATING value + * @property {number} FAILED=6 FAILED value + * @property {number} DELETING=7 DELETING value + */ + Processor.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "ENABLING"] = 3; + values[valuesById[4] = "DISABLING"] = 4; + values[valuesById[5] = "CREATING"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "DELETING"] = 7; + return values; + })(); + + return Processor; + })(); + + v1beta3.ProcessorType = (function() { + + /** + * Properties of a ProcessorType. + * @memberof google.cloud.documentai.v1beta3 + * @interface IProcessorType + * @property {string|null} [name] ProcessorType name + * @property {string|null} [type] ProcessorType type + * @property {string|null} [category] ProcessorType category + * @property {Array.|null} [availableLocations] ProcessorType availableLocations + * @property {boolean|null} [allowCreation] ProcessorType allowCreation + * @property {google.api.LaunchStage|null} [launchStage] ProcessorType launchStage + * @property {Array.|null} [sampleDocumentUris] ProcessorType sampleDocumentUris + */ + + /** + * Constructs a new ProcessorType. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ProcessorType. + * @implements IProcessorType + * @constructor + * @param {google.cloud.documentai.v1beta3.IProcessorType=} [properties] Properties to set + */ + function ProcessorType(properties) { + this.availableLocations = []; + this.sampleDocumentUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessorType name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @instance + */ + ProcessorType.prototype.name = ""; + + /** + * ProcessorType type. + * @member {string} type + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @instance + */ + ProcessorType.prototype.type = ""; + + /** + * ProcessorType category. + * @member {string} category + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @instance + */ + ProcessorType.prototype.category = ""; + + /** + * ProcessorType availableLocations. + * @member {Array.} availableLocations + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @instance + */ + ProcessorType.prototype.availableLocations = $util.emptyArray; + + /** + * ProcessorType allowCreation. + * @member {boolean} allowCreation + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @instance + */ + ProcessorType.prototype.allowCreation = false; + + /** + * ProcessorType launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @instance + */ + ProcessorType.prototype.launchStage = 0; + + /** + * ProcessorType sampleDocumentUris. + * @member {Array.} sampleDocumentUris + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @instance + */ + ProcessorType.prototype.sampleDocumentUris = $util.emptyArray; + + /** + * Creates a new ProcessorType instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @static + * @param {google.cloud.documentai.v1beta3.IProcessorType=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType instance + */ + ProcessorType.create = function create(properties) { + return new ProcessorType(properties); + }; + + /** + * Encodes the specified ProcessorType message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @static + * @param {google.cloud.documentai.v1beta3.IProcessorType} message ProcessorType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.category); + if (message.availableLocations != null && message.availableLocations.length) + for (var i = 0; i < message.availableLocations.length; ++i) + $root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.encode(message.availableLocations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allowCreation != null && Object.hasOwnProperty.call(message, "allowCreation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowCreation); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.launchStage); + if (message.sampleDocumentUris != null && message.sampleDocumentUris.length) + for (var i = 0; i < message.sampleDocumentUris.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.sampleDocumentUris[i]); + return writer; + }; + + /** + * Encodes the specified ProcessorType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @static + * @param {google.cloud.documentai.v1beta3.IProcessorType} message ProcessorType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessorType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessorType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorType.decode = function decode(reader, 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.v1beta3.ProcessorType(); + 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.type = reader.string(); + break; + } + case 3: { + message.category = reader.string(); + break; + } + case 4: { + if (!(message.availableLocations && message.availableLocations.length)) + message.availableLocations = []; + message.availableLocations.push($root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.decode(reader, reader.uint32())); + break; + } + case 6: { + message.allowCreation = reader.bool(); + break; + } + case 8: { + message.launchStage = reader.int32(); + break; + } + case 9: { + if (!(message.sampleDocumentUris && message.sampleDocumentUris.length)) + message.sampleDocumentUris = []; + message.sampleDocumentUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessorType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessorType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessorType message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessorType.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.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.availableLocations != null && message.hasOwnProperty("availableLocations")) { + if (!Array.isArray(message.availableLocations)) + return "availableLocations: array expected"; + for (var i = 0; i < message.availableLocations.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.verify(message.availableLocations[i]); + if (error) + return "availableLocations." + error; + } + } + if (message.allowCreation != null && message.hasOwnProperty("allowCreation")) + if (typeof message.allowCreation !== "boolean") + return "allowCreation: boolean 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.sampleDocumentUris != null && message.hasOwnProperty("sampleDocumentUris")) { + if (!Array.isArray(message.sampleDocumentUris)) + return "sampleDocumentUris: array expected"; + for (var i = 0; i < message.sampleDocumentUris.length; ++i) + if (!$util.isString(message.sampleDocumentUris[i])) + return "sampleDocumentUris: string[] expected"; + } + return null; + }; + + /** + * Creates a ProcessorType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType + */ + ProcessorType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorType) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessorType(); + if (object.name != null) + message.name = String(object.name); + if (object.type != null) + message.type = String(object.type); + if (object.category != null) + message.category = String(object.category); + if (object.availableLocations) { + if (!Array.isArray(object.availableLocations)) + throw TypeError(".google.cloud.documentai.v1beta3.ProcessorType.availableLocations: array expected"); + message.availableLocations = []; + for (var i = 0; i < object.availableLocations.length; ++i) { + if (typeof object.availableLocations[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ProcessorType.availableLocations: object expected"); + message.availableLocations[i] = $root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.fromObject(object.availableLocations[i]); + } + } + if (object.allowCreation != null) + message.allowCreation = Boolean(object.allowCreation); + 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.sampleDocumentUris) { + if (!Array.isArray(object.sampleDocumentUris)) + throw TypeError(".google.cloud.documentai.v1beta3.ProcessorType.sampleDocumentUris: array expected"); + message.sampleDocumentUris = []; + for (var i = 0; i < object.sampleDocumentUris.length; ++i) + message.sampleDocumentUris[i] = String(object.sampleDocumentUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a ProcessorType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorType} message ProcessorType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessorType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.availableLocations = []; + object.sampleDocumentUris = []; + } + if (options.defaults) { + object.name = ""; + object.type = ""; + object.category = ""; + object.allowCreation = false; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.availableLocations && message.availableLocations.length) { + object.availableLocations = []; + for (var j = 0; j < message.availableLocations.length; ++j) + object.availableLocations[j] = $root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.toObject(message.availableLocations[j], options); + } + if (message.allowCreation != null && message.hasOwnProperty("allowCreation")) + object.allowCreation = message.allowCreation; + 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.sampleDocumentUris && message.sampleDocumentUris.length) { + object.sampleDocumentUris = []; + for (var j = 0; j < message.sampleDocumentUris.length; ++j) + object.sampleDocumentUris[j] = message.sampleDocumentUris[j]; + } + return object; + }; + + /** + * Converts this ProcessorType to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @instance + * @returns {Object.} JSON object + */ + ProcessorType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessorType + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessorType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorType"; + }; + + ProcessorType.LocationInfo = (function() { + + /** + * Properties of a LocationInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @interface ILocationInfo + * @property {string|null} [locationId] LocationInfo locationId + */ + + /** + * Constructs a new LocationInfo. + * @memberof google.cloud.documentai.v1beta3.ProcessorType + * @classdesc Represents a LocationInfo. + * @implements ILocationInfo + * @constructor + * @param {google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo=} [properties] Properties to set + */ + function LocationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationInfo locationId. + * @member {string} locationId + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + * @instance + */ + LocationInfo.prototype.locationId = ""; + + /** + * Creates a new LocationInfo instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} LocationInfo instance + */ + LocationInfo.create = function create(properties) { + return new LocationInfo(properties); + }; + + /** + * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo} message LocationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.decode = function decode(reader, 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.v1beta3.ProcessorType.LocationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.locationId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} LocationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationInfo message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} LocationInfo + */ + LocationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo(); + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + * @static + * @param {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} message LocationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.locationId = ""; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this LocationInfo to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + * @instance + * @returns {Object.} JSON object + */ + LocationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationInfo + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorType.LocationInfo"; + }; + + return LocationInfo; + })(); + + return ProcessorType; + })(); + + v1beta3.DocumentService = (function() { + + /** + * Constructs a new DocumentService service. + * @memberof google.cloud.documentai.v1beta3 + * @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.documentai.v1beta3.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.documentai.v1beta3.DocumentService|updateDataset}. + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @typedef UpdateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.updateDataset = function updateDataset(request, callback) { + return this.rpcCall(updateDataset, $root.google.cloud.documentai.v1beta3.UpdateDatasetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDataset" }); + + /** + * Calls UpdateDataset. + * @function updateDataset + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|importDocuments}. + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @typedef ImportDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportDocuments. + * @function importDocuments + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IImportDocumentsRequest} request ImportDocumentsRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentService.ImportDocumentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.importDocuments = function importDocuments(request, callback) { + return this.rpcCall(importDocuments, $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportDocuments" }); + + /** + * Calls ImportDocuments. + * @function importDocuments + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IImportDocumentsRequest} request ImportDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|getDocument}. + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @typedef GetDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.GetDocumentResponse} [response] GetDocumentResponse + */ + + /** + * Calls GetDocument. + * @function getDocument + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IGetDocumentRequest} request GetDocumentRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentService.GetDocumentCallback} callback Node-style callback called with the error, if any, and GetDocumentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.getDocument = function getDocument(request, callback) { + return this.rpcCall(getDocument, $root.google.cloud.documentai.v1beta3.GetDocumentRequest, $root.google.cloud.documentai.v1beta3.GetDocumentResponse, request, callback); + }, "name", { value: "GetDocument" }); + + /** + * Calls GetDocument. + * @function getDocument + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IGetDocumentRequest} request GetDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|listDocuments}. + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @typedef ListDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.ListDocumentsResponse} [response] ListDocumentsResponse + */ + + /** + * Calls ListDocuments. + * @function listDocuments + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IListDocumentsRequest} request ListDocumentsRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentService.ListDocumentsCallback} callback Node-style callback called with the error, if any, and ListDocumentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.listDocuments = function listDocuments(request, callback) { + return this.rpcCall(listDocuments, $root.google.cloud.documentai.v1beta3.ListDocumentsRequest, $root.google.cloud.documentai.v1beta3.ListDocumentsResponse, request, callback); + }, "name", { value: "ListDocuments" }); + + /** + * Calls ListDocuments. + * @function listDocuments + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IListDocumentsRequest} request ListDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|batchDeleteDocuments}. + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @typedef BatchDeleteDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchDeleteDocuments. + * @function batchDeleteDocuments + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest} request BatchDeleteDocumentsRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentService.BatchDeleteDocumentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.batchDeleteDocuments = function batchDeleteDocuments(request, callback) { + return this.rpcCall(batchDeleteDocuments, $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchDeleteDocuments" }); + + /** + * Calls BatchDeleteDocuments. + * @function batchDeleteDocuments + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest} request BatchDeleteDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|getDatasetSchema}. + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @typedef GetDatasetSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.DatasetSchema} [response] DatasetSchema + */ + + /** + * Calls GetDatasetSchema. + * @function getDatasetSchema + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest} request GetDatasetSchemaRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentService.GetDatasetSchemaCallback} callback Node-style callback called with the error, if any, and DatasetSchema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.getDatasetSchema = function getDatasetSchema(request, callback) { + return this.rpcCall(getDatasetSchema, $root.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest, $root.google.cloud.documentai.v1beta3.DatasetSchema, request, callback); + }, "name", { value: "GetDatasetSchema" }); + + /** + * Calls GetDatasetSchema. + * @function getDatasetSchema + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest} request GetDatasetSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|updateDatasetSchema}. + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @typedef UpdateDatasetSchemaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.documentai.v1beta3.DatasetSchema} [response] DatasetSchema + */ + + /** + * Calls UpdateDatasetSchema. + * @function updateDatasetSchema + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest} request UpdateDatasetSchemaRequest message or plain object + * @param {google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetSchemaCallback} callback Node-style callback called with the error, if any, and DatasetSchema + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DocumentService.prototype.updateDatasetSchema = function updateDatasetSchema(request, callback) { + return this.rpcCall(updateDatasetSchema, $root.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest, $root.google.cloud.documentai.v1beta3.DatasetSchema, request, callback); + }, "name", { value: "UpdateDatasetSchema" }); + + /** + * Calls UpdateDatasetSchema. + * @function updateDatasetSchema + * @memberof google.cloud.documentai.v1beta3.DocumentService + * @instance + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest} request UpdateDatasetSchemaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DocumentService; + })(); + + /** + * DatasetSplitType enum. + * @name google.cloud.documentai.v1beta3.DatasetSplitType + * @enum {number} + * @property {number} DATASET_SPLIT_TYPE_UNSPECIFIED=0 DATASET_SPLIT_TYPE_UNSPECIFIED value + * @property {number} DATASET_SPLIT_TRAIN=1 DATASET_SPLIT_TRAIN value + * @property {number} DATASET_SPLIT_TEST=2 DATASET_SPLIT_TEST value + * @property {number} DATASET_SPLIT_UNASSIGNED=3 DATASET_SPLIT_UNASSIGNED value + */ + v1beta3.DatasetSplitType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DATASET_SPLIT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DATASET_SPLIT_TRAIN"] = 1; + values[valuesById[2] = "DATASET_SPLIT_TEST"] = 2; + values[valuesById[3] = "DATASET_SPLIT_UNASSIGNED"] = 3; + return values; + })(); + + /** + * DocumentLabelingState enum. + * @name google.cloud.documentai.v1beta3.DocumentLabelingState + * @enum {number} + * @property {number} DOCUMENT_LABELING_STATE_UNSPECIFIED=0 DOCUMENT_LABELING_STATE_UNSPECIFIED value + * @property {number} DOCUMENT_LABELED=1 DOCUMENT_LABELED value + * @property {number} DOCUMENT_UNLABELED=2 DOCUMENT_UNLABELED value + * @property {number} DOCUMENT_AUTO_LABELED=3 DOCUMENT_AUTO_LABELED value + */ + v1beta3.DocumentLabelingState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_LABELING_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DOCUMENT_LABELED"] = 1; + values[valuesById[2] = "DOCUMENT_UNLABELED"] = 2; + values[valuesById[3] = "DOCUMENT_AUTO_LABELED"] = 3; + return values; + })(); + + v1beta3.UpdateDatasetRequest = (function() { + + /** + * Properties of an UpdateDatasetRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IUpdateDatasetRequest + * @property {google.cloud.documentai.v1beta3.IDataset|null} [dataset] UpdateDatasetRequest dataset + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatasetRequest updateMask + */ + + /** + * Constructs a new UpdateDatasetRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an UpdateDatasetRequest. + * @implements IUpdateDatasetRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetRequest=} [properties] Properties to set + */ + function UpdateDatasetRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatasetRequest dataset. + * @member {google.cloud.documentai.v1beta3.IDataset|null|undefined} dataset + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest + * @instance + */ + UpdateDatasetRequest.prototype.dataset = null; + + /** + * UpdateDatasetRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest + * @instance + */ + UpdateDatasetRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetRequest} UpdateDatasetRequest instance + */ + UpdateDatasetRequest.create = function create(properties) { + return new UpdateDatasetRequest(properties); + }; + + /** + * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.documentai.v1beta3.Dataset.encode(message.dataset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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(); + return writer; + }; + + /** + * Encodes the specified UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetRequest} UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetRequest.decode = function decode(reader, 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.v1beta3.UpdateDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataset = $root.google.cloud.documentai.v1beta3.Dataset.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetRequest} UpdateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatasetRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatasetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.cloud.documentai.v1beta3.Dataset.verify(message.dataset); + if (error) + return "dataset." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetRequest} UpdateDatasetRequest + */ + UpdateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.UpdateDatasetRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.UpdateDatasetRequest(); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.UpdateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.documentai.v1beta3.Dataset.fromObject(object.dataset); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.UpdateDatasetRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest + * @static + * @param {google.cloud.documentai.v1beta3.UpdateDatasetRequest} message UpdateDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = null; + object.updateMask = null; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.cloud.documentai.v1beta3.Dataset.toObject(message.dataset, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UpdateDatasetRequest"; + }; + + return UpdateDatasetRequest; + })(); + + v1beta3.UpdateDatasetOperationMetadata = (function() { + + /** + * Properties of an UpdateDatasetOperationMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IUpdateDatasetOperationMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] UpdateDatasetOperationMetadata commonMetadata + */ + + /** + * Constructs a new UpdateDatasetOperationMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an UpdateDatasetOperationMetadata. + * @implements IUpdateDatasetOperationMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata=} [properties] Properties to set + */ + function UpdateDatasetOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatasetOperationMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + * @instance + */ + UpdateDatasetOperationMetadata.prototype.commonMetadata = null; + + /** + * Creates a new UpdateDatasetOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} UpdateDatasetOperationMetadata instance + */ + UpdateDatasetOperationMetadata.create = function create(properties) { + return new UpdateDatasetOperationMetadata(properties); + }; + + /** + * Encodes the specified UpdateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata} message UpdateDatasetOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata} message UpdateDatasetOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatasetOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} UpdateDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetOperationMetadata.decode = function decode(reader, 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.v1beta3.UpdateDatasetOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDatasetOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} UpdateDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatasetOperationMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatasetOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates an UpdateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} UpdateDatasetOperationMetadata + */ + UpdateDatasetOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatasetOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + * @static + * @param {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} message UpdateDatasetOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatasetOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this UpdateDatasetOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateDatasetOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatasetOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatasetOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata"; + }; + + return UpdateDatasetOperationMetadata; + })(); + + v1beta3.ImportDocumentsRequest = (function() { + + /** + * Properties of an ImportDocumentsRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IImportDocumentsRequest + * @property {string|null} [dataset] ImportDocumentsRequest dataset + * @property {Array.|null} [batchDocumentsImportConfigs] ImportDocumentsRequest batchDocumentsImportConfigs + */ + + /** + * Constructs a new ImportDocumentsRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an ImportDocumentsRequest. + * @implements IImportDocumentsRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IImportDocumentsRequest=} [properties] Properties to set + */ + function ImportDocumentsRequest(properties) { + this.batchDocumentsImportConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDocumentsRequest dataset. + * @member {string} dataset + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.dataset = ""; + + /** + * ImportDocumentsRequest batchDocumentsImportConfigs. + * @member {Array.} batchDocumentsImportConfigs + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.batchDocumentsImportConfigs = $util.emptyArray; + + /** + * Creates a new ImportDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IImportDocumentsRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest} ImportDocumentsRequest instance + */ + ImportDocumentsRequest.create = function create(properties) { + return new ImportDocumentsRequest(properties); + }; + + /** + * Encodes the specified ImportDocumentsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IImportDocumentsRequest} message ImportDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.batchDocumentsImportConfigs != null && message.batchDocumentsImportConfigs.length) + for (var i = 0; i < message.batchDocumentsImportConfigs.length; ++i) + $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.encode(message.batchDocumentsImportConfigs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IImportDocumentsRequest} message ImportDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest} ImportDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsRequest.decode = function decode(reader, 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.v1beta3.ImportDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 4: { + if (!(message.batchDocumentsImportConfigs && message.batchDocumentsImportConfigs.length)) + message.batchDocumentsImportConfigs = []; + message.batchDocumentsImportConfigs.push($root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest} ImportDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDocumentsRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.batchDocumentsImportConfigs != null && message.hasOwnProperty("batchDocumentsImportConfigs")) { + if (!Array.isArray(message.batchDocumentsImportConfigs)) + return "batchDocumentsImportConfigs: array expected"; + for (var i = 0; i < message.batchDocumentsImportConfigs.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.verify(message.batchDocumentsImportConfigs[i]); + if (error) + return "batchDocumentsImportConfigs." + error; + } + } + return null; + }; + + /** + * Creates an ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest} ImportDocumentsRequest + */ + ImportDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.batchDocumentsImportConfigs) { + if (!Array.isArray(object.batchDocumentsImportConfigs)) + throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsRequest.batchDocumentsImportConfigs: array expected"); + message.batchDocumentsImportConfigs = []; + for (var i = 0; i < object.batchDocumentsImportConfigs.length; ++i) { + if (typeof object.batchDocumentsImportConfigs[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsRequest.batchDocumentsImportConfigs: object expected"); + message.batchDocumentsImportConfigs[i] = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.fromObject(object.batchDocumentsImportConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest} message ImportDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.batchDocumentsImportConfigs = []; + if (options.defaults) + object.dataset = ""; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.batchDocumentsImportConfigs && message.batchDocumentsImportConfigs.length) { + object.batchDocumentsImportConfigs = []; + for (var j = 0; j < message.batchDocumentsImportConfigs.length; ++j) + object.batchDocumentsImportConfigs[j] = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.toObject(message.batchDocumentsImportConfigs[j], options); + } + return object; + }; + + /** + * Converts this ImportDocumentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDocumentsRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsRequest"; + }; + + ImportDocumentsRequest.BatchDocumentsImportConfig = (function() { + + /** + * Properties of a BatchDocumentsImportConfig. + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @interface IBatchDocumentsImportConfig + * @property {google.cloud.documentai.v1beta3.DatasetSplitType|null} [datasetSplit] BatchDocumentsImportConfig datasetSplit + * @property {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig|null} [autoSplitConfig] BatchDocumentsImportConfig autoSplitConfig + * @property {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null} [batchInputConfig] BatchDocumentsImportConfig batchInputConfig + * @property {string|null} [documentType] BatchDocumentsImportConfig documentType + */ + + /** + * Constructs a new BatchDocumentsImportConfig. + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest + * @classdesc Represents a BatchDocumentsImportConfig. + * @implements IBatchDocumentsImportConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig=} [properties] Properties to set + */ + function BatchDocumentsImportConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDocumentsImportConfig datasetSplit. + * @member {google.cloud.documentai.v1beta3.DatasetSplitType|null|undefined} datasetSplit + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @instance + */ + BatchDocumentsImportConfig.prototype.datasetSplit = null; + + /** + * BatchDocumentsImportConfig autoSplitConfig. + * @member {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig|null|undefined} autoSplitConfig + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @instance + */ + BatchDocumentsImportConfig.prototype.autoSplitConfig = null; + + /** + * BatchDocumentsImportConfig batchInputConfig. + * @member {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null|undefined} batchInputConfig + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @instance + */ + BatchDocumentsImportConfig.prototype.batchInputConfig = null; + + /** + * BatchDocumentsImportConfig documentType. + * @member {string} documentType + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @instance + */ + BatchDocumentsImportConfig.prototype.documentType = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchDocumentsImportConfig splitTypeConfig. + * @member {"datasetSplit"|"autoSplitConfig"|undefined} splitTypeConfig + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @instance + */ + Object.defineProperty(BatchDocumentsImportConfig.prototype, "splitTypeConfig", { + get: $util.oneOfGetter($oneOfFields = ["datasetSplit", "autoSplitConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchDocumentsImportConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig} BatchDocumentsImportConfig instance + */ + BatchDocumentsImportConfig.create = function create(properties) { + return new BatchDocumentsImportConfig(properties); + }; + + /** + * Encodes the specified BatchDocumentsImportConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig} message BatchDocumentsImportConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDocumentsImportConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.batchInputConfig != null && Object.hasOwnProperty.call(message, "batchInputConfig")) + $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.encode(message.batchInputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.datasetSplit != null && Object.hasOwnProperty.call(message, "datasetSplit")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.datasetSplit); + if (message.autoSplitConfig != null && Object.hasOwnProperty.call(message, "autoSplitConfig")) + $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.encode(message.autoSplitConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.documentType); + return writer; + }; + + /** + * Encodes the specified BatchDocumentsImportConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig} message BatchDocumentsImportConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDocumentsImportConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDocumentsImportConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig} BatchDocumentsImportConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDocumentsImportConfig.decode = function decode(reader, 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.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.datasetSplit = reader.int32(); + break; + } + case 3: { + message.autoSplitConfig = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.decode(reader, reader.uint32()); + break; + } + case 1: { + message.batchInputConfig = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.documentType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDocumentsImportConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig} BatchDocumentsImportConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDocumentsImportConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDocumentsImportConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDocumentsImportConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.datasetSplit != null && message.hasOwnProperty("datasetSplit")) { + properties.splitTypeConfig = 1; + switch (message.datasetSplit) { + default: + return "datasetSplit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.autoSplitConfig != null && message.hasOwnProperty("autoSplitConfig")) { + if (properties.splitTypeConfig === 1) + return "splitTypeConfig: multiple values"; + properties.splitTypeConfig = 1; + { + var error = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.verify(message.autoSplitConfig); + if (error) + return "autoSplitConfig." + error; + } + } + if (message.batchInputConfig != null && message.hasOwnProperty("batchInputConfig")) { + var error = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify(message.batchInputConfig); + if (error) + return "batchInputConfig." + error; + } + if (message.documentType != null && message.hasOwnProperty("documentType")) + if (!$util.isString(message.documentType)) + return "documentType: string expected"; + return null; + }; + + /** + * Creates a BatchDocumentsImportConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig} BatchDocumentsImportConfig + */ + BatchDocumentsImportConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig(); + switch (object.datasetSplit) { + default: + if (typeof object.datasetSplit === "number") { + message.datasetSplit = object.datasetSplit; + break; + } + break; + case "DATASET_SPLIT_TYPE_UNSPECIFIED": + case 0: + message.datasetSplit = 0; + break; + case "DATASET_SPLIT_TRAIN": + case 1: + message.datasetSplit = 1; + break; + case "DATASET_SPLIT_TEST": + case 2: + message.datasetSplit = 2; + break; + case "DATASET_SPLIT_UNASSIGNED": + case 3: + message.datasetSplit = 3; + break; + } + if (object.autoSplitConfig != null) { + if (typeof object.autoSplitConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.autoSplitConfig: object expected"); + message.autoSplitConfig = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.fromObject(object.autoSplitConfig); + } + if (object.batchInputConfig != null) { + if (typeof object.batchInputConfig !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.batchInputConfig: object expected"); + message.batchInputConfig = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.fromObject(object.batchInputConfig); + } + if (object.documentType != null) + message.documentType = String(object.documentType); + return message; + }; + + /** + * Creates a plain object from a BatchDocumentsImportConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig} message BatchDocumentsImportConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDocumentsImportConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.batchInputConfig = null; + object.documentType = ""; + } + if (message.batchInputConfig != null && message.hasOwnProperty("batchInputConfig")) + object.batchInputConfig = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.toObject(message.batchInputConfig, options); + if (message.datasetSplit != null && message.hasOwnProperty("datasetSplit")) { + object.datasetSplit = options.enums === String ? $root.google.cloud.documentai.v1beta3.DatasetSplitType[message.datasetSplit] === undefined ? message.datasetSplit : $root.google.cloud.documentai.v1beta3.DatasetSplitType[message.datasetSplit] : message.datasetSplit; + if (options.oneofs) + object.splitTypeConfig = "datasetSplit"; + } + if (message.autoSplitConfig != null && message.hasOwnProperty("autoSplitConfig")) { + object.autoSplitConfig = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.toObject(message.autoSplitConfig, options); + if (options.oneofs) + object.splitTypeConfig = "autoSplitConfig"; + } + if (message.documentType != null && message.hasOwnProperty("documentType")) + object.documentType = message.documentType; + return object; + }; + + /** + * Converts this BatchDocumentsImportConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @instance + * @returns {Object.} JSON object + */ + BatchDocumentsImportConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDocumentsImportConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDocumentsImportConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig"; + }; + + BatchDocumentsImportConfig.AutoSplitConfig = (function() { + + /** + * Properties of an AutoSplitConfig. + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @interface IAutoSplitConfig + * @property {number|null} [trainingSplitRatio] AutoSplitConfig trainingSplitRatio + */ + + /** + * Constructs a new AutoSplitConfig. + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @classdesc Represents an AutoSplitConfig. + * @implements IAutoSplitConfig + * @constructor + * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig=} [properties] Properties to set + */ + function AutoSplitConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoSplitConfig trainingSplitRatio. + * @member {number} trainingSplitRatio + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig + * @instance + */ + AutoSplitConfig.prototype.trainingSplitRatio = 0; + + /** + * Creates a new AutoSplitConfig instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig} AutoSplitConfig instance + */ + AutoSplitConfig.create = function create(properties) { + return new AutoSplitConfig(properties); + }; + + /** + * Encodes the specified AutoSplitConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig} message AutoSplitConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoSplitConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trainingSplitRatio != null && Object.hasOwnProperty.call(message, "trainingSplitRatio")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.trainingSplitRatio); + return writer; + }; + + /** + * Encodes the specified AutoSplitConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig} message AutoSplitConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoSplitConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoSplitConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig} AutoSplitConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoSplitConfig.decode = function decode(reader, 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.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.trainingSplitRatio = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoSplitConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig} AutoSplitConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoSplitConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoSplitConfig message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoSplitConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trainingSplitRatio != null && message.hasOwnProperty("trainingSplitRatio")) + if (typeof message.trainingSplitRatio !== "number") + return "trainingSplitRatio: number expected"; + return null; + }; + + /** + * Creates an AutoSplitConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig} AutoSplitConfig + */ + AutoSplitConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig(); + if (object.trainingSplitRatio != null) + message.trainingSplitRatio = Number(object.trainingSplitRatio); + return message; + }; + + /** + * Creates a plain object from an AutoSplitConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig} message AutoSplitConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoSplitConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.trainingSplitRatio = 0; + if (message.trainingSplitRatio != null && message.hasOwnProperty("trainingSplitRatio")) + object.trainingSplitRatio = options.json && !isFinite(message.trainingSplitRatio) ? String(message.trainingSplitRatio) : message.trainingSplitRatio; + return object; + }; + + /** + * Converts this AutoSplitConfig to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig + * @instance + * @returns {Object.} JSON object + */ + AutoSplitConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoSplitConfig + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoSplitConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig"; + }; + + return AutoSplitConfig; + })(); + + return BatchDocumentsImportConfig; + })(); + + return ImportDocumentsRequest; + })(); + + v1beta3.ImportDocumentsResponse = (function() { + + /** + * Properties of an ImportDocumentsResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IImportDocumentsResponse + */ + + /** + * Constructs a new ImportDocumentsResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an ImportDocumentsResponse. + * @implements IImportDocumentsResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IImportDocumentsResponse=} [properties] Properties to set + */ + function ImportDocumentsResponse(properties) { + if (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 ImportDocumentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IImportDocumentsResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsResponse} ImportDocumentsResponse instance + */ + ImportDocumentsResponse.create = function create(properties) { + return new ImportDocumentsResponse(properties); + }; + + /** + * Encodes the specified ImportDocumentsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IImportDocumentsResponse} message ImportDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ImportDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IImportDocumentsResponse} message ImportDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsResponse} ImportDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsResponse.decode = function decode(reader, 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.v1beta3.ImportDocumentsResponse(); + 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 ImportDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsResponse} ImportDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDocumentsResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ImportDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsResponse} ImportDocumentsResponse + */ + ImportDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsResponse) + return object; + return new $root.google.cloud.documentai.v1beta3.ImportDocumentsResponse(); + }; + + /** + * Creates a plain object from an ImportDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsResponse} message ImportDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDocumentsResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImportDocumentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + ImportDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDocumentsResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsResponse"; + }; + + return ImportDocumentsResponse; + })(); + + v1beta3.ImportDocumentsMetadata = (function() { + + /** + * Properties of an ImportDocumentsMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IImportDocumentsMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] ImportDocumentsMetadata commonMetadata + * @property {Array.|null} [individualImportStatuses] ImportDocumentsMetadata individualImportStatuses + * @property {Array.|null} [importConfigValidationResults] ImportDocumentsMetadata importConfigValidationResults + * @property {number|null} [totalDocumentCount] ImportDocumentsMetadata totalDocumentCount + */ + + /** + * Constructs a new ImportDocumentsMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an ImportDocumentsMetadata. + * @implements IImportDocumentsMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IImportDocumentsMetadata=} [properties] Properties to set + */ + function ImportDocumentsMetadata(properties) { + this.individualImportStatuses = []; + this.importConfigValidationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDocumentsMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.commonMetadata = null; + + /** + * ImportDocumentsMetadata individualImportStatuses. + * @member {Array.} individualImportStatuses + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.individualImportStatuses = $util.emptyArray; + + /** + * ImportDocumentsMetadata importConfigValidationResults. + * @member {Array.} importConfigValidationResults + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.importConfigValidationResults = $util.emptyArray; + + /** + * ImportDocumentsMetadata totalDocumentCount. + * @member {number} totalDocumentCount + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.totalDocumentCount = 0; + + /** + * Creates a new ImportDocumentsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IImportDocumentsMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata} ImportDocumentsMetadata instance + */ + ImportDocumentsMetadata.create = function create(properties) { + return new ImportDocumentsMetadata(properties); + }; + + /** + * Encodes the specified ImportDocumentsMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IImportDocumentsMetadata} message ImportDocumentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.individualImportStatuses != null && message.individualImportStatuses.length) + for (var i = 0; i < message.individualImportStatuses.length; ++i) + $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.encode(message.individualImportStatuses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalDocumentCount != null && Object.hasOwnProperty.call(message, "totalDocumentCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalDocumentCount); + if (message.importConfigValidationResults != null && message.importConfigValidationResults.length) + for (var i = 0; i < message.importConfigValidationResults.length; ++i) + $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.encode(message.importConfigValidationResults[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IImportDocumentsMetadata} message ImportDocumentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDocumentsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDocumentsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata} ImportDocumentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsMetadata.decode = function decode(reader, 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.v1beta3.ImportDocumentsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.individualImportStatuses && message.individualImportStatuses.length)) + message.individualImportStatuses = []; + message.individualImportStatuses.push($root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.importConfigValidationResults && message.importConfigValidationResults.length)) + message.importConfigValidationResults = []; + message.importConfigValidationResults.push($root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.totalDocumentCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDocumentsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata} ImportDocumentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDocumentsMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDocumentsMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + if (message.individualImportStatuses != null && message.hasOwnProperty("individualImportStatuses")) { + if (!Array.isArray(message.individualImportStatuses)) + return "individualImportStatuses: array expected"; + for (var i = 0; i < message.individualImportStatuses.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.verify(message.individualImportStatuses[i]); + if (error) + return "individualImportStatuses." + error; + } + } + if (message.importConfigValidationResults != null && message.hasOwnProperty("importConfigValidationResults")) { + if (!Array.isArray(message.importConfigValidationResults)) + return "importConfigValidationResults: array expected"; + for (var i = 0; i < message.importConfigValidationResults.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.verify(message.importConfigValidationResults[i]); + if (error) + return "importConfigValidationResults." + error; + } + } + if (message.totalDocumentCount != null && message.hasOwnProperty("totalDocumentCount")) + if (!$util.isInteger(message.totalDocumentCount)) + return "totalDocumentCount: integer expected"; + return null; + }; + + /** + * Creates an ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata} ImportDocumentsMetadata + */ + ImportDocumentsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + if (object.individualImportStatuses) { + if (!Array.isArray(object.individualImportStatuses)) + throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.individualImportStatuses: array expected"); + message.individualImportStatuses = []; + for (var i = 0; i < object.individualImportStatuses.length; ++i) { + if (typeof object.individualImportStatuses[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.individualImportStatuses: object expected"); + message.individualImportStatuses[i] = $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.fromObject(object.individualImportStatuses[i]); + } + } + if (object.importConfigValidationResults) { + if (!Array.isArray(object.importConfigValidationResults)) + throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.importConfigValidationResults: array expected"); + message.importConfigValidationResults = []; + for (var i = 0; i < object.importConfigValidationResults.length; ++i) { + if (typeof object.importConfigValidationResults[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.importConfigValidationResults: object expected"); + message.importConfigValidationResults[i] = $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.fromObject(object.importConfigValidationResults[i]); + } + } + if (object.totalDocumentCount != null) + message.totalDocumentCount = object.totalDocumentCount | 0; + return message; + }; + + /** + * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata} message ImportDocumentsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDocumentsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.individualImportStatuses = []; + object.importConfigValidationResults = []; + } + if (options.defaults) { + object.commonMetadata = null; + object.totalDocumentCount = 0; + } + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + if (message.individualImportStatuses && message.individualImportStatuses.length) { + object.individualImportStatuses = []; + for (var j = 0; j < message.individualImportStatuses.length; ++j) + object.individualImportStatuses[j] = $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.toObject(message.individualImportStatuses[j], options); + } + if (message.totalDocumentCount != null && message.hasOwnProperty("totalDocumentCount")) + object.totalDocumentCount = message.totalDocumentCount; + if (message.importConfigValidationResults && message.importConfigValidationResults.length) { + object.importConfigValidationResults = []; + for (var j = 0; j < message.importConfigValidationResults.length; ++j) + object.importConfigValidationResults[j] = $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.toObject(message.importConfigValidationResults[j], options); + } + return object; + }; + + /** + * Converts this ImportDocumentsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportDocumentsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDocumentsMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDocumentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsMetadata"; + }; + + ImportDocumentsMetadata.IndividualImportStatus = (function() { + + /** + * Properties of an IndividualImportStatus. + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @interface IIndividualImportStatus + * @property {string|null} [inputGcsSource] IndividualImportStatus inputGcsSource + * @property {google.rpc.IStatus|null} [status] IndividualImportStatus status + * @property {google.cloud.documentai.v1beta3.IDocumentId|null} [outputDocumentId] IndividualImportStatus outputDocumentId + */ + + /** + * Constructs a new IndividualImportStatus. + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @classdesc Represents an IndividualImportStatus. + * @implements IIndividualImportStatus + * @constructor + * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus=} [properties] Properties to set + */ + function IndividualImportStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndividualImportStatus inputGcsSource. + * @member {string} inputGcsSource + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @instance + */ + IndividualImportStatus.prototype.inputGcsSource = ""; + + /** + * IndividualImportStatus status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @instance + */ + IndividualImportStatus.prototype.status = null; + + /** + * IndividualImportStatus outputDocumentId. + * @member {google.cloud.documentai.v1beta3.IDocumentId|null|undefined} outputDocumentId + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @instance + */ + IndividualImportStatus.prototype.outputDocumentId = null; + + /** + * Creates a new IndividualImportStatus instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus} IndividualImportStatus instance + */ + IndividualImportStatus.create = function create(properties) { + return new IndividualImportStatus(properties); + }; + + /** + * Encodes the specified IndividualImportStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus} message IndividualImportStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualImportStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputGcsSource != null && Object.hasOwnProperty.call(message, "inputGcsSource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputGcsSource); + 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(); + if (message.outputDocumentId != null && Object.hasOwnProperty.call(message, "outputDocumentId")) + $root.google.cloud.documentai.v1beta3.DocumentId.encode(message.outputDocumentId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IndividualImportStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus} message IndividualImportStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualImportStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndividualImportStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus} IndividualImportStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualImportStatus.decode = function decode(reader, 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.v1beta3.ImportDocumentsMetadata.IndividualImportStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputGcsSource = reader.string(); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 4: { + message.outputDocumentId = $root.google.cloud.documentai.v1beta3.DocumentId.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndividualImportStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus} IndividualImportStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualImportStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndividualImportStatus message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndividualImportStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) + if (!$util.isString(message.inputGcsSource)) + return "inputGcsSource: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + if (message.outputDocumentId != null && message.hasOwnProperty("outputDocumentId")) { + var error = $root.google.cloud.documentai.v1beta3.DocumentId.verify(message.outputDocumentId); + if (error) + return "outputDocumentId." + error; + } + return null; + }; + + /** + * Creates an IndividualImportStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus} IndividualImportStatus + */ + IndividualImportStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus(); + if (object.inputGcsSource != null) + message.inputGcsSource = String(object.inputGcsSource); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + if (object.outputDocumentId != null) { + if (typeof object.outputDocumentId !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.outputDocumentId: object expected"); + message.outputDocumentId = $root.google.cloud.documentai.v1beta3.DocumentId.fromObject(object.outputDocumentId); + } + return message; + }; + + /** + * Creates a plain object from an IndividualImportStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus} message IndividualImportStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndividualImportStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputGcsSource = ""; + object.status = null; + object.outputDocumentId = null; + } + if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) + object.inputGcsSource = message.inputGcsSource; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.outputDocumentId != null && message.hasOwnProperty("outputDocumentId")) + object.outputDocumentId = $root.google.cloud.documentai.v1beta3.DocumentId.toObject(message.outputDocumentId, options); + return object; + }; + + /** + * Converts this IndividualImportStatus to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @instance + * @returns {Object.} JSON object + */ + IndividualImportStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndividualImportStatus + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndividualImportStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus"; + }; + + return IndividualImportStatus; + })(); + + ImportDocumentsMetadata.ImportConfigValidationResult = (function() { + + /** + * Properties of an ImportConfigValidationResult. + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @interface IImportConfigValidationResult + * @property {string|null} [inputGcsSource] ImportConfigValidationResult inputGcsSource + * @property {google.rpc.IStatus|null} [status] ImportConfigValidationResult status + */ + + /** + * Constructs a new ImportConfigValidationResult. + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata + * @classdesc Represents an ImportConfigValidationResult. + * @implements IImportConfigValidationResult + * @constructor + * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult=} [properties] Properties to set + */ + function ImportConfigValidationResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportConfigValidationResult inputGcsSource. + * @member {string} inputGcsSource + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult + * @instance + */ + ImportConfigValidationResult.prototype.inputGcsSource = ""; + + /** + * ImportConfigValidationResult status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult + * @instance + */ + ImportConfigValidationResult.prototype.status = null; + + /** + * Creates a new ImportConfigValidationResult instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult} ImportConfigValidationResult instance + */ + ImportConfigValidationResult.create = function create(properties) { + return new ImportConfigValidationResult(properties); + }; + + /** + * Encodes the specified ImportConfigValidationResult message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult} message ImportConfigValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportConfigValidationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputGcsSource != null && Object.hasOwnProperty.call(message, "inputGcsSource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputGcsSource); + 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 ImportConfigValidationResult message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult} message ImportConfigValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportConfigValidationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportConfigValidationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult} ImportConfigValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportConfigValidationResult.decode = function decode(reader, 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.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.inputGcsSource = 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 ImportConfigValidationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult} ImportConfigValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportConfigValidationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportConfigValidationResult message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportConfigValidationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) + if (!$util.isString(message.inputGcsSource)) + return "inputGcsSource: 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 ImportConfigValidationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult} ImportConfigValidationResult + */ + ImportConfigValidationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult(); + if (object.inputGcsSource != null) + message.inputGcsSource = String(object.inputGcsSource); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from an ImportConfigValidationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult + * @static + * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult} message ImportConfigValidationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportConfigValidationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.inputGcsSource = ""; + object.status = null; + } + if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) + object.inputGcsSource = message.inputGcsSource; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this ImportConfigValidationResult to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult + * @instance + * @returns {Object.} JSON object + */ + ImportConfigValidationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportConfigValidationResult + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportConfigValidationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult"; + }; + + return ImportConfigValidationResult; + })(); + + return ImportDocumentsMetadata; + })(); + + v1beta3.GetDocumentRequest = (function() { + + /** + * Properties of a GetDocumentRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGetDocumentRequest + * @property {string|null} [dataset] GetDocumentRequest dataset + * @property {google.cloud.documentai.v1beta3.IDocumentId|null} [documentId] GetDocumentRequest documentId + * @property {google.protobuf.IFieldMask|null} [readMask] GetDocumentRequest readMask + * @property {google.cloud.documentai.v1beta3.IDocumentPageRange|null} [pageRange] GetDocumentRequest pageRange + */ + + /** + * Constructs a new GetDocumentRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a GetDocumentRequest. + * @implements IGetDocumentRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.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 dataset. + * @member {string} dataset + * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest + * @instance + */ + GetDocumentRequest.prototype.dataset = ""; + + /** + * GetDocumentRequest documentId. + * @member {google.cloud.documentai.v1beta3.IDocumentId|null|undefined} documentId + * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest + * @instance + */ + GetDocumentRequest.prototype.documentId = null; + + /** + * GetDocumentRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest + * @instance + */ + GetDocumentRequest.prototype.readMask = null; + + /** + * GetDocumentRequest pageRange. + * @member {google.cloud.documentai.v1beta3.IDocumentPageRange|null|undefined} pageRange + * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest + * @instance + */ + GetDocumentRequest.prototype.pageRange = null; + + /** + * Creates a new GetDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.GetDocumentRequest} GetDocumentRequest instance + */ + GetDocumentRequest.create = function create(properties) { + return new GetDocumentRequest(properties); + }; + + /** + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest + * @static + * @param {google.cloud.documentai.v1beta3.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.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) + $root.google.cloud.documentai.v1beta3.DocumentId.encode(message.documentId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pageRange != null && Object.hasOwnProperty.call(message, "pageRange")) + $root.google.cloud.documentai.v1beta3.DocumentPageRange.encode(message.pageRange, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest + * @static + * @param {google.cloud.documentai.v1beta3.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.documentai.v1beta3.GetDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.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.documentai.v1beta3.GetDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + message.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.decode(reader, reader.uint32()); + break; + } + case 3: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 4: { + message.pageRange = $root.google.cloud.documentai.v1beta3.DocumentPageRange.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.documentai.v1beta3.GetDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.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.documentai.v1beta3.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.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.documentId != null && message.hasOwnProperty("documentId")) { + var error = $root.google.cloud.documentai.v1beta3.DocumentId.verify(message.documentId); + if (error) + return "documentId." + error; + } + if (message.readMask != null && message.hasOwnProperty("readMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + if (message.pageRange != null && message.hasOwnProperty("pageRange")) { + var error = $root.google.cloud.documentai.v1beta3.DocumentPageRange.verify(message.pageRange); + if (error) + return "pageRange." + error; + } + return null; + }; + + /** + * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.GetDocumentRequest} GetDocumentRequest + */ + GetDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.GetDocumentRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.GetDocumentRequest(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.documentId != null) { + if (typeof object.documentId !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.GetDocumentRequest.documentId: object expected"); + message.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.fromObject(object.documentId); + } + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.GetDocumentRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + if (object.pageRange != null) { + if (typeof object.pageRange !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.GetDocumentRequest.pageRange: object expected"); + message.pageRange = $root.google.cloud.documentai.v1beta3.DocumentPageRange.fromObject(object.pageRange); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest + * @static + * @param {google.cloud.documentai.v1beta3.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.dataset = ""; + object.documentId = null; + object.readMask = null; + object.pageRange = null; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.documentId != null && message.hasOwnProperty("documentId")) + object.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.toObject(message.documentId, options); + if (message.readMask != null && message.hasOwnProperty("readMask")) + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + if (message.pageRange != null && message.hasOwnProperty("pageRange")) + object.pageRange = $root.google.cloud.documentai.v1beta3.DocumentPageRange.toObject(message.pageRange, options); + return object; + }; + + /** + * Converts this GetDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.GetDocumentRequest"; + }; + + return GetDocumentRequest; + })(); + + v1beta3.GetDocumentResponse = (function() { + + /** + * Properties of a GetDocumentResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGetDocumentResponse + * @property {google.cloud.documentai.v1beta3.IDocument|null} [document] GetDocumentResponse document + */ + + /** + * Constructs a new GetDocumentResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a GetDocumentResponse. + * @implements IGetDocumentResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IGetDocumentResponse=} [properties] Properties to set + */ + function GetDocumentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentResponse document. + * @member {google.cloud.documentai.v1beta3.IDocument|null|undefined} document + * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse + * @instance + */ + GetDocumentResponse.prototype.document = null; + + /** + * Creates a new GetDocumentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse + * @static + * @param {google.cloud.documentai.v1beta3.IGetDocumentResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.GetDocumentResponse} GetDocumentResponse instance + */ + GetDocumentResponse.create = function create(properties) { + return new GetDocumentResponse(properties); + }; + + /** + * Encodes the specified GetDocumentResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDocumentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse + * @static + * @param {google.cloud.documentai.v1beta3.IGetDocumentResponse} message GetDocumentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.documentai.v1beta3.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDocumentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse + * @static + * @param {google.cloud.documentai.v1beta3.IGetDocumentResponse} message GetDocumentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.GetDocumentResponse} GetDocumentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentResponse.decode = function decode(reader, 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.v1beta3.GetDocumentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.document = $root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.GetDocumentResponse} GetDocumentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentResponse.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.documentai.v1beta3.Document.verify(message.document); + if (error) + return "document." + error; + } + return null; + }; + + /** + * Creates a GetDocumentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.GetDocumentResponse} GetDocumentResponse + */ + GetDocumentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.GetDocumentResponse) + return object; + var message = new $root.google.cloud.documentai.v1beta3.GetDocumentResponse(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.GetDocumentResponse.document: object expected"); + message.document = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.document); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse + * @static + * @param {google.cloud.documentai.v1beta3.GetDocumentResponse} message GetDocumentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.document = null; + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.documentai.v1beta3.Document.toObject(message.document, options); + return object; + }; + + /** + * Converts this GetDocumentResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse + * @instance + * @returns {Object.} JSON object + */ + GetDocumentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDocumentResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetDocumentResponse"; + }; + + return GetDocumentResponse; + })(); + + v1beta3.ListDocumentsRequest = (function() { + + /** + * Properties of a ListDocumentsRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IListDocumentsRequest + * @property {string|null} [dataset] ListDocumentsRequest dataset + * @property {number|null} [pageSize] ListDocumentsRequest pageSize + * @property {string|null} [pageToken] ListDocumentsRequest pageToken + * @property {string|null} [filter] ListDocumentsRequest filter + * @property {boolean|null} [returnTotalSize] ListDocumentsRequest returnTotalSize + * @property {number|null} [skip] ListDocumentsRequest skip + */ + + /** + * Constructs a new ListDocumentsRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ListDocumentsRequest. + * @implements IListDocumentsRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IListDocumentsRequest=} [properties] Properties to set + */ + function ListDocumentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDocumentsRequest dataset. + * @member {string} dataset + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.dataset = ""; + + /** + * ListDocumentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.pageSize = 0; + + /** + * ListDocumentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.pageToken = ""; + + /** + * ListDocumentsRequest filter. + * @member {string} filter + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.filter = ""; + + /** + * ListDocumentsRequest returnTotalSize. + * @member {boolean} returnTotalSize + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.returnTotalSize = false; + + /** + * ListDocumentsRequest skip. + * @member {number} skip + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.skip = 0; + + /** + * Creates a new ListDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListDocumentsRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ListDocumentsRequest} ListDocumentsRequest instance + */ + ListDocumentsRequest.create = function create(properties) { + return new ListDocumentsRequest(properties); + }; + + /** + * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + 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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.returnTotalSize != null && Object.hasOwnProperty.call(message, "returnTotalSize")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.returnTotalSize); + if (message.skip != null && Object.hasOwnProperty.call(message, "skip")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.skip); + return writer; + }; + + /** + * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ListDocumentsRequest} ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsRequest.decode = function decode(reader, 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.v1beta3.ListDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 6: { + message.returnTotalSize = reader.bool(); + break; + } + case 8: { + message.skip = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ListDocumentsRequest} ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDocumentsRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: 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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.returnTotalSize != null && message.hasOwnProperty("returnTotalSize")) + if (typeof message.returnTotalSize !== "boolean") + return "returnTotalSize: boolean expected"; + if (message.skip != null && message.hasOwnProperty("skip")) + if (!$util.isInteger(message.skip)) + return "skip: integer expected"; + return null; + }; + + /** + * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ListDocumentsRequest} ListDocumentsRequest + */ + ListDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ListDocumentsRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ListDocumentsRequest(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.returnTotalSize != null) + message.returnTotalSize = Boolean(object.returnTotalSize); + if (object.skip != null) + message.skip = object.skip | 0; + return message; + }; + + /** + * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @static + * @param {google.cloud.documentai.v1beta3.ListDocumentsRequest} message ListDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.returnTotalSize = false; + object.skip = 0; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.returnTotalSize != null && message.hasOwnProperty("returnTotalSize")) + object.returnTotalSize = message.returnTotalSize; + if (message.skip != null && message.hasOwnProperty("skip")) + object.skip = message.skip; + return object; + }; + + /** + * Converts this ListDocumentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDocumentsRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListDocumentsRequest"; + }; + + return ListDocumentsRequest; + })(); + + v1beta3.ListDocumentsResponse = (function() { + + /** + * Properties of a ListDocumentsResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IListDocumentsResponse + * @property {Array.|null} [documentMetadata] ListDocumentsResponse documentMetadata + * @property {string|null} [nextPageToken] ListDocumentsResponse nextPageToken + * @property {number|null} [totalSize] ListDocumentsResponse totalSize + */ + + /** + * Constructs a new ListDocumentsResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a ListDocumentsResponse. + * @implements IListDocumentsResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IListDocumentsResponse=} [properties] Properties to set + */ + function ListDocumentsResponse(properties) { + this.documentMetadata = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDocumentsResponse documentMetadata. + * @member {Array.} documentMetadata + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @instance + */ + ListDocumentsResponse.prototype.documentMetadata = $util.emptyArray; + + /** + * ListDocumentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @instance + */ + ListDocumentsResponse.prototype.nextPageToken = ""; + + /** + * ListDocumentsResponse totalSize. + * @member {number} totalSize + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @instance + */ + ListDocumentsResponse.prototype.totalSize = 0; + + /** + * Creates a new ListDocumentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListDocumentsResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.ListDocumentsResponse} ListDocumentsResponse instance + */ + ListDocumentsResponse.create = function create(properties) { + return new ListDocumentsResponse(properties); + }; + + /** + * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentMetadata != null && message.documentMetadata.length) + for (var i = 0; i < message.documentMetadata.length; ++i) + $root.google.cloud.documentai.v1beta3.DocumentMetadata.encode(message.documentMetadata[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); + return writer; + }; + + /** + * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.ListDocumentsResponse} ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsResponse.decode = function decode(reader, 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.v1beta3.ListDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.documentMetadata && message.documentMetadata.length)) + message.documentMetadata = []; + message.documentMetadata.push($root.google.cloud.documentai.v1beta3.DocumentMetadata.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.totalSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.ListDocumentsResponse} ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDocumentsResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentMetadata != null && message.hasOwnProperty("documentMetadata")) { + if (!Array.isArray(message.documentMetadata)) + return "documentMetadata: array expected"; + for (var i = 0; i < message.documentMetadata.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.DocumentMetadata.verify(message.documentMetadata[i]); + if (error) + return "documentMetadata." + 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"; + return null; + }; + + /** + * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.ListDocumentsResponse} ListDocumentsResponse + */ + ListDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.ListDocumentsResponse) + return object; + var message = new $root.google.cloud.documentai.v1beta3.ListDocumentsResponse(); + if (object.documentMetadata) { + if (!Array.isArray(object.documentMetadata)) + throw TypeError(".google.cloud.documentai.v1beta3.ListDocumentsResponse.documentMetadata: array expected"); + message.documentMetadata = []; + for (var i = 0; i < object.documentMetadata.length; ++i) { + if (typeof object.documentMetadata[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.ListDocumentsResponse.documentMetadata: object expected"); + message.documentMetadata[i] = $root.google.cloud.documentai.v1beta3.DocumentMetadata.fromObject(object.documentMetadata[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalSize != null) + message.totalSize = object.totalSize | 0; + return message; + }; + + /** + * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @static + * @param {google.cloud.documentai.v1beta3.ListDocumentsResponse} message ListDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documentMetadata = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.documentMetadata && message.documentMetadata.length) { + object.documentMetadata = []; + for (var j = 0; j < message.documentMetadata.length; ++j) + object.documentMetadata[j] = $root.google.cloud.documentai.v1beta3.DocumentMetadata.toObject(message.documentMetadata[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalSize != null && message.hasOwnProperty("totalSize")) + object.totalSize = message.totalSize; + return object; + }; + + /** + * Converts this ListDocumentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDocumentsResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListDocumentsResponse"; + }; + + return ListDocumentsResponse; + })(); + + v1beta3.BatchDeleteDocumentsRequest = (function() { + + /** + * Properties of a BatchDeleteDocumentsRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IBatchDeleteDocumentsRequest + * @property {string|null} [dataset] BatchDeleteDocumentsRequest dataset + * @property {google.cloud.documentai.v1beta3.IBatchDatasetDocuments|null} [datasetDocuments] BatchDeleteDocumentsRequest datasetDocuments + */ + + /** + * Constructs a new BatchDeleteDocumentsRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a BatchDeleteDocumentsRequest. + * @implements IBatchDeleteDocumentsRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest=} [properties] Properties to set + */ + function BatchDeleteDocumentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteDocumentsRequest dataset. + * @member {string} dataset + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + * @instance + */ + BatchDeleteDocumentsRequest.prototype.dataset = ""; + + /** + * BatchDeleteDocumentsRequest datasetDocuments. + * @member {google.cloud.documentai.v1beta3.IBatchDatasetDocuments|null|undefined} datasetDocuments + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + * @instance + */ + BatchDeleteDocumentsRequest.prototype.datasetDocuments = null; + + /** + * Creates a new BatchDeleteDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest} BatchDeleteDocumentsRequest instance + */ + BatchDeleteDocumentsRequest.create = function create(properties) { + return new BatchDeleteDocumentsRequest(properties); + }; + + /** + * Encodes the specified BatchDeleteDocumentsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest} message BatchDeleteDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.datasetDocuments != null && Object.hasOwnProperty.call(message, "datasetDocuments")) + $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.encode(message.datasetDocuments, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchDeleteDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest} message BatchDeleteDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest} BatchDeleteDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteDocumentsRequest.decode = function decode(reader, 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.v1beta3.BatchDeleteDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 3: { + message.datasetDocuments = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest} BatchDeleteDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteDocumentsRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.datasetDocuments != null && message.hasOwnProperty("datasetDocuments")) { + var error = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.verify(message.datasetDocuments); + if (error) + return "datasetDocuments." + error; + } + return null; + }; + + /** + * Creates a BatchDeleteDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest} BatchDeleteDocumentsRequest + */ + BatchDeleteDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.datasetDocuments != null) { + if (typeof object.datasetDocuments !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest.datasetDocuments: object expected"); + message.datasetDocuments = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.fromObject(object.datasetDocuments); + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + * @static + * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest} message BatchDeleteDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.datasetDocuments = null; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.datasetDocuments != null && message.hasOwnProperty("datasetDocuments")) + object.datasetDocuments = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.toObject(message.datasetDocuments, options); + return object; + }; + + /** + * Converts this BatchDeleteDocumentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteDocumentsRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest"; + }; + + return BatchDeleteDocumentsRequest; + })(); + + v1beta3.BatchDeleteDocumentsResponse = (function() { + + /** + * Properties of a BatchDeleteDocumentsResponse. + * @memberof google.cloud.documentai.v1beta3 + * @interface IBatchDeleteDocumentsResponse + */ + + /** + * Constructs a new BatchDeleteDocumentsResponse. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a BatchDeleteDocumentsResponse. + * @implements IBatchDeleteDocumentsResponse + * @constructor + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse=} [properties] Properties to set + */ + function BatchDeleteDocumentsResponse(properties) { + if (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 BatchDeleteDocumentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse} BatchDeleteDocumentsResponse instance + */ + BatchDeleteDocumentsResponse.create = function create(properties) { + return new BatchDeleteDocumentsResponse(properties); + }; + + /** + * Encodes the specified BatchDeleteDocumentsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse} message BatchDeleteDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BatchDeleteDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse} message BatchDeleteDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse} BatchDeleteDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteDocumentsResponse.decode = function decode(reader, 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.v1beta3.BatchDeleteDocumentsResponse(); + 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 BatchDeleteDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse} BatchDeleteDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteDocumentsResponse message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BatchDeleteDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse} BatchDeleteDocumentsResponse + */ + BatchDeleteDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse) + return object; + return new $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse(); + }; + + /** + * Creates a plain object from a BatchDeleteDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse + * @static + * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse} message BatchDeleteDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteDocumentsResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BatchDeleteDocumentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteDocumentsResponse + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse"; + }; + + return BatchDeleteDocumentsResponse; + })(); + + v1beta3.BatchDeleteDocumentsMetadata = (function() { + + /** + * Properties of a BatchDeleteDocumentsMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IBatchDeleteDocumentsMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] BatchDeleteDocumentsMetadata commonMetadata + * @property {Array.|null} [individualBatchDeleteStatuses] BatchDeleteDocumentsMetadata individualBatchDeleteStatuses + * @property {number|null} [totalDocumentCount] BatchDeleteDocumentsMetadata totalDocumentCount + * @property {number|null} [errorDocumentCount] BatchDeleteDocumentsMetadata errorDocumentCount + */ + + /** + * Constructs a new BatchDeleteDocumentsMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a BatchDeleteDocumentsMetadata. + * @implements IBatchDeleteDocumentsMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata=} [properties] Properties to set + */ + function BatchDeleteDocumentsMetadata(properties) { + this.individualBatchDeleteStatuses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteDocumentsMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @instance + */ + BatchDeleteDocumentsMetadata.prototype.commonMetadata = null; + + /** + * BatchDeleteDocumentsMetadata individualBatchDeleteStatuses. + * @member {Array.} individualBatchDeleteStatuses + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @instance + */ + BatchDeleteDocumentsMetadata.prototype.individualBatchDeleteStatuses = $util.emptyArray; + + /** + * BatchDeleteDocumentsMetadata totalDocumentCount. + * @member {number} totalDocumentCount + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @instance + */ + BatchDeleteDocumentsMetadata.prototype.totalDocumentCount = 0; + + /** + * BatchDeleteDocumentsMetadata errorDocumentCount. + * @member {number} errorDocumentCount + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @instance + */ + BatchDeleteDocumentsMetadata.prototype.errorDocumentCount = 0; + + /** + * Creates a new BatchDeleteDocumentsMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata} BatchDeleteDocumentsMetadata instance + */ + BatchDeleteDocumentsMetadata.create = function create(properties) { + return new BatchDeleteDocumentsMetadata(properties); + }; + + /** + * Encodes the specified BatchDeleteDocumentsMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata} message BatchDeleteDocumentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteDocumentsMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.individualBatchDeleteStatuses != null && message.individualBatchDeleteStatuses.length) + for (var i = 0; i < message.individualBatchDeleteStatuses.length; ++i) + $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.encode(message.individualBatchDeleteStatuses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.totalDocumentCount != null && Object.hasOwnProperty.call(message, "totalDocumentCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalDocumentCount); + if (message.errorDocumentCount != null && Object.hasOwnProperty.call(message, "errorDocumentCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.errorDocumentCount); + return writer; + }; + + /** + * Encodes the specified BatchDeleteDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata} message BatchDeleteDocumentsMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteDocumentsMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteDocumentsMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata} BatchDeleteDocumentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteDocumentsMetadata.decode = function decode(reader, 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.v1beta3.BatchDeleteDocumentsMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.individualBatchDeleteStatuses && message.individualBatchDeleteStatuses.length)) + message.individualBatchDeleteStatuses = []; + message.individualBatchDeleteStatuses.push($root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.decode(reader, reader.uint32())); + break; + } + case 3: { + message.totalDocumentCount = reader.int32(); + break; + } + case 4: { + message.errorDocumentCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteDocumentsMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata} BatchDeleteDocumentsMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteDocumentsMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteDocumentsMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteDocumentsMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + if (message.individualBatchDeleteStatuses != null && message.hasOwnProperty("individualBatchDeleteStatuses")) { + if (!Array.isArray(message.individualBatchDeleteStatuses)) + return "individualBatchDeleteStatuses: array expected"; + for (var i = 0; i < message.individualBatchDeleteStatuses.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.verify(message.individualBatchDeleteStatuses[i]); + if (error) + return "individualBatchDeleteStatuses." + error; + } + } + if (message.totalDocumentCount != null && message.hasOwnProperty("totalDocumentCount")) + if (!$util.isInteger(message.totalDocumentCount)) + return "totalDocumentCount: integer expected"; + if (message.errorDocumentCount != null && message.hasOwnProperty("errorDocumentCount")) + if (!$util.isInteger(message.errorDocumentCount)) + return "errorDocumentCount: integer expected"; + return null; + }; + + /** + * Creates a BatchDeleteDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata} BatchDeleteDocumentsMetadata + */ + BatchDeleteDocumentsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + if (object.individualBatchDeleteStatuses) { + if (!Array.isArray(object.individualBatchDeleteStatuses)) + throw TypeError(".google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.individualBatchDeleteStatuses: array expected"); + message.individualBatchDeleteStatuses = []; + for (var i = 0; i < object.individualBatchDeleteStatuses.length; ++i) { + if (typeof object.individualBatchDeleteStatuses[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.individualBatchDeleteStatuses: object expected"); + message.individualBatchDeleteStatuses[i] = $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.fromObject(object.individualBatchDeleteStatuses[i]); + } + } + if (object.totalDocumentCount != null) + message.totalDocumentCount = object.totalDocumentCount | 0; + if (object.errorDocumentCount != null) + message.errorDocumentCount = object.errorDocumentCount | 0; + return message; + }; + + /** + * Creates a plain object from a BatchDeleteDocumentsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @static + * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata} message BatchDeleteDocumentsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteDocumentsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.individualBatchDeleteStatuses = []; + if (options.defaults) { + object.commonMetadata = null; + object.totalDocumentCount = 0; + object.errorDocumentCount = 0; + } + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + if (message.individualBatchDeleteStatuses && message.individualBatchDeleteStatuses.length) { + object.individualBatchDeleteStatuses = []; + for (var j = 0; j < message.individualBatchDeleteStatuses.length; ++j) + object.individualBatchDeleteStatuses[j] = $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.toObject(message.individualBatchDeleteStatuses[j], options); + } + if (message.totalDocumentCount != null && message.hasOwnProperty("totalDocumentCount")) + object.totalDocumentCount = message.totalDocumentCount; + if (message.errorDocumentCount != null && message.hasOwnProperty("errorDocumentCount")) + object.errorDocumentCount = message.errorDocumentCount; + return object; + }; + + /** + * Converts this BatchDeleteDocumentsMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteDocumentsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteDocumentsMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteDocumentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata"; + }; + + BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus = (function() { + + /** + * Properties of an IndividualBatchDeleteStatus. + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @interface IIndividualBatchDeleteStatus + * @property {google.cloud.documentai.v1beta3.IDocumentId|null} [documentId] IndividualBatchDeleteStatus documentId + * @property {google.rpc.IStatus|null} [status] IndividualBatchDeleteStatus status + */ + + /** + * Constructs a new IndividualBatchDeleteStatus. + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata + * @classdesc Represents an IndividualBatchDeleteStatus. + * @implements IIndividualBatchDeleteStatus + * @constructor + * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus=} [properties] Properties to set + */ + function IndividualBatchDeleteStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndividualBatchDeleteStatus documentId. + * @member {google.cloud.documentai.v1beta3.IDocumentId|null|undefined} documentId + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus + * @instance + */ + IndividualBatchDeleteStatus.prototype.documentId = null; + + /** + * IndividualBatchDeleteStatus status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus + * @instance + */ + IndividualBatchDeleteStatus.prototype.status = null; + + /** + * Creates a new IndividualBatchDeleteStatus instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus + * @static + * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus} IndividualBatchDeleteStatus instance + */ + IndividualBatchDeleteStatus.create = function create(properties) { + return new IndividualBatchDeleteStatus(properties); + }; + + /** + * Encodes the specified IndividualBatchDeleteStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus + * @static + * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus} message IndividualBatchDeleteStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualBatchDeleteStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) + $root.google.cloud.documentai.v1beta3.DocumentId.encode(message.documentId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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 IndividualBatchDeleteStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus + * @static + * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus} message IndividualBatchDeleteStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndividualBatchDeleteStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndividualBatchDeleteStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus} IndividualBatchDeleteStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualBatchDeleteStatus.decode = function decode(reader, 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.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.decode(reader, reader.uint32()); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndividualBatchDeleteStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus} IndividualBatchDeleteStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndividualBatchDeleteStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndividualBatchDeleteStatus message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndividualBatchDeleteStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentId != null && message.hasOwnProperty("documentId")) { + var error = $root.google.cloud.documentai.v1beta3.DocumentId.verify(message.documentId); + if (error) + return "documentId." + error; + } + 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 IndividualBatchDeleteStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus} IndividualBatchDeleteStatus + */ + IndividualBatchDeleteStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus) + return object; + var message = new $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus(); + if (object.documentId != null) { + if (typeof object.documentId !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.documentId: object expected"); + message.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.fromObject(object.documentId); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from an IndividualBatchDeleteStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus + * @static + * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus} message IndividualBatchDeleteStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndividualBatchDeleteStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.documentId = null; + object.status = null; + } + if (message.documentId != null && message.hasOwnProperty("documentId")) + object.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.toObject(message.documentId, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this IndividualBatchDeleteStatus to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus + * @instance + * @returns {Object.} JSON object + */ + IndividualBatchDeleteStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndividualBatchDeleteStatus + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndividualBatchDeleteStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus"; + }; + + return IndividualBatchDeleteStatus; + })(); + + return BatchDeleteDocumentsMetadata; + })(); + + v1beta3.GetDatasetSchemaRequest = (function() { + + /** + * Properties of a GetDatasetSchemaRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IGetDatasetSchemaRequest + * @property {string|null} [name] GetDatasetSchemaRequest name + * @property {boolean|null} [visibleFieldsOnly] GetDatasetSchemaRequest visibleFieldsOnly + */ + + /** + * Constructs a new GetDatasetSchemaRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a GetDatasetSchemaRequest. + * @implements IGetDatasetSchemaRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest=} [properties] Properties to set + */ + function GetDatasetSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDatasetSchemaRequest name. + * @member {string} name + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @instance + */ + GetDatasetSchemaRequest.prototype.name = ""; + + /** + * GetDatasetSchemaRequest visibleFieldsOnly. + * @member {boolean} visibleFieldsOnly + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @instance + */ + GetDatasetSchemaRequest.prototype.visibleFieldsOnly = false; + + /** + * Creates a new GetDatasetSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.GetDatasetSchemaRequest} GetDatasetSchemaRequest instance + */ + GetDatasetSchemaRequest.create = function create(properties) { + return new GetDatasetSchemaRequest(properties); + }; + + /** + * Encodes the specified GetDatasetSchemaRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDatasetSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest} message GetDatasetSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatasetSchemaRequest.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.visibleFieldsOnly != null && Object.hasOwnProperty.call(message, "visibleFieldsOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.visibleFieldsOnly); + return writer; + }; + + /** + * Encodes the specified GetDatasetSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDatasetSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @static + * @param {google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest} message GetDatasetSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDatasetSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDatasetSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.GetDatasetSchemaRequest} GetDatasetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatasetSchemaRequest.decode = function decode(reader, 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.v1beta3.GetDatasetSchemaRequest(); + 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.visibleFieldsOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDatasetSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.GetDatasetSchemaRequest} GetDatasetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDatasetSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDatasetSchemaRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDatasetSchemaRequest.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.visibleFieldsOnly != null && message.hasOwnProperty("visibleFieldsOnly")) + if (typeof message.visibleFieldsOnly !== "boolean") + return "visibleFieldsOnly: boolean expected"; + return null; + }; + + /** + * Creates a GetDatasetSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.GetDatasetSchemaRequest} GetDatasetSchemaRequest + */ + GetDatasetSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.visibleFieldsOnly != null) + message.visibleFieldsOnly = Boolean(object.visibleFieldsOnly); + return message; + }; + + /** + * Creates a plain object from a GetDatasetSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @static + * @param {google.cloud.documentai.v1beta3.GetDatasetSchemaRequest} message GetDatasetSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDatasetSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.visibleFieldsOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.visibleFieldsOnly != null && message.hasOwnProperty("visibleFieldsOnly")) + object.visibleFieldsOnly = message.visibleFieldsOnly; + return object; + }; + + /** + * Converts this GetDatasetSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + GetDatasetSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDatasetSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDatasetSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetDatasetSchemaRequest"; + }; + + return GetDatasetSchemaRequest; + })(); + + v1beta3.UpdateDatasetSchemaRequest = (function() { + + /** + * Properties of an UpdateDatasetSchemaRequest. + * @memberof google.cloud.documentai.v1beta3 + * @interface IUpdateDatasetSchemaRequest + * @property {google.cloud.documentai.v1beta3.IDatasetSchema|null} [datasetSchema] UpdateDatasetSchemaRequest datasetSchema + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatasetSchemaRequest updateMask + */ + + /** + * Constructs a new UpdateDatasetSchemaRequest. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an UpdateDatasetSchemaRequest. + * @implements IUpdateDatasetSchemaRequest + * @constructor + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest=} [properties] Properties to set + */ + function UpdateDatasetSchemaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDatasetSchemaRequest datasetSchema. + * @member {google.cloud.documentai.v1beta3.IDatasetSchema|null|undefined} datasetSchema + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + * @instance + */ + UpdateDatasetSchemaRequest.prototype.datasetSchema = null; + + /** + * UpdateDatasetSchemaRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + * @instance + */ + UpdateDatasetSchemaRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDatasetSchemaRequest instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} UpdateDatasetSchemaRequest instance + */ + UpdateDatasetSchemaRequest.create = function create(properties) { + return new UpdateDatasetSchemaRequest(properties); + }; + + /** + * Encodes the specified UpdateDatasetSchemaRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest} message UpdateDatasetSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetSchemaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.datasetSchema != null && Object.hasOwnProperty.call(message, "datasetSchema")) + $root.google.cloud.documentai.v1beta3.DatasetSchema.encode(message.datasetSchema, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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(); + return writer; + }; + + /** + * Encodes the specified UpdateDatasetSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest} message UpdateDatasetSchemaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDatasetSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDatasetSchemaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} UpdateDatasetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetSchemaRequest.decode = function decode(reader, 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.v1beta3.UpdateDatasetSchemaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.datasetSchema = $root.google.cloud.documentai.v1beta3.DatasetSchema.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDatasetSchemaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} UpdateDatasetSchemaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDatasetSchemaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDatasetSchemaRequest message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDatasetSchemaRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.datasetSchema != null && message.hasOwnProperty("datasetSchema")) { + var error = $root.google.cloud.documentai.v1beta3.DatasetSchema.verify(message.datasetSchema); + if (error) + return "datasetSchema." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDatasetSchemaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} UpdateDatasetSchemaRequest + */ + UpdateDatasetSchemaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest) + return object; + var message = new $root.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest(); + if (object.datasetSchema != null) { + if (typeof object.datasetSchema !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.datasetSchema: object expected"); + message.datasetSchema = $root.google.cloud.documentai.v1beta3.DatasetSchema.fromObject(object.datasetSchema); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDatasetSchemaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + * @static + * @param {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} message UpdateDatasetSchemaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDatasetSchemaRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.datasetSchema = null; + object.updateMask = null; + } + if (message.datasetSchema != null && message.hasOwnProperty("datasetSchema")) + object.datasetSchema = $root.google.cloud.documentai.v1beta3.DatasetSchema.toObject(message.datasetSchema, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDatasetSchemaRequest to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDatasetSchemaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDatasetSchemaRequest + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDatasetSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest"; + }; + + return UpdateDatasetSchemaRequest; + })(); + + v1beta3.DocumentPageRange = (function() { + + /** + * Properties of a DocumentPageRange. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDocumentPageRange + * @property {number|null} [start] DocumentPageRange start + * @property {number|null} [end] DocumentPageRange end + */ + + /** + * Constructs a new DocumentPageRange. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DocumentPageRange. + * @implements IDocumentPageRange + * @constructor + * @param {google.cloud.documentai.v1beta3.IDocumentPageRange=} [properties] Properties to set + */ + function DocumentPageRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentPageRange start. + * @member {number} start + * @memberof google.cloud.documentai.v1beta3.DocumentPageRange + * @instance + */ + DocumentPageRange.prototype.start = 0; + + /** + * DocumentPageRange end. + * @member {number} end + * @memberof google.cloud.documentai.v1beta3.DocumentPageRange + * @instance + */ + DocumentPageRange.prototype.end = 0; + + /** + * Creates a new DocumentPageRange instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentPageRange + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentPageRange=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentPageRange} DocumentPageRange instance + */ + DocumentPageRange.create = function create(properties) { + return new DocumentPageRange(properties); + }; + + /** + * Encodes the specified DocumentPageRange message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentPageRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentPageRange + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentPageRange} message DocumentPageRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentPageRange.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 DocumentPageRange message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentPageRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentPageRange + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentPageRange} message DocumentPageRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentPageRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentPageRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DocumentPageRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DocumentPageRange} DocumentPageRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentPageRange.decode = function decode(reader, 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.v1beta3.DocumentPageRange(); + 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 DocumentPageRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentPageRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DocumentPageRange} DocumentPageRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentPageRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentPageRange message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DocumentPageRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentPageRange.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 DocumentPageRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DocumentPageRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentPageRange} DocumentPageRange + */ + DocumentPageRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentPageRange) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentPageRange(); + 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 DocumentPageRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentPageRange + * @static + * @param {google.cloud.documentai.v1beta3.DocumentPageRange} message DocumentPageRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentPageRange.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 DocumentPageRange to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DocumentPageRange + * @instance + * @returns {Object.} JSON object + */ + DocumentPageRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentPageRange + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DocumentPageRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentPageRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentPageRange"; + }; + + return DocumentPageRange; + })(); + + v1beta3.DocumentMetadata = (function() { + + /** + * Properties of a DocumentMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDocumentMetadata + * @property {google.cloud.documentai.v1beta3.IDocumentId|null} [documentId] DocumentMetadata documentId + * @property {number|null} [pageCount] DocumentMetadata pageCount + * @property {google.cloud.documentai.v1beta3.DatasetSplitType|null} [datasetType] DocumentMetadata datasetType + * @property {google.cloud.documentai.v1beta3.DocumentLabelingState|null} [labelingState] DocumentMetadata labelingState + * @property {string|null} [displayName] DocumentMetadata displayName + */ + + /** + * Constructs a new DocumentMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a DocumentMetadata. + * @implements IDocumentMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IDocumentMetadata=} [properties] Properties to set + */ + function DocumentMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DocumentMetadata documentId. + * @member {google.cloud.documentai.v1beta3.IDocumentId|null|undefined} documentId + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @instance + */ + DocumentMetadata.prototype.documentId = null; + + /** + * DocumentMetadata pageCount. + * @member {number} pageCount + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @instance + */ + DocumentMetadata.prototype.pageCount = 0; + + /** + * DocumentMetadata datasetType. + * @member {google.cloud.documentai.v1beta3.DatasetSplitType} datasetType + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @instance + */ + DocumentMetadata.prototype.datasetType = 0; + + /** + * DocumentMetadata labelingState. + * @member {google.cloud.documentai.v1beta3.DocumentLabelingState} labelingState + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @instance + */ + DocumentMetadata.prototype.labelingState = 0; + + /** + * DocumentMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @instance + */ + DocumentMetadata.prototype.displayName = ""; + + /** + * Creates a new DocumentMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.DocumentMetadata} DocumentMetadata instance + */ + DocumentMetadata.create = function create(properties) { + return new DocumentMetadata(properties); + }; + + /** + * Encodes the specified DocumentMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentMetadata} message DocumentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) + $root.google.cloud.documentai.v1beta3.DocumentId.encode(message.documentId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pageCount != null && Object.hasOwnProperty.call(message, "pageCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageCount); + if (message.datasetType != null && Object.hasOwnProperty.call(message, "datasetType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.datasetType); + if (message.labelingState != null && Object.hasOwnProperty.call(message, "labelingState")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.labelingState); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified DocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IDocumentMetadata} message DocumentMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DocumentMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.DocumentMetadata} DocumentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentMetadata.decode = function decode(reader, 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.v1beta3.DocumentMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pageCount = reader.int32(); + break; + } + case 3: { + message.datasetType = reader.int32(); + break; + } + case 5: { + message.labelingState = reader.int32(); + break; + } + case 6: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DocumentMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.DocumentMetadata} DocumentMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DocumentMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documentId != null && message.hasOwnProperty("documentId")) { + var error = $root.google.cloud.documentai.v1beta3.DocumentId.verify(message.documentId); + if (error) + return "documentId." + error; + } + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + if (!$util.isInteger(message.pageCount)) + return "pageCount: integer expected"; + if (message.datasetType != null && message.hasOwnProperty("datasetType")) + switch (message.datasetType) { + default: + return "datasetType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.labelingState != null && message.hasOwnProperty("labelingState")) + switch (message.labelingState) { + default: + return "labelingState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a DocumentMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.DocumentMetadata} DocumentMetadata + */ + DocumentMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.DocumentMetadata(); + if (object.documentId != null) { + if (typeof object.documentId !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.DocumentMetadata.documentId: object expected"); + message.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.fromObject(object.documentId); + } + if (object.pageCount != null) + message.pageCount = object.pageCount | 0; + switch (object.datasetType) { + default: + if (typeof object.datasetType === "number") { + message.datasetType = object.datasetType; + break; + } + break; + case "DATASET_SPLIT_TYPE_UNSPECIFIED": + case 0: + message.datasetType = 0; + break; + case "DATASET_SPLIT_TRAIN": + case 1: + message.datasetType = 1; + break; + case "DATASET_SPLIT_TEST": + case 2: + message.datasetType = 2; + break; + case "DATASET_SPLIT_UNASSIGNED": + case 3: + message.datasetType = 3; + break; + } + switch (object.labelingState) { + default: + if (typeof object.labelingState === "number") { + message.labelingState = object.labelingState; + break; + } + break; + case "DOCUMENT_LABELING_STATE_UNSPECIFIED": + case 0: + message.labelingState = 0; + break; + case "DOCUMENT_LABELED": + case 1: + message.labelingState = 1; + break; + case "DOCUMENT_UNLABELED": + case 2: + message.labelingState = 2; + break; + case "DOCUMENT_AUTO_LABELED": + case 3: + message.labelingState = 3; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a DocumentMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @static + * @param {google.cloud.documentai.v1beta3.DocumentMetadata} message DocumentMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.documentId = null; + object.pageCount = 0; + object.datasetType = options.enums === String ? "DATASET_SPLIT_TYPE_UNSPECIFIED" : 0; + object.labelingState = options.enums === String ? "DOCUMENT_LABELING_STATE_UNSPECIFIED" : 0; + object.displayName = ""; + } + if (message.documentId != null && message.hasOwnProperty("documentId")) + object.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.toObject(message.documentId, options); + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + object.pageCount = message.pageCount; + if (message.datasetType != null && message.hasOwnProperty("datasetType")) + object.datasetType = options.enums === String ? $root.google.cloud.documentai.v1beta3.DatasetSplitType[message.datasetType] === undefined ? message.datasetType : $root.google.cloud.documentai.v1beta3.DatasetSplitType[message.datasetType] : message.datasetType; + if (message.labelingState != null && message.hasOwnProperty("labelingState")) + object.labelingState = options.enums === String ? $root.google.cloud.documentai.v1beta3.DocumentLabelingState[message.labelingState] === undefined ? message.labelingState : $root.google.cloud.documentai.v1beta3.DocumentLabelingState[message.labelingState] : message.labelingState; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this DocumentMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @instance + * @returns {Object.} JSON object + */ + DocumentMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DocumentMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.DocumentMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DocumentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentMetadata"; + }; + + return DocumentMetadata; + })(); + + return v1beta3; + })(); + + 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.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; + })(); + + 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; + })(); + + 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.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.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.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; + })(); + + return type; + })(); + + 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-documentai/protos/protos.json b/owl-bot-staging/google-cloud-documentai/protos/protos.json new file mode 100644 index 00000000000..439c727fdc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/protos/protos.json @@ -0,0 +1,11380 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "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": "DocumentAiProcessorType", + "java_package": "com.google.cloud.documentai.v1", + "php_namespace": "Google\\Cloud\\DocumentAI\\V1", + "ruby_package": "Google::Cloud::DocumentAI::V1", + "(google.api.resource_definition).type": "documentai.googleapis.com/Location", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}" + }, + "nested": { + "Barcode": { + "fields": { + "format": { + "type": "string", + "id": 1 + }, + "valueFormat": { + "type": "string", + "id": 2 + }, + "rawValue": { + "type": "string", + "id": 3 + } + } + }, + "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 + } + } + } + } + }, + "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 + } + } + }, + "RawDocument": { + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + } + } + }, + "GcsDocument": { + "fields": { + "gcsUri": { + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + } + } + }, + "GcsDocuments": { + "fields": { + "documents": { + "rule": "repeated", + "type": "GcsDocument", + "id": 1 + } + } + }, + "GcsPrefix": { + "fields": { + "gcsUriPrefix": { + "type": "string", + "id": 1 + } + } + }, + "BatchDocumentsInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsPrefix", + "gcsDocuments" + ] + } + }, + "fields": { + "gcsPrefix": { + "type": "GcsPrefix", + "id": 1 + }, + "gcsDocuments": { + "type": "GcsDocuments", + "id": 2 + } + } + }, + "DocumentOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsOutputConfig" + ] + } + }, + "fields": { + "gcsOutputConfig": { + "type": "GcsOutputConfig", + "id": 1 + } + }, + "nested": { + "GcsOutputConfig": { + "fields": { + "gcsUri": { + "type": "string", + "id": 1 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "shardingConfig": { + "type": "ShardingConfig", + "id": 3 + } + }, + "nested": { + "ShardingConfig": { + "fields": { + "pagesPerShard": { + "type": "int32", + "id": 1 + }, + "pagesOverlap": { + "type": "int32", + "id": 2 + } + } + } + } + } + } + }, + "OcrConfig": { + "fields": { + "hints": { + "type": "Hints", + "id": 2 + }, + "enableNativePdfParsing": { + "type": "bool", + "id": 3 + }, + "enableImageQualityScores": { + "type": "bool", + "id": 4 + }, + "advancedOcrOptions": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "enableSymbol": { + "type": "bool", + "id": 6 + }, + "computeStyleInfo": { + "type": "bool", + "id": 8, + "options": { + "deprecated": true + } + }, + "disableCharacterBoxesDetection": { + "type": "bool", + "id": 10 + }, + "premiumFeatures": { + "type": "PremiumFeatures", + "id": 11 + } + }, + "nested": { + "Hints": { + "fields": { + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "PremiumFeatures": { + "fields": { + "enableSelectionMarkDetection": { + "type": "bool", + "id": 3 + }, + "computeStyleInfo": { + "type": "bool", + "id": 4 + }, + "enableMathOcr": { + "type": "bool", + "id": 5 + } + } + } + } + }, + "DocumentProcessorService": { + "options": { + "(google.api.default_host)": "documentai.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ProcessDocument": { + "requestType": "ProcessRequest", + "responseType": "ProcessResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/processors/*}:process", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/processors/*}:process", + "body": "*", + "additional_bindings": { + "post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchProcessDocuments": { + "requestType": "BatchProcessRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/processors/*}:batchProcess", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "BatchProcessResponse", + "(google.longrunning.operation_info).metadata_type": "BatchProcessMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/processors/*}:batchProcess", + "body": "*", + "additional_bindings": { + "post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchProcessResponse", + "metadata_type": "BatchProcessMetadata" + } + } + ] + }, + "FetchProcessorTypes": { + "requestType": "FetchProcessorTypesRequest", + "responseType": "FetchProcessorTypesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}:fetchProcessorTypes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}:fetchProcessorTypes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListProcessorTypes": { + "requestType": "ListProcessorTypesRequest", + "responseType": "ListProcessorTypesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/processorTypes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/processorTypes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetProcessorType": { + "requestType": "GetProcessorTypeRequest", + "responseType": "ProcessorType", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/processorTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/processorTypes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListProcessors": { + "requestType": "ListProcessorsRequest", + "responseType": "ListProcessorsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/processors", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/processors" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetProcessor": { + "requestType": "GetProcessorRequest", + "responseType": "Processor", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/processors/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/processors/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "TrainProcessorVersion": { + "requestType": "TrainProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions:train", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,processor_version", + "(google.longrunning.operation_info).response_type": "TrainProcessorVersionResponse", + "(google.longrunning.operation_info).metadata_type": "TrainProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions:train", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,processor_version" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TrainProcessorVersionResponse", + "metadata_type": "TrainProcessorVersionMetadata" + } + } + ] + }, + "GetProcessorVersion": { + "requestType": "GetProcessorVersionRequest", + "responseType": "ProcessorVersion", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListProcessorVersions": { + "requestType": "ListProcessorVersionsRequest", + "responseType": "ListProcessorVersionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteProcessorVersion": { + "requestType": "DeleteProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteProcessorVersionMetadata" + } + } + ] + }, + "DeployProcessorVersion": { + "requestType": "DeployProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "DeployProcessorVersionResponse", + "(google.longrunning.operation_info).metadata_type": "DeployProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeployProcessorVersionResponse", + "metadata_type": "DeployProcessorVersionMetadata" + } + } + ] + }, + "UndeployProcessorVersion": { + "requestType": "UndeployProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "UndeployProcessorVersionResponse", + "(google.longrunning.operation_info).metadata_type": "UndeployProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UndeployProcessorVersionResponse", + "metadata_type": "UndeployProcessorVersionMetadata" + } + } + ] + }, + "CreateProcessor": { + "requestType": "CreateProcessorRequest", + "responseType": "Processor", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/processors", + "(google.api.http).body": "processor", + "(google.api.method_signature)": "parent,processor" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/processors", + "body": "processor" + } + }, + { + "(google.api.method_signature)": "parent,processor" + } + ] + }, + "DeleteProcessor": { + "requestType": "DeleteProcessorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/processors/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteProcessorMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/processors/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteProcessorMetadata" + } + } + ] + }, + "EnableProcessor": { + "requestType": "EnableProcessorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/processors/*}:enable", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "EnableProcessorResponse", + "(google.longrunning.operation_info).metadata_type": "EnableProcessorMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/processors/*}:enable", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "EnableProcessorResponse", + "metadata_type": "EnableProcessorMetadata" + } + } + ] + }, + "DisableProcessor": { + "requestType": "DisableProcessorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/processors/*}:disable", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "DisableProcessorResponse", + "(google.longrunning.operation_info).metadata_type": "DisableProcessorMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/processors/*}:disable", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DisableProcessorResponse", + "metadata_type": "DisableProcessorMetadata" + } + } + ] + }, + "SetDefaultProcessorVersion": { + "requestType": "SetDefaultProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "SetDefaultProcessorVersionResponse", + "(google.longrunning.operation_info).metadata_type": "SetDefaultProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "SetDefaultProcessorVersionResponse", + "metadata_type": "SetDefaultProcessorVersionMetadata" + } + } + ] + }, + "ReviewDocument": { + "requestType": "ReviewDocumentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument", + "(google.api.http).body": "*", + "(google.api.method_signature)": "human_review_config", + "(google.longrunning.operation_info).response_type": "ReviewDocumentResponse", + "(google.longrunning.operation_info).metadata_type": "ReviewDocumentOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument", + "body": "*" + } + }, + { + "(google.api.method_signature)": "human_review_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ReviewDocumentResponse", + "metadata_type": "ReviewDocumentOperationMetadata" + } + } + ] + }, + "EvaluateProcessorVersion": { + "requestType": "EvaluateProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion", + "(google.api.http).body": "*", + "(google.api.method_signature)": "processor_version", + "(google.longrunning.operation_info).response_type": "EvaluateProcessorVersionResponse", + "(google.longrunning.operation_info).metadata_type": "EvaluateProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion", + "body": "*" + } + }, + { + "(google.api.method_signature)": "processor_version" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "EvaluateProcessorVersionResponse", + "metadata_type": "EvaluateProcessorVersionMetadata" + } + } + ] + }, + "GetEvaluation": { + "requestType": "GetEvaluationRequest", + "responseType": "Evaluation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListEvaluations": { + "requestType": "ListEvaluationsRequest", + "responseType": "ListEvaluationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "ProcessOptions": { + "oneofs": { + "pageRange": { + "oneof": [ + "individualPageSelector", + "fromStart", + "fromEnd" + ] + } + }, + "fields": { + "individualPageSelector": { + "type": "IndividualPageSelector", + "id": 5 + }, + "fromStart": { + "type": "int32", + "id": 6 + }, + "fromEnd": { + "type": "int32", + "id": 7 + }, + "ocrConfig": { + "type": "OcrConfig", + "id": 1 + }, + "layoutConfig": { + "type": "LayoutConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schemaOverride": { + "type": "DocumentSchema", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "LayoutConfig": { + "fields": { + "chunkingConfig": { + "type": "ChunkingConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "returnImages": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "returnBoundingBoxes": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ChunkingConfig": { + "fields": { + "chunkSize": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "includeAncestorHeadings": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "IndividualPageSelector": { + "fields": { + "pages": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ProcessRequest": { + "oneofs": { + "source": { + "oneof": [ + "inlineDocument", + "rawDocument", + "gcsDocument" + ] + } + }, + "fields": { + "inlineDocument": { + "type": "Document", + "id": 4 + }, + "rawDocument": { + "type": "RawDocument", + "id": 5 + }, + "gcsDocument": { + "type": "GcsDocument", + "id": 8 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "skipHumanReview": { + "type": "bool", + "id": 3 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 6 + }, + "processOptions": { + "type": "ProcessOptions", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "imagelessMode": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "HumanReviewStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "stateMessage": { + "type": "string", + "id": 2 + }, + "humanReviewOperation": { + "type": "string", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "SKIPPED": 1, + "VALIDATION_PASSED": 2, + "IN_PROGRESS": 3, + "ERROR": 4 + } + } + } + }, + "ProcessResponse": { + "fields": { + "document": { + "type": "Document", + "id": 1 + }, + "humanReviewStatus": { + "type": "HumanReviewStatus", + "id": 3 + } + } + }, + "BatchProcessRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "inputDocuments": { + "type": "BatchDocumentsInputConfig", + "id": 5 + }, + "documentOutputConfig": { + "type": "DocumentOutputConfig", + "id": 6 + }, + "skipHumanReview": { + "type": "bool", + "id": 4 + }, + "processOptions": { + "type": "ProcessOptions", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchProcessResponse": { + "fields": {} + }, + "BatchProcessMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "stateMessage": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "individualProcessStatuses": { + "rule": "repeated", + "type": "IndividualProcessStatus", + "id": 5 + } + }, + "nested": { + "IndividualProcessStatus": { + "fields": { + "inputGcsSource": { + "type": "string", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + }, + "outputGcsDestination": { + "type": "string", + "id": 3 + }, + "humanReviewStatus": { + "type": "HumanReviewStatus", + "id": 5 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "WAITING": 1, + "RUNNING": 2, + "SUCCEEDED": 3, + "CANCELLING": 4, + "CANCELLED": 5, + "FAILED": 6 + } + } + } + }, + "FetchProcessorTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorType" + } + } + } + }, + "FetchProcessorTypesResponse": { + "fields": { + "processorTypes": { + "rule": "repeated", + "type": "ProcessorType", + "id": 1 + } + } + }, + "ListProcessorTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorType" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProcessorTypesResponse": { + "fields": { + "processorTypes": { + "rule": "repeated", + "type": "ProcessorType", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListProcessorsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "documentai.googleapis.com/Processor" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProcessorsResponse": { + "fields": { + "processors": { + "rule": "repeated", + "type": "Processor", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetProcessorTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorType" + } + } + } + }, + "GetProcessorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" + } + } + } + }, + "GetProcessorVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "ListProcessorVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorVersion" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProcessorVersionsResponse": { + "fields": { + "processorVersions": { + "rule": "repeated", + "type": "ProcessorVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteProcessorVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "DeleteProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "DeployProcessorVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "DeployProcessorVersionResponse": { + "fields": {} + }, + "DeployProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "UndeployProcessorVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "UndeployProcessorVersionResponse": { + "fields": {} + }, + "UndeployProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "CreateProcessorRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "documentai.googleapis.com/Processor" + } + }, + "processor": { + "type": "Processor", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteProcessorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" + } + } + } + }, + "DeleteProcessorMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 5 + } + } + }, + "EnableProcessorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" + } + } + } + }, + "EnableProcessorResponse": { + "fields": {} + }, + "EnableProcessorMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 5 + } + } + }, + "DisableProcessorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" + } + } + } + }, + "DisableProcessorResponse": { + "fields": {} + }, + "DisableProcessorMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 5 + } + } + }, + "SetDefaultProcessorVersionRequest": { + "fields": { + "processor": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" + } + }, + "defaultProcessorVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "SetDefaultProcessorVersionResponse": { + "fields": {} + }, + "SetDefaultProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "TrainProcessorVersionRequest": { + "oneofs": { + "processorFlags": { + "oneof": [ + "customDocumentExtractionOptions", + "foundationModelTuningOptions" + ] + } + }, + "fields": { + "customDocumentExtractionOptions": { + "type": "CustomDocumentExtractionOptions", + "id": 5 + }, + "foundationModelTuningOptions": { + "type": "FoundationModelTuningOptions", + "id": 12 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" + } + }, + "processorVersion": { + "type": "ProcessorVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "documentSchema": { + "type": "DocumentSchema", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputData": { + "type": "InputData", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "baseProcessorVersion": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "InputData": { + "fields": { + "trainingDocuments": { + "type": "BatchDocumentsInputConfig", + "id": 3 + }, + "testDocuments": { + "type": "BatchDocumentsInputConfig", + "id": 4 + } + } + }, + "CustomDocumentExtractionOptions": { + "fields": { + "trainingMethod": { + "type": "TrainingMethod", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TrainingMethod": { + "values": { + "TRAINING_METHOD_UNSPECIFIED": 0, + "MODEL_BASED": 1, + "TEMPLATE_BASED": 2 + } + } + } + }, + "FoundationModelTuningOptions": { + "fields": { + "trainSteps": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "learningRateMultiplier": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "TrainProcessorVersionResponse": { + "fields": { + "processorVersion": { + "type": "string", + "id": 1 + } + } + }, + "TrainProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + }, + "trainingDatasetValidation": { + "type": "DatasetValidation", + "id": 2 + }, + "testDatasetValidation": { + "type": "DatasetValidation", + "id": 3 + } + }, + "nested": { + "DatasetValidation": { + "fields": { + "documentErrorCount": { + "type": "int32", + "id": 3 + }, + "datasetErrorCount": { + "type": "int32", + "id": 4 + }, + "documentErrors": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 1 + }, + "datasetErrors": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + } + } + } + } + }, + "ReviewDocumentRequest": { + "oneofs": { + "source": { + "oneof": [ + "inlineDocument" + ] + } + }, + "fields": { + "inlineDocument": { + "type": "Document", + "id": 4 + }, + "humanReviewConfig": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/HumanReviewConfig" + } + }, + "enableSchemaValidation": { + "type": "bool", + "id": 3 + }, + "priority": { + "type": "Priority", + "id": 5 + }, + "documentSchema": { + "type": "DocumentSchema", + "id": 6 + } + }, + "nested": { + "Priority": { + "values": { + "DEFAULT": 0, + "URGENT": 1 + } + } + } + }, + "ReviewDocumentResponse": { + "fields": { + "gcsDestination": { + "type": "string", + "id": 1 + }, + "state": { + "type": "State", + "id": 2 + }, + "rejectionReason": { + "type": "string", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "REJECTED": 1, + "SUCCEEDED": 2 + } + } + } + }, + "ReviewDocumentOperationMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 5 + }, + "questionId": { + "type": "string", + "id": 6 + } + } + }, + "EvaluateProcessorVersionRequest": { + "fields": { + "processorVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + }, + "evaluationDocuments": { + "type": "BatchDocumentsInputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EvaluateProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "EvaluateProcessorVersionResponse": { + "fields": { + "evaluation": { + "type": "string", + "id": 2 + } + } + }, + "GetEvaluationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Evaluation" + } + } + } + }, + "ListEvaluationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListEvaluationsResponse": { + "fields": { + "evaluations": { + "rule": "repeated", + "type": "Evaluation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DocumentSchema": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "entityTypes": { + "rule": "repeated", + "type": "EntityType", + "id": 3 + }, + "metadata": { + "type": "Metadata", + "id": 4 + } + }, + "nested": { + "EntityType": { + "oneofs": { + "valueSource": { + "oneof": [ + "enumValues" + ] + } + }, + "fields": { + "enumValues": { + "type": "EnumValues", + "id": 14 + }, + "displayName": { + "type": "string", + "id": 13 + }, + "name": { + "type": "string", + "id": 1 + }, + "baseTypes": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "properties": { + "rule": "repeated", + "type": "Property", + "id": 6 + } + }, + "nested": { + "EnumValues": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Property": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 6 + }, + "valueType": { + "type": "string", + "id": 2 + }, + "occurrenceType": { + "type": "OccurrenceType", + "id": 3 + }, + "method": { + "type": "Method", + "id": 8 + } + }, + "nested": { + "OccurrenceType": { + "values": { + "OCCURRENCE_TYPE_UNSPECIFIED": 0, + "OPTIONAL_ONCE": 1, + "OPTIONAL_MULTIPLE": 2, + "REQUIRED_ONCE": 3, + "REQUIRED_MULTIPLE": 4 + } + }, + "Method": { + "values": { + "METHOD_UNSPECIFIED": 0, + "EXTRACT": 1, + "DERIVE": 2 + } + } + } + } + } + }, + "Metadata": { + "fields": { + "documentSplitter": { + "type": "bool", + "id": 1 + }, + "documentAllowMultipleLabels": { + "type": "bool", + "id": 2 + }, + "prefixedNamingOnProperties": { + "type": "bool", + "id": 6 + }, + "skipNamingValidation": { + "type": "bool", + "id": 7 + } + } + } + } + }, + "EvaluationReference": { + "fields": { + "operation": { + "type": "string", + "id": 1 + }, + "evaluation": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "documentai.googleapis.com/Evaluation" + } + }, + "aggregateMetrics": { + "type": "Evaluation.Metrics", + "id": 4 + }, + "aggregateMetricsExact": { + "type": "Evaluation.Metrics", + "id": 5 + } + } + }, + "Evaluation": { + "options": { + "(google.api.resource).type": "documentai.googleapis.com/Evaluation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "documentCounters": { + "type": "Counters", + "id": 5 + }, + "allEntitiesMetrics": { + "type": "MultiConfidenceMetrics", + "id": 3 + }, + "entityMetrics": { + "keyType": "string", + "type": "MultiConfidenceMetrics", + "id": 4 + }, + "kmsKeyName": { + "type": "string", + "id": 6 + }, + "kmsKeyVersionName": { + "type": "string", + "id": 7 + } + }, + "nested": { + "Counters": { + "fields": { + "inputDocumentsCount": { + "type": "int32", + "id": 1 + }, + "invalidDocumentsCount": { + "type": "int32", + "id": 2 + }, + "failedDocumentsCount": { + "type": "int32", + "id": 3 + }, + "evaluatedDocumentsCount": { + "type": "int32", + "id": 4 + } + } + }, + "Metrics": { + "fields": { + "precision": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "f1Score": { + "type": "float", + "id": 3 + }, + "predictedOccurrencesCount": { + "type": "int32", + "id": 4 + }, + "groundTruthOccurrencesCount": { + "type": "int32", + "id": 5 + }, + "predictedDocumentCount": { + "type": "int32", + "id": 10 + }, + "groundTruthDocumentCount": { + "type": "int32", + "id": 11 + }, + "truePositivesCount": { + "type": "int32", + "id": 6 + }, + "falsePositivesCount": { + "type": "int32", + "id": 7 + }, + "falseNegativesCount": { + "type": "int32", + "id": 8 + }, + "totalDocumentsCount": { + "type": "int32", + "id": 9 + } + } + }, + "ConfidenceLevelMetrics": { + "fields": { + "confidenceLevel": { + "type": "float", + "id": 1 + }, + "metrics": { + "type": "Metrics", + "id": 2 + } + } + }, + "MultiConfidenceMetrics": { + "fields": { + "confidenceLevelMetrics": { + "rule": "repeated", + "type": "ConfidenceLevelMetrics", + "id": 1 + }, + "confidenceLevelMetricsExact": { + "rule": "repeated", + "type": "ConfidenceLevelMetrics", + "id": 4 + }, + "auprc": { + "type": "float", + "id": 2 + }, + "estimatedCalibrationError": { + "type": "float", + "id": 3 + }, + "auprcExact": { + "type": "float", + "id": 5 + }, + "estimatedCalibrationErrorExact": { + "type": "float", + "id": 6 + }, + "metricsType": { + "type": "MetricsType", + "id": 7 + } + }, + "nested": { + "MetricsType": { + "values": { + "METRICS_TYPE_UNSPECIFIED": 0, + "AGGREGATE": 1 + } + } + } + } + } + }, + "CommonOperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "stateMessage": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "string", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "CANCELLING": 2, + "SUCCEEDED": 3, + "FAILED": 4, + "CANCELLED": 5 + } + } + } + }, + "ProcessorVersion": { + "options": { + "(google.api.resource).type": "documentai.googleapis.com/ProcessorVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "documentSchema": { + "type": "DocumentSchema", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latestEvaluation": { + "type": "EvaluationReference", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyName": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyVersionName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "googleManaged": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deprecationInfo": { + "type": "DeprecationInfo", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "modelType": { + "type": "ModelType", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "genAiModelInfo": { + "type": "GenAiModelInfo", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "DeprecationInfo": { + "fields": { + "deprecationTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "replacementProcessorVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "GenAiModelInfo": { + "oneofs": { + "modelInfo": { + "oneof": [ + "foundationGenAiModelInfo", + "customGenAiModelInfo" + ] + } + }, + "fields": { + "foundationGenAiModelInfo": { + "type": "FoundationGenAiModelInfo", + "id": 1 + }, + "customGenAiModelInfo": { + "type": "CustomGenAiModelInfo", + "id": 2 + } + }, + "nested": { + "FoundationGenAiModelInfo": { + "fields": { + "finetuningAllowed": { + "type": "bool", + "id": 1 + }, + "minTrainLabeledDocuments": { + "type": "int32", + "id": 2 + } + } + }, + "CustomGenAiModelInfo": { + "fields": { + "customModelType": { + "type": "CustomModelType", + "id": 1 + }, + "baseProcessorVersionId": { + "type": "string", + "id": 2 + } + }, + "nested": { + "CustomModelType": { + "values": { + "CUSTOM_MODEL_TYPE_UNSPECIFIED": 0, + "VERSIONED_FOUNDATION": 1, + "FINE_TUNED": 2 + } + } + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "DEPLOYED": 1, + "DEPLOYING": 2, + "UNDEPLOYED": 3, + "UNDEPLOYING": 4, + "CREATING": 5, + "DELETING": 6, + "FAILED": 7, + "IMPORTING": 8 + } + }, + "ModelType": { + "values": { + "MODEL_TYPE_UNSPECIFIED": 0, + "MODEL_TYPE_GENERATIVE": 1, + "MODEL_TYPE_CUSTOM": 2 + } + } + } + }, + "ProcessorVersionAlias": { + "fields": { + "alias": { + "type": "string", + "id": 1 + }, + "processorVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "Processor": { + "options": { + "(google.api.resource).type": "documentai.googleapis.com/Processor", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultProcessorVersion": { + "type": "string", + "id": 9, + "options": { + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + }, + "processorVersionAliases": { + "rule": "repeated", + "type": "ProcessorVersionAlias", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "processEndpoint": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyName": { + "type": "string", + "id": 8 + }, + "satisfiesPzs": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2, + "ENABLING": 3, + "DISABLING": 4, + "CREATING": 5, + "FAILED": 6, + "DELETING": 7 + } + } + } + }, + "ProcessorType": { + "options": { + "(google.api.resource).type": "documentai.googleapis.com/ProcessorType", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/processorTypes/{processor_type}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + }, + "category": { + "type": "string", + "id": 3 + }, + "availableLocations": { + "rule": "repeated", + "type": "LocationInfo", + "id": 4 + }, + "allowCreation": { + "type": "bool", + "id": 6 + }, + "launchStage": { + "type": "google.api.LaunchStage", + "id": 8 + }, + "sampleDocumentUris": { + "rule": "repeated", + "type": "string", + "id": 9 + } + }, + "nested": { + "LocationInfo": { + "fields": { + "locationId": { + "type": "string", + "id": 1 + } + } + } + } + } + } + }, + "v1beta3": { + "options": { + "csharp_namespace": "Google.Cloud.DocumentAI.V1Beta3", + "go_package": "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb", + "java_multiple_files": true, + "java_outer_classname": "DocumentAiDocumentService", + "java_package": "com.google.cloud.documentai.v1beta3", + "php_namespace": "Google\\Cloud\\DocumentAI\\V1beta3", + "ruby_package": "Google::Cloud::DocumentAI::V1beta3", + "(google.api.resource_definition).type": "documentai.googleapis.com/Location", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}" + }, + "nested": { + "Barcode": { + "fields": { + "format": { + "type": "string", + "id": 1 + }, + "valueFormat": { + "type": "string", + "id": 2 + }, + "rawValue": { + "type": "string", + "id": 3 + } + } + }, + "Dataset": { + "options": { + "(google.api.resource).type": "documentai.googleapis.com/Dataset", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/dataset" + }, + "oneofs": { + "storageSource": { + "oneof": [ + "gcsManagedConfig", + "documentWarehouseConfig", + "unmanagedDatasetConfig" + ] + } + }, + "fields": { + "gcsManagedConfig": { + "type": "GCSManagedConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "documentWarehouseConfig": { + "type": "DocumentWarehouseConfig", + "id": 5, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "unmanagedDatasetConfig": { + "type": "UnmanagedDatasetConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1 + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "GCSManagedConfig": { + "fields": { + "gcsPrefix": { + "type": "GcsPrefix", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DocumentWarehouseConfig": { + "fields": { + "collection": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "schema": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Schema" + } + } + } + }, + "UnmanagedDatasetConfig": { + "fields": {} + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "UNINITIALIZED": 1, + "INITIALIZING": 2, + "INITIALIZED": 3 + } + } + } + }, + "DocumentId": { + "oneofs": { + "type": { + "oneof": [ + "gcsManagedDocId", + "unmanagedDocId" + ] + } + }, + "fields": { + "gcsManagedDocId": { + "type": "GCSManagedDocumentId", + "id": 1 + }, + "unmanagedDocId": { + "type": "UnmanagedDocumentId", + "id": 4 + }, + "revisionRef": { + "type": "RevisionRef", + "id": 3 + } + }, + "nested": { + "GCSManagedDocumentId": { + "fields": { + "gcsUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cwDocId": { + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + } + } + }, + "UnmanagedDocumentId": { + "fields": { + "docId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "DatasetSchema": { + "options": { + "(google.api.resource).type": "documentai.googleapis.com/DatasetSchema", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "documentSchema": { + "type": "DocumentSchema", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BatchDatasetDocuments": { + "oneofs": { + "criteria": { + "oneof": [ + "individualDocumentIds", + "filter" + ] + } + }, + "fields": { + "individualDocumentIds": { + "type": "IndividualDocumentIds", + "id": 1 + }, + "filter": { + "type": "string", + "id": 2 + } + }, + "nested": { + "IndividualDocumentIds": { + "fields": { + "documentIds": { + "rule": "repeated", + "type": "DocumentId", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "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 + }, + "blobAssets": { + "rule": "repeated", + "type": "BlobAsset", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "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 + } + } + } + }, + "Annotations": { + "fields": { + "description": { + "type": "string", + "id": 1 + } + } + }, + "DocumentLayout": { + "fields": { + "blocks": { + "rule": "repeated", + "type": "DocumentLayoutBlock", + "id": 1 + } + }, + "nested": { + "DocumentLayoutBlock": { + "oneofs": { + "block": { + "oneof": [ + "textBlock", + "tableBlock", + "listBlock", + "imageBlock" + ] + } + }, + "fields": { + "textBlock": { + "type": "LayoutTextBlock", + "id": 2 + }, + "tableBlock": { + "type": "LayoutTableBlock", + "id": 3 + }, + "listBlock": { + "type": "LayoutListBlock", + "id": 4 + }, + "imageBlock": { + "type": "LayoutImageBlock", + "id": 7 + }, + "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 + }, + "annotations": { + "type": "Annotations", + "id": 4 + } + } + }, + "LayoutTableBlock": { + "fields": { + "headerRows": { + "rule": "repeated", + "type": "LayoutTableRow", + "id": 1 + }, + "bodyRows": { + "rule": "repeated", + "type": "LayoutTableRow", + "id": 2 + }, + "caption": { + "type": "string", + "id": 3 + }, + "annotations": { + "type": "Annotations", + "id": 4 + } + } + }, + "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 + } + } + }, + "LayoutImageBlock": { + "oneofs": { + "imageSource": { + "oneof": [ + "blobAssetId", + "gcsUri", + "dataUri" + ] + } + }, + "fields": { + "blobAssetId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcsUri": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mimeType": { + "type": "string", + "id": 1 + }, + "imageText": { + "type": "string", + "id": 2 + }, + "annotations": { + "type": "Annotations", + "id": 3 + } + } + } + } + } + } + }, + "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 + }, + "chunkFields": { + "rule": "repeated", + "type": "ChunkField", + "id": 7 + } + }, + "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 + } + } + }, + "ImageChunkField": { + "oneofs": { + "imageSource": { + "oneof": [ + "blobAssetId", + "gcsUri", + "dataUri" + ] + } + }, + "fields": { + "blobAssetId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gcsUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "annotations": { + "type": "Annotations", + "id": 4 + } + } + }, + "TableChunkField": { + "fields": { + "annotations": { + "type": "Annotations", + "id": 1 + } + } + }, + "ChunkField": { + "oneofs": { + "fieldType": { + "oneof": [ + "imageChunkField", + "tableChunkField" + ] + } + }, + "fields": { + "imageChunkField": { + "type": "ImageChunkField", + "id": 1 + }, + "tableChunkField": { + "type": "TableChunkField", + "id": 2 + } + } + } + } + } + } + }, + "BlobAsset": { + "fields": { + "assetId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "content": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mimeType": { + "type": "string", + "id": 3 + } + } + }, + "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 + }, + "provenance": { + "type": "Provenance", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "RevisionRef": { + "oneofs": { + "source": { + "oneof": [ + "revisionCase", + "revisionId", + "latestProcessorVersion" + ] + } + }, + "fields": { + "revisionCase": { + "type": "RevisionCase", + "id": 1 + }, + "revisionId": { + "type": "string", + "id": 2 + }, + "latestProcessorVersion": { + "type": "string", + "id": 3 + } + }, + "nested": { + "RevisionCase": { + "values": { + "REVISION_CASE_UNSPECIFIED": 0, + "LATEST_HUMAN_REVIEW": 1, + "LATEST_TIMESTAMP": 2, + "BASE_OCR_REVISION": 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 + } + } + }, + "Documents": { + "fields": { + "documents": { + "rule": "repeated", + "type": "Document", + "id": 1 + } + } + }, + "RawDocument": { + "fields": { + "content": { + "type": "bytes", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + } + } + }, + "GcsDocument": { + "fields": { + "gcsUri": { + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + } + } + }, + "GcsDocuments": { + "fields": { + "documents": { + "rule": "repeated", + "type": "GcsDocument", + "id": 1 + } + } + }, + "GcsPrefix": { + "fields": { + "gcsUriPrefix": { + "type": "string", + "id": 1 + } + } + }, + "RawDocuments": { + "fields": { + "documents": { + "rule": "repeated", + "type": "RawDocument", + "id": 1 + } + } + }, + "BatchDocumentsInputConfig": { + "oneofs": { + "source": { + "oneof": [ + "gcsPrefix", + "gcsDocuments" + ] + } + }, + "fields": { + "gcsPrefix": { + "type": "GcsPrefix", + "id": 1 + }, + "gcsDocuments": { + "type": "GcsDocuments", + "id": 2 + } + } + }, + "DocumentOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsOutputConfig" + ] + } + }, + "fields": { + "gcsOutputConfig": { + "type": "GcsOutputConfig", + "id": 1 + } + }, + "nested": { + "GcsOutputConfig": { + "fields": { + "gcsUri": { + "type": "string", + "id": 1 + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "shardingConfig": { + "type": "ShardingConfig", + "id": 3 + } + }, + "nested": { + "ShardingConfig": { + "fields": { + "pagesPerShard": { + "type": "int32", + "id": 1 + }, + "pagesOverlap": { + "type": "int32", + "id": 2 + } + } + } + } + } + } + }, + "OcrConfig": { + "fields": { + "hints": { + "type": "Hints", + "id": 2 + }, + "enableNativePdfParsing": { + "type": "bool", + "id": 3 + }, + "enableImageQualityScores": { + "type": "bool", + "id": 4 + }, + "advancedOcrOptions": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "enableSymbol": { + "type": "bool", + "id": 6 + }, + "computeStyleInfo": { + "type": "bool", + "id": 8, + "options": { + "deprecated": true + } + }, + "disableCharacterBoxesDetection": { + "type": "bool", + "id": 10 + }, + "premiumFeatures": { + "type": "PremiumFeatures", + "id": 11 + } + }, + "nested": { + "Hints": { + "fields": { + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "PremiumFeatures": { + "fields": { + "enableSelectionMarkDetection": { + "type": "bool", + "id": 3 + }, + "computeStyleInfo": { + "type": "bool", + "id": 4 + }, + "enableMathOcr": { + "type": "bool", + "id": 5 + } + } + } + } + }, + "SummaryOptions": { + "fields": { + "length": { + "type": "Length", + "id": 1 + }, + "format": { + "type": "Format", + "id": 2 + } + }, + "nested": { + "Length": { + "values": { + "LENGTH_UNSPECIFIED": 0, + "BRIEF": 1, + "MODERATE": 2, + "COMPREHENSIVE": 3 + } + }, + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "PARAGRAPH": 1, + "BULLETS": 2 + } + } + } + }, + "FieldExtractionMetadata": { + "fields": { + "summaryOptions": { + "type": "SummaryOptions", + "id": 2 + } + } + }, + "PropertyMetadata": { + "fields": { + "inactive": { + "type": "bool", + "id": 3 + }, + "fieldExtractionMetadata": { + "type": "FieldExtractionMetadata", + "id": 9 + } + } + }, + "EntityTypeMetadata": { + "fields": { + "inactive": { + "type": "bool", + "id": 5 + } + } + }, + "DocumentSchema": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "entityTypes": { + "rule": "repeated", + "type": "EntityType", + "id": 3 + }, + "metadata": { + "type": "Metadata", + "id": 4 + }, + "documentPrompt": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EntityType": { + "oneofs": { + "valueSource": { + "oneof": [ + "enumValues" + ] + } + }, + "fields": { + "enumValues": { + "type": "EnumValues", + "id": 14 + }, + "displayName": { + "type": "string", + "id": 13 + }, + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 15 + }, + "baseTypes": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "properties": { + "rule": "repeated", + "type": "Property", + "id": 6 + }, + "entityTypeMetadata": { + "type": "EntityTypeMetadata", + "id": 11 + } + }, + "nested": { + "EnumValues": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Property": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 7 + }, + "displayName": { + "type": "string", + "id": 6 + }, + "valueType": { + "type": "string", + "id": 2 + }, + "occurrenceType": { + "type": "OccurrenceType", + "id": 3 + }, + "method": { + "type": "Method", + "id": 8 + }, + "propertyMetadata": { + "type": "PropertyMetadata", + "id": 5 + } + }, + "nested": { + "OccurrenceType": { + "values": { + "OCCURRENCE_TYPE_UNSPECIFIED": 0, + "OPTIONAL_ONCE": 1, + "OPTIONAL_MULTIPLE": 2, + "REQUIRED_ONCE": 3, + "REQUIRED_MULTIPLE": 4 + } + }, + "Method": { + "values": { + "METHOD_UNSPECIFIED": 0, + "EXTRACT": 1, + "DERIVE": 2 + } + } + } + } + } + }, + "Metadata": { + "fields": { + "documentSplitter": { + "type": "bool", + "id": 1 + }, + "documentAllowMultipleLabels": { + "type": "bool", + "id": 2 + }, + "prefixedNamingOnProperties": { + "type": "bool", + "id": 6 + }, + "skipNamingValidation": { + "type": "bool", + "id": 7 + } + } + } + } + }, + "DocumentProcessorService": { + "options": { + "(google.api.default_host)": "documentai.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ProcessDocument": { + "requestType": "ProcessRequest", + "responseType": "ProcessResponse", + "options": { + "(google.api.http).post": "/v1beta3/{name=projects/*/locations/*/processors/*}:process", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{name=projects/*/locations/*/processors/*}:process", + "body": "*", + "additional_bindings": { + "post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchProcessDocuments": { + "requestType": "BatchProcessRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "BatchProcessResponse", + "(google.longrunning.operation_info).metadata_type": "BatchProcessMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess", + "body": "*", + "additional_bindings": { + "post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchProcessResponse", + "metadata_type": "BatchProcessMetadata" + } + } + ] + }, + "FetchProcessorTypes": { + "requestType": "FetchProcessorTypesRequest", + "responseType": "FetchProcessorTypesResponse", + "options": { + "(google.api.http).get": "/v1beta3/{parent=projects/*/locations/*}:fetchProcessorTypes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{parent=projects/*/locations/*}:fetchProcessorTypes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListProcessorTypes": { + "requestType": "ListProcessorTypesRequest", + "responseType": "ListProcessorTypesResponse", + "options": { + "(google.api.http).get": "/v1beta3/{parent=projects/*/locations/*}/processorTypes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{parent=projects/*/locations/*}/processorTypes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetProcessorType": { + "requestType": "GetProcessorTypeRequest", + "responseType": "ProcessorType", + "options": { + "(google.api.http).get": "/v1beta3/{name=projects/*/locations/*/processorTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{name=projects/*/locations/*/processorTypes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListProcessors": { + "requestType": "ListProcessorsRequest", + "responseType": "ListProcessorsResponse", + "options": { + "(google.api.http).get": "/v1beta3/{parent=projects/*/locations/*}/processors", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{parent=projects/*/locations/*}/processors" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetProcessor": { + "requestType": "GetProcessorRequest", + "responseType": "Processor", + "options": { + "(google.api.http).get": "/v1beta3/{name=projects/*/locations/*/processors/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{name=projects/*/locations/*/processors/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "TrainProcessorVersion": { + "requestType": "TrainProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:train", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,processor_version", + "(google.longrunning.operation_info).response_type": "TrainProcessorVersionResponse", + "(google.longrunning.operation_info).metadata_type": "TrainProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:train", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,processor_version" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TrainProcessorVersionResponse", + "metadata_type": "TrainProcessorVersionMetadata" + } + } + ] + }, + "GetProcessorVersion": { + "requestType": "GetProcessorVersionRequest", + "responseType": "ProcessorVersion", + "options": { + "(google.api.http).get": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListProcessorVersions": { + "requestType": "ListProcessorVersionsRequest", + "responseType": "ListProcessorVersionsResponse", + "options": { + "(google.api.http).get": "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteProcessorVersion": { + "requestType": "DeleteProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteProcessorVersionMetadata" + } + } + ] + }, + "DeployProcessorVersion": { + "requestType": "DeployProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "DeployProcessorVersionResponse", + "(google.longrunning.operation_info).metadata_type": "DeployProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeployProcessorVersionResponse", + "metadata_type": "DeployProcessorVersionMetadata" + } + } + ] + }, + "UndeployProcessorVersion": { + "requestType": "UndeployProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "UndeployProcessorVersionResponse", + "(google.longrunning.operation_info).metadata_type": "UndeployProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UndeployProcessorVersionResponse", + "metadata_type": "UndeployProcessorVersionMetadata" + } + } + ] + }, + "CreateProcessor": { + "requestType": "CreateProcessorRequest", + "responseType": "Processor", + "options": { + "(google.api.http).post": "/v1beta3/{parent=projects/*/locations/*}/processors", + "(google.api.http).body": "processor", + "(google.api.method_signature)": "parent,processor" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{parent=projects/*/locations/*}/processors", + "body": "processor" + } + }, + { + "(google.api.method_signature)": "parent,processor" + } + ] + }, + "DeleteProcessor": { + "requestType": "DeleteProcessorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta3/{name=projects/*/locations/*/processors/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteProcessorMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta3/{name=projects/*/locations/*/processors/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteProcessorMetadata" + } + } + ] + }, + "EnableProcessor": { + "requestType": "EnableProcessorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta3/{name=projects/*/locations/*/processors/*}:enable", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "EnableProcessorResponse", + "(google.longrunning.operation_info).metadata_type": "EnableProcessorMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{name=projects/*/locations/*/processors/*}:enable", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "EnableProcessorResponse", + "metadata_type": "EnableProcessorMetadata" + } + } + ] + }, + "DisableProcessor": { + "requestType": "DisableProcessorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta3/{name=projects/*/locations/*/processors/*}:disable", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "DisableProcessorResponse", + "(google.longrunning.operation_info).metadata_type": "DisableProcessorMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{name=projects/*/locations/*/processors/*}:disable", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DisableProcessorResponse", + "metadata_type": "DisableProcessorMetadata" + } + } + ] + }, + "SetDefaultProcessorVersion": { + "requestType": "SetDefaultProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "SetDefaultProcessorVersionResponse", + "(google.longrunning.operation_info).metadata_type": "SetDefaultProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "SetDefaultProcessorVersionResponse", + "metadata_type": "SetDefaultProcessorVersionMetadata" + } + } + ] + }, + "ReviewDocument": { + "requestType": "ReviewDocumentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "deprecated": true, + "(google.api.http).post": "/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument", + "(google.api.http).body": "*", + "(google.api.method_signature)": "human_review_config", + "(google.longrunning.operation_info).response_type": "ReviewDocumentResponse", + "(google.longrunning.operation_info).metadata_type": "ReviewDocumentOperationMetadata" + }, + "parsedOptions": [ + { + "deprecated": true + }, + { + "(google.api.http)": { + "post": "/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument", + "body": "*" + } + }, + { + "(google.api.method_signature)": "human_review_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ReviewDocumentResponse", + "metadata_type": "ReviewDocumentOperationMetadata" + } + } + ] + }, + "EvaluateProcessorVersion": { + "requestType": "EvaluateProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta3/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion", + "(google.api.http).body": "*", + "(google.api.method_signature)": "processor_version", + "(google.longrunning.operation_info).response_type": "EvaluateProcessorVersionResponse", + "(google.longrunning.operation_info).metadata_type": "EvaluateProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion", + "body": "*" + } + }, + { + "(google.api.method_signature)": "processor_version" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "EvaluateProcessorVersionResponse", + "metadata_type": "EvaluateProcessorVersionMetadata" + } + } + ] + }, + "GetEvaluation": { + "requestType": "GetEvaluationRequest", + "responseType": "Evaluation", + "options": { + "(google.api.http).get": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListEvaluations": { + "requestType": "ListEvaluationsRequest", + "responseType": "ListEvaluationsResponse", + "options": { + "(google.api.http).get": "/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ImportProcessorVersion": { + "requestType": "ImportProcessorVersionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:importProcessorVersion", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "ImportProcessorVersionResponse", + "(google.longrunning.operation_info).metadata_type": "ImportProcessorVersionMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:importProcessorVersion", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportProcessorVersionResponse", + "metadata_type": "ImportProcessorVersionMetadata" + } + } + ] + } + } + }, + "ProcessOptions": { + "oneofs": { + "pageRange": { + "oneof": [ + "individualPageSelector", + "fromStart", + "fromEnd" + ] + } + }, + "fields": { + "individualPageSelector": { + "type": "IndividualPageSelector", + "id": 5 + }, + "fromStart": { + "type": "int32", + "id": 6 + }, + "fromEnd": { + "type": "int32", + "id": 7 + }, + "ocrConfig": { + "type": "OcrConfig", + "id": 1 + }, + "layoutConfig": { + "type": "LayoutConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "schemaOverride": { + "type": "DocumentSchema", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "LayoutConfig": { + "fields": { + "chunkingConfig": { + "type": "ChunkingConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "returnImages": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "returnBoundingBoxes": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableImageAnnotation": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableImageExtraction": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableLlmLayoutParsing": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableTableAnnotation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableTableSplit": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ChunkingConfig": { + "fields": { + "chunkSize": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "includeAncestorHeadings": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "semanticChunkingGroupSize": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "breakpointPercentileThreshold": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "IndividualPageSelector": { + "fields": { + "pages": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ProcessRequest": { + "oneofs": { + "source": { + "oneof": [ + "inlineDocument", + "rawDocument", + "gcsDocument" + ] + } + }, + "fields": { + "inlineDocument": { + "type": "Document", + "id": 4 + }, + "rawDocument": { + "type": "RawDocument", + "id": 5 + }, + "gcsDocument": { + "type": "GcsDocument", + "id": 8 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "document": { + "type": "Document", + "id": 2, + "options": { + "deprecated": true + } + }, + "skipHumanReview": { + "type": "bool", + "id": 3, + "options": { + "deprecated": true + } + }, + "fieldMask": { + "type": "google.protobuf.FieldMask", + "id": 6 + }, + "processOptions": { + "type": "ProcessOptions", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "imagelessMode": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "HumanReviewStatus": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "stateMessage": { + "type": "string", + "id": 2 + }, + "humanReviewOperation": { + "type": "string", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "SKIPPED": 1, + "VALIDATION_PASSED": 2, + "IN_PROGRESS": 3, + "ERROR": 4 + } + } + } + }, + "ProcessResponse": { + "fields": { + "document": { + "type": "Document", + "id": 1 + }, + "humanReviewOperation": { + "type": "string", + "id": 2, + "options": { + "deprecated": true + } + }, + "humanReviewStatus": { + "type": "HumanReviewStatus", + "id": 3 + } + } + }, + "BatchProcessRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "inputConfigs": { + "rule": "repeated", + "type": "BatchInputConfig", + "id": 2, + "options": { + "deprecated": true + } + }, + "outputConfig": { + "type": "BatchOutputConfig", + "id": 3, + "options": { + "deprecated": true + } + }, + "inputDocuments": { + "type": "BatchDocumentsInputConfig", + "id": 5 + }, + "documentOutputConfig": { + "type": "DocumentOutputConfig", + "id": 6 + }, + "skipHumanReview": { + "type": "bool", + "id": 4, + "options": { + "deprecated": true + } + }, + "processOptions": { + "type": "ProcessOptions", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BatchInputConfig": { + "options": { + "deprecated": true + }, + "fields": { + "gcsSource": { + "type": "string", + "id": 1 + }, + "mimeType": { + "type": "string", + "id": 2 + } + } + }, + "BatchOutputConfig": { + "options": { + "deprecated": true + }, + "fields": { + "gcsDestination": { + "type": "string", + "id": 1 + } + } + } + } + }, + "BatchProcessResponse": { + "fields": {} + }, + "BatchProcessMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "stateMessage": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "individualProcessStatuses": { + "rule": "repeated", + "type": "IndividualProcessStatus", + "id": 5 + } + }, + "nested": { + "IndividualProcessStatus": { + "fields": { + "inputGcsSource": { + "type": "string", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + }, + "outputGcsDestination": { + "type": "string", + "id": 3 + }, + "humanReviewOperation": { + "type": "string", + "id": 4, + "options": { + "deprecated": true + } + }, + "humanReviewStatus": { + "type": "HumanReviewStatus", + "id": 5 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "WAITING": 1, + "RUNNING": 2, + "SUCCEEDED": 3, + "CANCELLING": 4, + "CANCELLED": 5, + "FAILED": 6 + } + } + } + }, + "FetchProcessorTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorType" + } + } + } + }, + "FetchProcessorTypesResponse": { + "fields": { + "processorTypes": { + "rule": "repeated", + "type": "ProcessorType", + "id": 1 + } + } + }, + "ListProcessorTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorType" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProcessorTypesResponse": { + "fields": { + "processorTypes": { + "rule": "repeated", + "type": "ProcessorType", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ListProcessorsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "documentai.googleapis.com/Processor" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProcessorsResponse": { + "fields": { + "processors": { + "rule": "repeated", + "type": "Processor", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetProcessorTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorType" + } + } + } + }, + "GetProcessorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" + } + } + } + }, + "GetProcessorVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "ListProcessorVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorVersion" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListProcessorVersionsResponse": { + "fields": { + "processorVersions": { + "rule": "repeated", + "type": "ProcessorVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteProcessorVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "DeleteProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "DeployProcessorVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "DeployProcessorVersionResponse": { + "fields": {} + }, + "DeployProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "UndeployProcessorVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "UndeployProcessorVersionResponse": { + "fields": {} + }, + "UndeployProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "CreateProcessorRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "documentai.googleapis.com/Processor" + } + }, + "processor": { + "type": "Processor", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteProcessorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" + } + } + } + }, + "DeleteProcessorMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 5 + } + } + }, + "EnableProcessorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" + } + } + } + }, + "EnableProcessorResponse": { + "fields": {} + }, + "EnableProcessorMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 5 + } + } + }, + "DisableProcessorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" + } + } + } + }, + "DisableProcessorResponse": { + "fields": {} + }, + "DisableProcessorMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 5 + } + } + }, + "SetDefaultProcessorVersionRequest": { + "fields": { + "processor": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" + } + }, + "defaultProcessorVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "SetDefaultProcessorVersionResponse": { + "fields": {} + }, + "SetDefaultProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "TrainProcessorVersionRequest": { + "oneofs": { + "processorFlags": { + "oneof": [ + "customDocumentExtractionOptions", + "foundationModelTuningOptions" + ] + } + }, + "fields": { + "customDocumentExtractionOptions": { + "type": "CustomDocumentExtractionOptions", + "id": 5 + }, + "foundationModelTuningOptions": { + "type": "FoundationModelTuningOptions", + "id": 12 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" + } + }, + "processorVersion": { + "type": "ProcessorVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "documentSchema": { + "type": "DocumentSchema", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "inputData": { + "type": "InputData", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "baseProcessorVersion": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "InputData": { + "fields": { + "trainingDocuments": { + "type": "BatchDocumentsInputConfig", + "id": 3 + }, + "testDocuments": { + "type": "BatchDocumentsInputConfig", + "id": 4 + } + } + }, + "CustomDocumentExtractionOptions": { + "fields": { + "trainingMethod": { + "type": "TrainingMethod", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TrainingMethod": { + "values": { + "TRAINING_METHOD_UNSPECIFIED": 0, + "MODEL_BASED": 1, + "TEMPLATE_BASED": 2 + } + } + } + }, + "FoundationModelTuningOptions": { + "fields": { + "trainSteps": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "learningRateMultiplier": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "TrainProcessorVersionResponse": { + "fields": { + "processorVersion": { + "type": "string", + "id": 1 + } + } + }, + "TrainProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + }, + "trainingDatasetValidation": { + "type": "DatasetValidation", + "id": 2 + }, + "testDatasetValidation": { + "type": "DatasetValidation", + "id": 3 + } + }, + "nested": { + "DatasetValidation": { + "fields": { + "documentErrorCount": { + "type": "int32", + "id": 3 + }, + "datasetErrorCount": { + "type": "int32", + "id": 4 + }, + "documentErrors": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 1 + }, + "datasetErrors": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 2 + } + } + } + } + }, + "ReviewDocumentRequest": { + "oneofs": { + "source": { + "oneof": [ + "inlineDocument" + ] + } + }, + "fields": { + "inlineDocument": { + "type": "Document", + "id": 4 + }, + "humanReviewConfig": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/HumanReviewConfig" + } + }, + "document": { + "type": "Document", + "id": 2, + "options": { + "deprecated": true + } + }, + "enableSchemaValidation": { + "type": "bool", + "id": 3 + }, + "priority": { + "type": "Priority", + "id": 5 + }, + "documentSchema": { + "type": "DocumentSchema", + "id": 6 + } + }, + "nested": { + "Priority": { + "values": { + "DEFAULT": 0, + "URGENT": 1 + } + } + } + }, + "ReviewDocumentResponse": { + "fields": { + "gcsDestination": { + "type": "string", + "id": 1 + }, + "state": { + "type": "State", + "id": 2 + }, + "rejectionReason": { + "type": "string", + "id": 3 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "REJECTED": 1, + "SUCCEEDED": 2 + } + } + } + }, + "ReviewDocumentOperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "stateMessage": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 5 + }, + "questionId": { + "type": "string", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "CANCELLING": 2, + "SUCCEEDED": 3, + "FAILED": 4, + "CANCELLED": 5 + } + } + } + }, + "EvaluateProcessorVersionRequest": { + "fields": { + "processorVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + }, + "evaluationDocuments": { + "type": "BatchDocumentsInputConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EvaluateProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "EvaluateProcessorVersionResponse": { + "fields": { + "evaluation": { + "type": "string", + "id": 2 + } + } + }, + "GetEvaluationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Evaluation" + } + } + } + }, + "ListEvaluationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListEvaluationsResponse": { + "fields": { + "evaluations": { + "rule": "repeated", + "type": "Evaluation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ImportProcessorVersionRequest": { + "oneofs": { + "source": { + "oneof": [ + "processorVersionSource", + "externalProcessorVersionSource" + ] + } + }, + "fields": { + "processorVersionSource": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + }, + "externalProcessorVersionSource": { + "type": "ExternalProcessorVersionSource", + "id": 3 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorVersion" + } + } + }, + "nested": { + "ExternalProcessorVersionSource": { + "fields": { + "processorVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "serviceEndpoint": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "ImportProcessorVersionResponse": { + "fields": { + "processorVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "ImportProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "UpdateProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "EvaluationReference": { + "fields": { + "operation": { + "type": "string", + "id": 1 + }, + "evaluation": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "documentai.googleapis.com/Evaluation" + } + }, + "aggregateMetrics": { + "type": "Evaluation.Metrics", + "id": 4 + }, + "aggregateMetricsExact": { + "type": "Evaluation.Metrics", + "id": 5 + } + } + }, + "Evaluation": { + "options": { + "(google.api.resource).type": "documentai.googleapis.com/Evaluation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "documentCounters": { + "type": "Counters", + "id": 5 + }, + "allEntitiesMetrics": { + "type": "MultiConfidenceMetrics", + "id": 3 + }, + "entityMetrics": { + "keyType": "string", + "type": "MultiConfidenceMetrics", + "id": 4 + }, + "kmsKeyName": { + "type": "string", + "id": 6 + }, + "kmsKeyVersionName": { + "type": "string", + "id": 7 + }, + "revisions": { + "rule": "repeated", + "type": "EvaluationRevision", + "id": 9 + } + }, + "nested": { + "Counters": { + "fields": { + "inputDocumentsCount": { + "type": "int32", + "id": 1 + }, + "invalidDocumentsCount": { + "type": "int32", + "id": 2 + }, + "failedDocumentsCount": { + "type": "int32", + "id": 3 + }, + "evaluatedDocumentsCount": { + "type": "int32", + "id": 4 + } + } + }, + "Metrics": { + "fields": { + "precision": { + "type": "float", + "id": 1 + }, + "recall": { + "type": "float", + "id": 2 + }, + "f1Score": { + "type": "float", + "id": 3 + }, + "predictedOccurrencesCount": { + "type": "int32", + "id": 4 + }, + "groundTruthOccurrencesCount": { + "type": "int32", + "id": 5 + }, + "predictedDocumentCount": { + "type": "int32", + "id": 10 + }, + "groundTruthDocumentCount": { + "type": "int32", + "id": 11 + }, + "truePositivesCount": { + "type": "int32", + "id": 6 + }, + "falsePositivesCount": { + "type": "int32", + "id": 7 + }, + "falseNegativesCount": { + "type": "int32", + "id": 8 + }, + "totalDocumentsCount": { + "type": "int32", + "id": 9 + } + } + }, + "ConfidenceLevelMetrics": { + "fields": { + "confidenceLevel": { + "type": "float", + "id": 1 + }, + "metrics": { + "type": "Metrics", + "id": 2 + } + } + }, + "MultiConfidenceMetrics": { + "fields": { + "confidenceLevelMetrics": { + "rule": "repeated", + "type": "ConfidenceLevelMetrics", + "id": 1 + }, + "confidenceLevelMetricsExact": { + "rule": "repeated", + "type": "ConfidenceLevelMetrics", + "id": 4 + }, + "auprc": { + "type": "float", + "id": 2 + }, + "estimatedCalibrationError": { + "type": "float", + "id": 3 + }, + "auprcExact": { + "type": "float", + "id": 5 + }, + "estimatedCalibrationErrorExact": { + "type": "float", + "id": 6 + }, + "metricsType": { + "type": "MetricsType", + "id": 7 + } + }, + "nested": { + "MetricsType": { + "values": { + "METRICS_TYPE_UNSPECIFIED": 0, + "AGGREGATE": 1 + } + } + } + }, + "EvaluationRevision": { + "fields": { + "revisionId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentCounters": { + "type": "Counters", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "allEntitiesMetrics": { + "type": "MultiConfidenceMetrics", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "entityMetrics": { + "keyType": "string", + "type": "MultiConfidenceMetrics", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "CommonOperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1 + }, + "stateMessage": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "string", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RUNNING": 1, + "CANCELLING": 2, + "SUCCEEDED": 3, + "FAILED": 4, + "CANCELLED": 5 + } + } + } + }, + "ProcessorVersion": { + "options": { + "(google.api.resource).type": "documentai.googleapis.com/ProcessorVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "documentSchema": { + "type": "DocumentSchema", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latestEvaluation": { + "type": "EvaluationReference", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyName": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyVersionName": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "googleManaged": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deprecationInfo": { + "type": "DeprecationInfo", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "modelType": { + "type": "ModelType", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "genAiModelInfo": { + "type": "GenAiModelInfo", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "DeprecationInfo": { + "fields": { + "deprecationTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "replacementProcessorVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "GenAiModelInfo": { + "oneofs": { + "modelInfo": { + "oneof": [ + "foundationGenAiModelInfo", + "customGenAiModelInfo" + ] + } + }, + "fields": { + "foundationGenAiModelInfo": { + "type": "FoundationGenAiModelInfo", + "id": 1 + }, + "customGenAiModelInfo": { + "type": "CustomGenAiModelInfo", + "id": 2 + } + }, + "nested": { + "FoundationGenAiModelInfo": { + "fields": { + "finetuningAllowed": { + "type": "bool", + "id": 1 + }, + "minTrainLabeledDocuments": { + "type": "int32", + "id": 2 + } + } + }, + "CustomGenAiModelInfo": { + "fields": { + "customModelType": { + "type": "CustomModelType", + "id": 1 + }, + "baseProcessorVersionId": { + "type": "string", + "id": 2 + } + }, + "nested": { + "CustomModelType": { + "values": { + "CUSTOM_MODEL_TYPE_UNSPECIFIED": 0, + "VERSIONED_FOUNDATION": 1, + "FINE_TUNED": 2 + } + } + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "DEPLOYED": 1, + "DEPLOYING": 2, + "UNDEPLOYED": 3, + "UNDEPLOYING": 4, + "CREATING": 5, + "DELETING": 6, + "FAILED": 7, + "IMPORTING": 8 + } + }, + "ModelType": { + "values": { + "MODEL_TYPE_UNSPECIFIED": 0, + "MODEL_TYPE_GENERATIVE": 1, + "MODEL_TYPE_CUSTOM": 2 + } + } + } + }, + "ProcessorVersionAlias": { + "fields": { + "alias": { + "type": "string", + "id": 1 + }, + "processorVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + } + } + }, + "Processor": { + "options": { + "(google.api.resource).type": "documentai.googleapis.com/Processor", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "string", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultProcessorVersion": { + "type": "string", + "id": 9, + "options": { + "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" + } + }, + "processorVersionAliases": { + "rule": "repeated", + "type": "ProcessorVersionAlias", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "processEndpoint": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyName": { + "type": "string", + "id": 8 + }, + "satisfiesPzs": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2, + "ENABLING": 3, + "DISABLING": 4, + "CREATING": 5, + "FAILED": 6, + "DELETING": 7 + } + } + } + }, + "ProcessorType": { + "options": { + "(google.api.resource).type": "documentai.googleapis.com/ProcessorType", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/processorTypes/{processor_type}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + }, + "category": { + "type": "string", + "id": 3 + }, + "availableLocations": { + "rule": "repeated", + "type": "LocationInfo", + "id": 4 + }, + "allowCreation": { + "type": "bool", + "id": 6 + }, + "launchStage": { + "type": "google.api.LaunchStage", + "id": 8 + }, + "sampleDocumentUris": { + "rule": "repeated", + "type": "string", + "id": 9 + } + }, + "nested": { + "LocationInfo": { + "fields": { + "locationId": { + "type": "string", + "id": 1 + } + } + } + } + }, + "DocumentService": { + "options": { + "(google.api.default_host)": "documentai.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "UpdateDataset": { + "requestType": "UpdateDatasetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta3/{dataset.name=projects/*/locations/*/processors/*/dataset}", + "(google.api.http).body": "dataset", + "(google.api.method_signature)": "dataset,update_mask", + "(google.longrunning.operation_info).response_type": "Dataset", + "(google.longrunning.operation_info).metadata_type": "UpdateDatasetOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta3/{dataset.name=projects/*/locations/*/processors/*/dataset}", + "body": "dataset" + } + }, + { + "(google.api.method_signature)": "dataset,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Dataset", + "metadata_type": "UpdateDatasetOperationMetadata" + } + } + ] + }, + "ImportDocuments": { + "requestType": "ImportDocumentsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:importDocuments", + "(google.api.http).body": "*", + "(google.api.method_signature)": "dataset", + "(google.longrunning.operation_info).response_type": "ImportDocumentsResponse", + "(google.longrunning.operation_info).metadata_type": "ImportDocumentsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:importDocuments", + "body": "*" + } + }, + { + "(google.api.method_signature)": "dataset" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportDocumentsResponse", + "metadata_type": "ImportDocumentsMetadata" + } + } + ] + }, + "GetDocument": { + "requestType": "GetDocumentRequest", + "responseType": "GetDocumentResponse", + "options": { + "(google.api.http).get": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:getDocument", + "(google.api.method_signature)": "dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:getDocument" + } + }, + { + "(google.api.method_signature)": "dataset" + } + ] + }, + "ListDocuments": { + "requestType": "ListDocumentsRequest", + "responseType": "ListDocumentsResponse", + "options": { + "(google.api.http).post": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:listDocuments", + "(google.api.http).body": "*", + "(google.api.method_signature)": "dataset" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:listDocuments", + "body": "*" + } + }, + { + "(google.api.method_signature)": "dataset" + } + ] + }, + "BatchDeleteDocuments": { + "requestType": "BatchDeleteDocumentsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:batchDeleteDocuments", + "(google.api.http).body": "*", + "(google.api.method_signature)": "dataset", + "(google.longrunning.operation_info).response_type": "BatchDeleteDocumentsResponse", + "(google.longrunning.operation_info).metadata_type": "BatchDeleteDocumentsMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:batchDeleteDocuments", + "body": "*" + } + }, + { + "(google.api.method_signature)": "dataset" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BatchDeleteDocumentsResponse", + "metadata_type": "BatchDeleteDocumentsMetadata" + } + } + ] + }, + "GetDatasetSchema": { + "requestType": "GetDatasetSchemaRequest", + "responseType": "DatasetSchema", + "options": { + "(google.api.http).get": "/v1beta3/{name=projects/*/locations/*/processors/*/dataset/datasetSchema}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta3/{name=projects/*/locations/*/processors/*/dataset/datasetSchema}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateDatasetSchema": { + "requestType": "UpdateDatasetSchemaRequest", + "responseType": "DatasetSchema", + "options": { + "(google.api.http).patch": "/v1beta3/{dataset_schema.name=projects/*/locations/*/processors/*/dataset/datasetSchema}", + "(google.api.http).body": "dataset_schema", + "(google.api.method_signature)": "dataset_schema,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta3/{dataset_schema.name=projects/*/locations/*/processors/*/dataset/datasetSchema}", + "body": "dataset_schema" + } + }, + { + "(google.api.method_signature)": "dataset_schema,update_mask" + } + ] + } + } + }, + "DatasetSplitType": { + "values": { + "DATASET_SPLIT_TYPE_UNSPECIFIED": 0, + "DATASET_SPLIT_TRAIN": 1, + "DATASET_SPLIT_TEST": 2, + "DATASET_SPLIT_UNASSIGNED": 3 + } + }, + "DocumentLabelingState": { + "values": { + "DOCUMENT_LABELING_STATE_UNSPECIFIED": 0, + "DOCUMENT_LABELED": 1, + "DOCUMENT_UNLABELED": 2, + "DOCUMENT_AUTO_LABELED": 3 + } + }, + "UpdateDatasetRequest": { + "fields": { + "dataset": { + "type": "Dataset", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "UpdateDatasetOperationMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, + "ImportDocumentsRequest": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Dataset" + } + }, + "batchDocumentsImportConfigs": { + "rule": "repeated", + "type": "BatchDocumentsImportConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "BatchDocumentsImportConfig": { + "oneofs": { + "splitTypeConfig": { + "oneof": [ + "datasetSplit", + "autoSplitConfig" + ] + } + }, + "fields": { + "datasetSplit": { + "type": "DatasetSplitType", + "id": 2 + }, + "autoSplitConfig": { + "type": "AutoSplitConfig", + "id": 3 + }, + "batchInputConfig": { + "type": "BatchDocumentsInputConfig", + "id": 1 + }, + "documentType": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AutoSplitConfig": { + "fields": { + "trainingSplitRatio": { + "type": "float", + "id": 1 + } + } + } + } + } + } + }, + "ImportDocumentsResponse": { + "fields": {} + }, + "ImportDocumentsMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + }, + "individualImportStatuses": { + "rule": "repeated", + "type": "IndividualImportStatus", + "id": 2 + }, + "importConfigValidationResults": { + "rule": "repeated", + "type": "ImportConfigValidationResult", + "id": 4 + }, + "totalDocumentCount": { + "type": "int32", + "id": 3 + } + }, + "nested": { + "IndividualImportStatus": { + "fields": { + "inputGcsSource": { + "type": "string", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + }, + "outputDocumentId": { + "type": "DocumentId", + "id": 4 + } + } + }, + "ImportConfigValidationResult": { + "fields": { + "inputGcsSource": { + "type": "string", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + } + } + } + } + }, + "GetDocumentRequest": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Dataset" + } + }, + "documentId": { + "type": "DocumentId", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "readMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + }, + "pageRange": { + "type": "DocumentPageRange", + "id": 4 + } + } + }, + "GetDocumentResponse": { + "fields": { + "document": { + "type": "Document", + "id": 1 + } + } + }, + "ListDocumentsRequest": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/Dataset" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "returnTotalSize": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "skip": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDocumentsResponse": { + "fields": { + "documentMetadata": { + "rule": "repeated", + "type": "DocumentMetadata", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "totalSize": { + "type": "int32", + "id": 3 + } + } + }, + "BatchDeleteDocumentsRequest": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "datasetDocuments": { + "type": "BatchDatasetDocuments", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchDeleteDocumentsResponse": { + "fields": {} + }, + "BatchDeleteDocumentsMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + }, + "individualBatchDeleteStatuses": { + "rule": "repeated", + "type": "IndividualBatchDeleteStatus", + "id": 2 + }, + "totalDocumentCount": { + "type": "int32", + "id": 3 + }, + "errorDocumentCount": { + "type": "int32", + "id": 4 + } + }, + "nested": { + "IndividualBatchDeleteStatus": { + "fields": { + "documentId": { + "type": "DocumentId", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + } + } + } + } + }, + "GetDatasetSchemaRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "documentai.googleapis.com/DatasetSchema" + } + }, + "visibleFieldsOnly": { + "type": "bool", + "id": 2 + } + } + }, + "UpdateDatasetSchemaRequest": { + "fields": { + "datasetSchema": { + "type": "DatasetSchema", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DocumentPageRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + }, + "DocumentMetadata": { + "fields": { + "documentId": { + "type": "DocumentId", + "id": 1 + }, + "pageCount": { + "type": "int32", + "id": 2 + }, + "datasetType": { + "type": "DatasetSplitType", + "id": 3 + }, + "labelingState": { + "type": "DocumentLabelingState", + "id": 5 + }, + "displayName": { + "type": "string", + "id": 6 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "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 + } + }, + "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 + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + }, + "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 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "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/postaladdress;postaladdress", + "java_multiple_files": true, + "java_outer_classname": "PostalAddressProto", + "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 + } + } + } + } + }, + "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-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js new file mode 100644 index 00000000000..3a6cbaf23ed --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js @@ -0,0 +1,96 @@ +// 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 documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_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 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}` + */ + // const name = 'abc123' + /** + * The input documents for the + * BatchProcessDocuments google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments + * method. + */ + // const inputDocuments = {} + /** + * The output configuration for the + * BatchProcessDocuments google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments + * method. + */ + // const documentOutputConfig = {} + /** + * Whether human review should be skipped for this request. Default to + * `false`. + */ + // const skipHumanReview = true + /** + * Inference-time options for the process API + */ + // const processOptions = {} + /** + * 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. + */ + // const labels = [1,2,3,4] + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callBatchProcessDocuments() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.batchProcessDocuments(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchProcessDocuments(); + // [END documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_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-documentai/samples/generated/v1/document_processor_service.create_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js new file mode 100644 index 00000000000..d03d0764f5a --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js @@ -0,0 +1,72 @@ +// 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, processor) { + // [START documentai_v1_generated_DocumentProcessorService_CreateProcessor_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 (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * 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. + */ + // const processor = {} + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callCreateProcessor() { + // Construct request + const request = { + parent, + processor, + }; + + // Run request + const response = await documentaiClient.createProcessor(request); + console.log(response); + } + + callCreateProcessor(); + // [END documentai_v1_generated_DocumentProcessorService_CreateProcessor_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-documentai/samples/generated/v1/document_processor_service.delete_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor.js new file mode 100644 index 00000000000..788331ca312 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor.js @@ -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. ** + + + +'use strict'; + +function main(name) { + // [START documentai_v1_generated_DocumentProcessorService_DeleteProcessor_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 processor resource name to be deleted. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callDeleteProcessor() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.deleteProcessor(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteProcessor(); + // [END documentai_v1_generated_DocumentProcessorService_DeleteProcessor_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-documentai/samples/generated/v1/document_processor_service.delete_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor_version.js new file mode 100644 index 00000000000..8ab461185ff --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor_version.js @@ -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. ** + + + +'use strict'; + +function main(name) { + // [START documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_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 processor version resource name to be deleted. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callDeleteProcessorVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.deleteProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteProcessorVersion(); + // [END documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_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-documentai/samples/generated/v1/document_processor_service.deploy_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.deploy_processor_version.js new file mode 100644 index 00000000000..b9e10868edf --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.deploy_processor_version.js @@ -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. ** + + + +'use strict'; + +function main(name) { + // [START documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_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 processor version resource name to be deployed. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callDeployProcessorVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.deployProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployProcessorVersion(); + // [END documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_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-documentai/samples/generated/v1/document_processor_service.disable_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.disable_processor.js new file mode 100644 index 00000000000..d4983e9d3a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.disable_processor.js @@ -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. ** + + + +'use strict'; + +function main(name) { + // [START documentai_v1_generated_DocumentProcessorService_DisableProcessor_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 processor resource name to be disabled. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callDisableProcessor() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.disableProcessor(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDisableProcessor(); + // [END documentai_v1_generated_DocumentProcessorService_DisableProcessor_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-documentai/samples/generated/v1/document_processor_service.enable_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.enable_processor.js new file mode 100644 index 00000000000..f73979b4813 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.enable_processor.js @@ -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. ** + + + +'use strict'; + +function main(name) { + // [START documentai_v1_generated_DocumentProcessorService_EnableProcessor_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 processor resource name to be enabled. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callEnableProcessor() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.enableProcessor(request); + const [response] = await operation.promise(); + console.log(response); + } + + callEnableProcessor(); + // [END documentai_v1_generated_DocumentProcessorService_EnableProcessor_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-documentai/samples/generated/v1/document_processor_service.evaluate_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.evaluate_processor_version.js new file mode 100644 index 00000000000..cd86267491a --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.evaluate_processor_version.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(processorVersion) { + // [START documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_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 of the + * ProcessorVersion google.cloud.documentai.v1.ProcessorVersion to + * evaluate. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + */ + // const processorVersion = 'abc123' + /** + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. + */ + // const evaluationDocuments = {} + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callEvaluateProcessorVersion() { + // Construct request + const request = { + processorVersion, + }; + + // Run request + const [operation] = await documentaiClient.evaluateProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callEvaluateProcessorVersion(); + // [END documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_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-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js new file mode 100644 index 00000000000..bd9d2930a14 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js @@ -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. ** + + + +'use strict'; + +function main(parent) { + // [START documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_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 location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callFetchProcessorTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await documentaiClient.fetchProcessorTypes(request); + console.log(response); + } + + callFetchProcessorTypes(); + // [END documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_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-documentai/samples/generated/v1/document_processor_service.get_evaluation.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_evaluation.js new file mode 100644 index 00000000000..09352fe7b45 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_evaluation.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 documentai_v1_generated_DocumentProcessorService_GetEvaluation_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 of the + * Evaluation google.cloud.documentai.v1.Evaluation to get. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callGetEvaluation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await documentaiClient.getEvaluation(request); + console.log(response); + } + + callGetEvaluation(); + // [END documentai_v1_generated_DocumentProcessorService_GetEvaluation_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-documentai/samples/generated/v1/document_processor_service.get_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor.js new file mode 100644 index 00000000000..8f1273f2526 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor.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 documentai_v1_generated_DocumentProcessorService_GetProcessor_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 processor resource name. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callGetProcessor() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await documentaiClient.getProcessor(request); + console.log(response); + } + + callGetProcessor(); + // [END documentai_v1_generated_DocumentProcessorService_GetProcessor_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-documentai/samples/generated/v1/document_processor_service.get_processor_type.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_type.js new file mode 100644 index 00000000000..7a2c66adbb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_type.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 documentai_v1_generated_DocumentProcessorService_GetProcessorType_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 processor type resource name. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callGetProcessorType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await documentaiClient.getProcessorType(request); + console.log(response); + } + + callGetProcessorType(); + // [END documentai_v1_generated_DocumentProcessorService_GetProcessorType_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-documentai/samples/generated/v1/document_processor_service.get_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_version.js new file mode 100644 index 00000000000..edab00102ff --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_version.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 documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_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 processor resource name. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callGetProcessorVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await documentaiClient.getProcessorVersion(request); + console.log(response); + } + + callGetProcessorVersion(); + // [END documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_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-documentai/samples/generated/v1/document_processor_service.list_evaluations.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js new file mode 100644 index 00000000000..895b8790063 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js @@ -0,0 +1,77 @@ +// 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 documentai_v1_generated_DocumentProcessorService_ListEvaluations_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 of the + * ProcessorVersion google.cloud.documentai.v1.ProcessorVersion to list + * evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + */ + // const parent = 'abc123' + /** + * 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`. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListEvaluations` call. + * Provide this to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callListEvaluations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = documentaiClient.listEvaluationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEvaluations(); + // [END documentai_v1_generated_DocumentProcessorService_ListEvaluations_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-documentai/samples/generated/v1/document_processor_service.list_processor_types.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js new file mode 100644 index 00000000000..b4d334afb90 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js @@ -0,0 +1,74 @@ +// 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 documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_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 location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * 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`. + */ + // const pageSize = 1234 + /** + * Used to retrieve the next page of results, empty if at the end of the list. + */ + // const pageToken = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callListProcessorTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = documentaiClient.listProcessorTypesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListProcessorTypes(); + // [END documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_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-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js new file mode 100644 index 00000000000..119fc6fadbe --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.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(parent) { + // [START documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_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 (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + */ + // const parent = 'abc123' + /** + * 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`. + */ + // const pageSize = 1234 + /** + * We will return the processor versions sorted by creation time. The page + * token will point to the next processor version. + */ + // const pageToken = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callListProcessorVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = documentaiClient.listProcessorVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListProcessorVersions(); + // [END documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_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-documentai/samples/generated/v1/document_processor_service.list_processors.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js new file mode 100644 index 00000000000..240f213c8a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.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) { + // [START documentai_v1_generated_DocumentProcessorService_ListProcessors_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 (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * 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`. + */ + // const pageSize = 1234 + /** + * We will return the processors sorted by creation time. The page token + * will point to the next processor. + */ + // const pageToken = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callListProcessors() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = documentaiClient.listProcessorsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListProcessors(); + // [END documentai_v1_generated_DocumentProcessorService_ListProcessors_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-documentai/samples/generated/v1/document_processor_service.process_document.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js new file mode 100644 index 00000000000..abe63e6d050 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js @@ -0,0 +1,110 @@ +// 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 documentai_v1_generated_DocumentProcessorService_ProcessDocument_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. + */ + /** + * An inline document proto. + */ + // const inlineDocument = {} + /** + * A raw document content (bytes). + */ + // const rawDocument = {} + /** + * A raw document on Google Cloud Storage. + */ + // const gcsDocument = {} + /** + * 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}` + */ + // const name = 'abc123' + /** + * Whether human review should be skipped for this request. Default to + * `false`. + */ + // const skipHumanReview = true + /** + * 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}`. + */ + // const fieldMask = {} + /** + * Inference-time options for the process API + */ + // const processOptions = {} + /** + * 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. + */ + // const labels = [1,2,3,4] + /** + * Optional. Option to remove images from the document. + */ + // const imagelessMode = true + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callProcessDocument() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await documentaiClient.processDocument(request); + console.log(response); + } + + callProcessDocument(); + // [END documentai_v1_generated_DocumentProcessorService_ProcessDocument_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-documentai/samples/generated/v1/document_processor_service.review_document.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js new file mode 100644 index 00000000000..12f5c3634c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js @@ -0,0 +1,80 @@ +// 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(humanReviewConfig) { + // [START documentai_v1_generated_DocumentProcessorService_ReviewDocument_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. + */ + /** + * An inline document proto. + */ + // const inlineDocument = {} + /** + * Required. The resource name of the + * HumanReviewConfig google.cloud.documentai.v1.HumanReviewConfig that the + * document will be reviewed with. + */ + // const humanReviewConfig = 'abc123' + /** + * Whether the validation should be performed on the ad-hoc review request. + */ + // const enableSchemaValidation = true + /** + * The priority of the human review task. + */ + // const priority = {} + /** + * The document schema of the human review task. + */ + // const documentSchema = {} + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callReviewDocument() { + // Construct request + const request = { + humanReviewConfig, + }; + + // Run request + const [operation] = await documentaiClient.reviewDocument(request); + const [response] = await operation.promise(); + console.log(response); + } + + callReviewDocument(); + // [END documentai_v1_generated_DocumentProcessorService_ReviewDocument_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-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js new file mode 100644 index 00000000000..7e92c0f3a83 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js @@ -0,0 +1,72 @@ +// 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(processor, defaultProcessorVersion) { + // [START documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_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 of the + * Processor google.cloud.documentai.v1.Processor to change default + * version. + */ + // const processor = 'abc123' + /** + * 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}` + */ + // const defaultProcessorVersion = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callSetDefaultProcessorVersion() { + // Construct request + const request = { + processor, + defaultProcessorVersion, + }; + + // Run request + const [operation] = await documentaiClient.setDefaultProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSetDefaultProcessorVersion(); + // [END documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_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-documentai/samples/generated/v1/document_processor_service.train_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js new file mode 100644 index 00000000000..594e2ee2ccc --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js @@ -0,0 +1,92 @@ +// 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, processorVersion) { + // [START documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_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. + */ + /** + * Options to control Custom Document Extraction (CDE) Processor. + */ + // const customDocumentExtractionOptions = {} + /** + * Options to control foundation model tuning of a processor. + */ + // const foundationModelTuningOptions = {} + /** + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. + */ + // const parent = 'abc123' + /** + * Required. The processor version to be created. + */ + // const processorVersion = {} + /** + * Optional. The schema the processor version will be trained with. + */ + // const documentSchema = {} + /** + * Optional. The input data used to train the + * ProcessorVersion google.cloud.documentai.v1.ProcessorVersion. + */ + // const inputData = {} + /** + * 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}`. + */ + // const baseProcessorVersion = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callTrainProcessorVersion() { + // Construct request + const request = { + parent, + processorVersion, + }; + + // Run request + const [operation] = await documentaiClient.trainProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callTrainProcessorVersion(); + // [END documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_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-documentai/samples/generated/v1/document_processor_service.undeploy_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.undeploy_processor_version.js new file mode 100644 index 00000000000..8b9ce3c6a60 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.undeploy_processor_version.js @@ -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. ** + + + +'use strict'; + +function main(name) { + // [START documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_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 processor version resource name to be undeployed. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callUndeployProcessorVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.undeployProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeployProcessorVersion(); + // [END documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_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-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json new file mode 100644 index 00000000000..e88b12f1f5d --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json @@ -0,0 +1,1031 @@ +{ + "clientLibrary": { + "name": "nodejs-documentai", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.documentai.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_ProcessDocument_async", + "title": "DocumentProcessorService processDocument Sample", + "origin": "API_DEFINITION", + "description": " Processes a single document.", + "canonical": true, + "file": "document_processor_service.process_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 102, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ProcessDocument", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument", + "async": true, + "parameters": [ + { + "name": "inline_document", + "type": ".google.cloud.documentai.v1.Document" + }, + { + "name": "raw_document", + "type": ".google.cloud.documentai.v1.RawDocument" + }, + { + "name": "gcs_document", + "type": ".google.cloud.documentai.v1.GcsDocument" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "skip_human_review", + "type": "TYPE_BOOL" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "process_options", + "type": ".google.cloud.documentai.v1.ProcessOptions" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "imageless_mode", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.documentai.v1.ProcessResponse", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ProcessDocument", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_async", + "title": "DocumentProcessorService batchProcessDocuments Sample", + "origin": "API_DEFINITION", + "description": " LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.", + "canonical": true, + "file": "document_processor_service.batch_process_documents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 88, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchProcessDocuments", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_documents", + "type": ".google.cloud.documentai.v1.BatchDocumentsInputConfig" + }, + { + "name": "document_output_config", + "type": ".google.cloud.documentai.v1.DocumentOutputConfig" + }, + { + "name": "skip_human_review", + "type": "TYPE_BOOL" + }, + { + "name": "process_options", + "type": ".google.cloud.documentai.v1.ProcessOptions" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "BatchProcessDocuments", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_async", + "title": "DocumentProcessorService fetchProcessorTypes Sample", + "origin": "API_DEFINITION", + "description": " Fetches processor types. Note that we don't use [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] here, because it isn't paginated.", + "canonical": true, + "file": "document_processor_service.fetch_processor_types.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchProcessorTypes", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1.FetchProcessorTypesResponse", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "FetchProcessorTypes", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_async", + "title": "DocumentProcessorService listProcessorTypes Sample", + "origin": "API_DEFINITION", + "description": " Lists the processor types that exist.", + "canonical": true, + "file": "document_processor_service.list_processor_types.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProcessorTypes", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1.ListProcessorTypesResponse", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ListProcessorTypes", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_GetProcessorType_async", + "title": "DocumentProcessorService getProcessorType Sample", + "origin": "API_DEFINITION", + "description": " Gets a processor type detail.", + "canonical": true, + "file": "document_processor_service.get_processor_type.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProcessorType", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1.ProcessorType", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "GetProcessorType", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_ListProcessors_async", + "title": "DocumentProcessorService listProcessors Sample", + "origin": "API_DEFINITION", + "description": " Lists all processors which belong to this project.", + "canonical": true, + "file": "document_processor_service.list_processors.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProcessors", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessors", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1.ListProcessorsResponse", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ListProcessors", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessors", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_GetProcessor_async", + "title": "DocumentProcessorService getProcessor Sample", + "origin": "API_DEFINITION", + "description": " Gets a processor detail.", + "canonical": true, + "file": "document_processor_service.get_processor.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProcessor", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessor", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1.Processor", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "GetProcessor", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessor", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_async", + "title": "DocumentProcessorService trainProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Trains a new processor version. Operation metadata is returned as [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata].", + "canonical": true, + "file": "document_processor_service.train_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TrainProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion", + "async": true, + "parameters": [ + { + "name": "custom_document_extraction_options", + "type": ".google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions" + }, + { + "name": "foundation_model_tuning_options", + "type": ".google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "processor_version", + "type": ".google.cloud.documentai.v1.ProcessorVersion" + }, + { + "name": "document_schema", + "type": ".google.cloud.documentai.v1.DocumentSchema" + }, + { + "name": "input_data", + "type": ".google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData" + }, + { + "name": "base_processor_version", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "TrainProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_async", + "title": "DocumentProcessorService getProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Gets a processor version detail.", + "canonical": true, + "file": "document_processor_service.get_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1.ProcessorVersion", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "GetProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_async", + "title": "DocumentProcessorService listProcessorVersions Sample", + "origin": "API_DEFINITION", + "description": " Lists all versions of a processor.", + "canonical": true, + "file": "document_processor_service.list_processor_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProcessorVersions", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1.ListProcessorVersionsResponse", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ListProcessorVersions", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_async", + "title": "DocumentProcessorService deleteProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Deletes the processor version, all artifacts under the processor version will be deleted.", + "canonical": true, + "file": "document_processor_service.delete_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "DeleteProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_async", + "title": "DocumentProcessorService deployProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Deploys the processor version.", + "canonical": true, + "file": "document_processor_service.deploy_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeployProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "DeployProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_async", + "title": "DocumentProcessorService undeployProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Undeploys the processor version.", + "canonical": true, + "file": "document_processor_service.undeploy_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeployProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "UndeployProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_CreateProcessor_async", + "title": "DocumentProcessorService createProcessor Sample", + "origin": "API_DEFINITION", + "description": " 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.", + "canonical": true, + "file": "document_processor_service.create_processor.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateProcessor", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "processor", + "type": ".google.cloud.documentai.v1.Processor" + } + ], + "resultType": ".google.cloud.documentai.v1.Processor", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "CreateProcessor", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_DeleteProcessor_async", + "title": "DocumentProcessorService deleteProcessor Sample", + "origin": "API_DEFINITION", + "description": " Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.", + "canonical": true, + "file": "document_processor_service.delete_processor.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteProcessor", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "DeleteProcessor", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_EnableProcessor_async", + "title": "DocumentProcessorService enableProcessor Sample", + "origin": "API_DEFINITION", + "description": " Enables a processor", + "canonical": true, + "file": "document_processor_service.enable_processor.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EnableProcessor", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "EnableProcessor", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_DisableProcessor_async", + "title": "DocumentProcessorService disableProcessor Sample", + "origin": "API_DEFINITION", + "description": " Disables a processor", + "canonical": true, + "file": "document_processor_service.disable_processor.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DisableProcessor", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "DisableProcessor", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_async", + "title": "DocumentProcessorService setDefaultProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " 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].", + "canonical": true, + "file": "document_processor_service.set_default_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetDefaultProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion", + "async": true, + "parameters": [ + { + "name": "processor", + "type": "TYPE_STRING" + }, + { + "name": "default_processor_version", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "SetDefaultProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_ReviewDocument_async", + "title": "DocumentProcessorService reviewDocument Sample", + "origin": "API_DEFINITION", + "description": " Send a document for Human Review. The input document should be processed by the specified processor.", + "canonical": true, + "file": "document_processor_service.review_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReviewDocument", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument", + "async": true, + "parameters": [ + { + "name": "inline_document", + "type": ".google.cloud.documentai.v1.Document" + }, + { + "name": "human_review_config", + "type": "TYPE_STRING" + }, + { + "name": "enable_schema_validation", + "type": "TYPE_BOOL" + }, + { + "name": "priority", + "type": ".google.cloud.documentai.v1.ReviewDocumentRequest.Priority" + }, + { + "name": "document_schema", + "type": ".google.cloud.documentai.v1.DocumentSchema" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ReviewDocument", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_async", + "title": "DocumentProcessorService evaluateProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.", + "canonical": true, + "file": "document_processor_service.evaluate_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EvaluateProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion", + "async": true, + "parameters": [ + { + "name": "processor_version", + "type": "TYPE_STRING" + }, + { + "name": "evaluation_documents", + "type": ".google.cloud.documentai.v1.BatchDocumentsInputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "EvaluateProcessorVersion", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_GetEvaluation_async", + "title": "DocumentProcessorService getEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a specific evaluation.", + "canonical": true, + "file": "document_processor_service.get_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEvaluation", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1.Evaluation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "GetEvaluation", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetEvaluation", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1_generated_DocumentProcessorService_ListEvaluations_async", + "title": "DocumentProcessorService listEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a set of evaluations for a given processor version.", + "canonical": true, + "file": "document_processor_service.list_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEvaluations", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListEvaluations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1.ListEvaluationsResponse", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ListEvaluations", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListEvaluations", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1.DocumentProcessorService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js new file mode 100644 index 00000000000..1735575df6c --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js @@ -0,0 +1,104 @@ +// 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 documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_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 of + * Processor google.cloud.documentai.v1beta3.Processor or + * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + */ + // const name = 'abc123' + /** + * The input config for each single document in the batch process. + */ + // const inputConfigs = [1,2,3,4] + /** + * The overall output config for batch process. + */ + // const outputConfig = {} + /** + * The input documents for the + * BatchProcessDocuments google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments + * method. + */ + // const inputDocuments = {} + /** + * The output configuration for the + * BatchProcessDocuments google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments + * method. + */ + // const documentOutputConfig = {} + /** + * Whether human review should be skipped for this request. Default to + * `false`. + */ + // const skipHumanReview = true + /** + * Inference-time options for the process API + */ + // const processOptions = {} + /** + * 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. + */ + // const labels = [1,2,3,4] + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callBatchProcessDocuments() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.batchProcessDocuments(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchProcessDocuments(); + // [END documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_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-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js new file mode 100644 index 00000000000..171df6a14c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js @@ -0,0 +1,72 @@ +// 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, processor) { + // [START documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_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 (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. The processor to be created, requires + * Processor.type google.cloud.documentai.v1beta3.Processor.type and + * Processor.display_name google.cloud.documentai.v1beta3.Processor.display_name + * to be set. Also, the + * Processor.kms_key_name google.cloud.documentai.v1beta3.Processor.kms_key_name + * field must be set if the processor is under CMEK. + */ + // const processor = {} + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callCreateProcessor() { + // Construct request + const request = { + parent, + processor, + }; + + // Run request + const response = await documentaiClient.createProcessor(request); + console.log(response); + } + + callCreateProcessor(); + // [END documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_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-documentai/samples/generated/v1beta3/document_processor_service.delete_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor.js new file mode 100644 index 00000000000..629a060ceea --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor.js @@ -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. ** + + + +'use strict'; + +function main(name) { + // [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_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 processor resource name to be deleted. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callDeleteProcessor() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.deleteProcessor(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteProcessor(); + // [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_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-documentai/samples/generated/v1beta3/document_processor_service.delete_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor_version.js new file mode 100644 index 00000000000..be29d0046bc --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor_version.js @@ -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. ** + + + +'use strict'; + +function main(name) { + // [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_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 processor version resource name to be deleted. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callDeleteProcessorVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.deleteProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteProcessorVersion(); + // [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js new file mode 100644 index 00000000000..da24f431eeb --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js @@ -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. ** + + + +'use strict'; + +function main(name) { + // [START documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_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 processor version resource name to be deployed. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callDeployProcessorVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.deployProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployProcessorVersion(); + // [END documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js new file mode 100644 index 00000000000..4e72fb33c72 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js @@ -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. ** + + + +'use strict'; + +function main(name) { + // [START documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_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 processor resource name to be disabled. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callDisableProcessor() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.disableProcessor(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDisableProcessor(); + // [END documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_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-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js new file mode 100644 index 00000000000..4dac9fe7942 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js @@ -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. ** + + + +'use strict'; + +function main(name) { + // [START documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_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 processor resource name to be enabled. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callEnableProcessor() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.enableProcessor(request); + const [response] = await operation.promise(); + console.log(response); + } + + callEnableProcessor(); + // [END documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_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-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js new file mode 100644 index 00000000000..2b78653accd --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.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(processorVersion) { + // [START documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_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 of the + * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to + * evaluate. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + */ + // const processorVersion = 'abc123' + /** + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. + */ + // const evaluationDocuments = {} + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callEvaluateProcessorVersion() { + // Construct request + const request = { + processorVersion, + }; + + // Run request + const [operation] = await documentaiClient.evaluateProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callEvaluateProcessorVersion(); + // [END documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js new file mode 100644 index 00000000000..c7751cec395 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js @@ -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. ** + + + +'use strict'; + +function main(parent) { + // [START documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_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 location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callFetchProcessorTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await documentaiClient.fetchProcessorTypes(request); + console.log(response); + } + + callFetchProcessorTypes(); + // [END documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_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-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js new file mode 100644 index 00000000000..88e6c5625dd --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.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 documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_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 of the + * Evaluation google.cloud.documentai.v1beta3.Evaluation to get. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callGetEvaluation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await documentaiClient.getEvaluation(request); + console.log(response); + } + + callGetEvaluation(); + // [END documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_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-documentai/samples/generated/v1beta3/document_processor_service.get_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor.js new file mode 100644 index 00000000000..5eedad854c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor.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 documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_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 processor resource name. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callGetProcessor() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await documentaiClient.getProcessor(request); + console.log(response); + } + + callGetProcessor(); + // [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_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-documentai/samples/generated/v1beta3/document_processor_service.get_processor_type.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_type.js new file mode 100644 index 00000000000..25960debe86 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_type.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 documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_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 processor type resource name. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callGetProcessorType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await documentaiClient.getProcessorType(request); + console.log(response); + } + + callGetProcessorType(); + // [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_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-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.js new file mode 100644 index 00000000000..8768ac89a5c --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.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 documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_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 processor resource name. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callGetProcessorVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await documentaiClient.getProcessorVersion(request); + console.log(response); + } + + callGetProcessorVersion(); + // [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js new file mode 100644 index 00000000000..931fdec6cef --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js @@ -0,0 +1,74 @@ +// 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 documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_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. + */ + /** + * The source processor version to import from. The source processor version + * and destination processor need to be in the same environment and region. + */ + // const processorVersionSource = 'abc123' + /** + * The source processor version to import from. It can be from a different + * environment and region than the destination processor. + */ + // const externalProcessorVersionSource = {} + /** + * Required. The destination processor name to create the processor version + * in. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + */ + // const parent = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callImportProcessorVersion() { + // Construct request + const request = { + parent, + }; + + // Run request + const [operation] = await documentaiClient.importProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportProcessorVersion(); + // [END documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js new file mode 100644 index 00000000000..0a0681fb3c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js @@ -0,0 +1,77 @@ +// 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 documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_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 of the + * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to + * list evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + */ + // const parent = 'abc123' + /** + * 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`. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListEvaluations` call. + * Provide this to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callListEvaluations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = documentaiClient.listEvaluationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListEvaluations(); + // [END documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_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-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js new file mode 100644 index 00000000000..73397c4e9c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js @@ -0,0 +1,74 @@ +// 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 documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_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 location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * 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`. + */ + // const pageSize = 1234 + /** + * Used to retrieve the next page of results, empty if at the end of the list. + */ + // const pageToken = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callListProcessorTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = documentaiClient.listProcessorTypesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListProcessorTypes(); + // [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_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-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js new file mode 100644 index 00000000000..98c37e1f2ef --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.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(parent) { + // [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_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 (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + */ + // const parent = 'abc123' + /** + * 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`. + */ + // const pageSize = 1234 + /** + * We will return the processor versions sorted by creation time. The page + * token will point to the next processor version. + */ + // const pageToken = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callListProcessorVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = documentaiClient.listProcessorVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListProcessorVersions(); + // [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_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-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js new file mode 100644 index 00000000000..c04b2b3bc67 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.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) { + // [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_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 (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * 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`. + */ + // const pageSize = 1234 + /** + * We will return the processors sorted by creation time. The page token + * will point to the next processor. + */ + // const pageToken = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callListProcessors() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = documentaiClient.listProcessorsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListProcessors(); + // [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_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-documentai/samples/generated/v1beta3/document_processor_service.process_document.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js new file mode 100644 index 00000000000..b1342802bd0 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js @@ -0,0 +1,117 @@ +// 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 documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_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. + */ + /** + * An inline document proto. + */ + // const inlineDocument = {} + /** + * A raw document content (bytes). + */ + // const rawDocument = {} + /** + * A raw document on Google Cloud Storage. + */ + // const gcsDocument = {} + /** + * Required. The resource name of the + * Processor google.cloud.documentai.v1beta3.Processor or + * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion + * to use for processing. If a + * Processor google.cloud.documentai.v1beta3.Processor is specified, the + * server will use its default + * version google.cloud.documentai.v1beta3.Processor.default_processor_version. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + */ + // const name = 'abc123' + /** + * The document payload, the + * content google.cloud.documentai.v1beta3.Document.content and + * mime_type google.cloud.documentai.v1beta3.Document.mime_type fields must + * be set. + */ + // const document = {} + /** + * Whether human review should be skipped for this request. Default to + * `false`. + */ + // const skipHumanReview = true + /** + * Specifies which fields to include in the + * ProcessResponse.document google.cloud.documentai.v1beta3.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}`. + */ + // const fieldMask = {} + /** + * Inference-time options for the process API + */ + // const processOptions = {} + /** + * 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. + */ + // const labels = [1,2,3,4] + /** + * Optional. Option to remove images from the document. + */ + // const imagelessMode = true + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callProcessDocument() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await documentaiClient.processDocument(request); + console.log(response); + } + + callProcessDocument(); + // [END documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_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-documentai/samples/generated/v1beta3/document_processor_service.review_document.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js new file mode 100644 index 00000000000..82e99686494 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.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(humanReviewConfig) { + // [START documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_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. + */ + /** + * An inline document proto. + */ + // const inlineDocument = {} + /** + * Required. The resource name of the + * HumanReviewConfig google.cloud.documentai.v1beta3.HumanReviewConfig that + * the document will be reviewed with. + */ + // const humanReviewConfig = 'abc123' + /** + * The document that needs human review. + */ + // const document = {} + /** + * Whether the validation should be performed on the ad-hoc review request. + */ + // const enableSchemaValidation = true + /** + * The priority of the human review task. + */ + // const priority = {} + /** + * The document schema of the human review task. + */ + // const documentSchema = {} + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callReviewDocument() { + // Construct request + const request = { + humanReviewConfig, + }; + + // Run request + const [operation] = await documentaiClient.reviewDocument(request); + const [response] = await operation.promise(); + console.log(response); + } + + callReviewDocument(); + // [END documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_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-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js new file mode 100644 index 00000000000..7fad5cfe78f --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js @@ -0,0 +1,72 @@ +// 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(processor, defaultProcessorVersion) { + // [START documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_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 of the + * Processor google.cloud.documentai.v1beta3.Processor to change default + * version. + */ + // const processor = 'abc123' + /** + * Required. The resource name of child + * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to use + * as default. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + */ + // const defaultProcessorVersion = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callSetDefaultProcessorVersion() { + // Construct request + const request = { + processor, + defaultProcessorVersion, + }; + + // Run request + const [operation] = await documentaiClient.setDefaultProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSetDefaultProcessorVersion(); + // [END documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js new file mode 100644 index 00000000000..f8bce065e10 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js @@ -0,0 +1,92 @@ +// 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, processorVersion) { + // [START documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_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. + */ + /** + * Options to control Custom Document Extraction (CDE) Processor. + */ + // const customDocumentExtractionOptions = {} + /** + * Options to control foundation model tuning of a processor. + */ + // const foundationModelTuningOptions = {} + /** + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. + */ + // const parent = 'abc123' + /** + * Required. The processor version to be created. + */ + // const processorVersion = {} + /** + * Optional. The schema the processor version will be trained with. + */ + // const documentSchema = {} + /** + * Optional. The input data used to train the + * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion. + */ + // const inputData = {} + /** + * 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}`. + */ + // const baseProcessorVersion = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callTrainProcessorVersion() { + // Construct request + const request = { + parent, + processorVersion, + }; + + // Run request + const [operation] = await documentaiClient.trainProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callTrainProcessorVersion(); + // [END documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js new file mode 100644 index 00000000000..b1adc638b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js @@ -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. ** + + + +'use strict'; + +function main(name) { + // [START documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_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 processor version resource name to be undeployed. + */ + // const name = 'abc123' + + // Imports the Documentai library + const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentProcessorServiceClient(); + + async function callUndeployProcessorVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await documentaiClient.undeployProcessorVersion(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeployProcessorVersion(); + // [END documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_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-documentai/samples/generated/v1beta3/document_service.batch_delete_documents.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.batch_delete_documents.js new file mode 100644 index 00000000000..041eb3823ab --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.batch_delete_documents.js @@ -0,0 +1,72 @@ +// 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(dataset, datasetDocuments) { + // [START documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_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 dataset resource name. + * Format: + * projects/{project}/locations/{location}/processors/{processor}/dataset + */ + // const dataset = 'abc123' + /** + * Required. Dataset documents input. If given `filter`, all documents + * satisfying the filter will be deleted. If given documentIds, a maximum of + * 50 documents can be deleted in a batch. The request will be rejected if + * more than 50 document_ids are provided. + */ + // const datasetDocuments = {} + + // Imports the Documentai library + const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentServiceClient(); + + async function callBatchDeleteDocuments() { + // Construct request + const request = { + dataset, + datasetDocuments, + }; + + // Run request + const [operation] = await documentaiClient.batchDeleteDocuments(request); + const [response] = await operation.promise(); + console.log(response); + } + + callBatchDeleteDocuments(); + // [END documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_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-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js new file mode 100644 index 00000000000..99fdaf534d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.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(name) { + // [START documentai_v1beta3_generated_DocumentService_GetDatasetSchema_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 dataset schema resource name. + * Format: + * projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema + */ + // const name = 'abc123' + /** + * If set, only returns the visible fields of the schema. + */ + // const visibleFieldsOnly = true + + // Imports the Documentai library + const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentServiceClient(); + + async function callGetDatasetSchema() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await documentaiClient.getDatasetSchema(request); + console.log(response); + } + + callGetDatasetSchema(); + // [END documentai_v1beta3_generated_DocumentService_GetDatasetSchema_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-documentai/samples/generated/v1beta3/document_service.get_document.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.get_document.js new file mode 100644 index 00000000000..70a64d24e75 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.get_document.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(dataset, documentId) { + // [START documentai_v1beta3_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 resource name of the dataset that the document belongs to . + * Format: + * projects/{project}/locations/{location}/processors/{processor}/dataset + */ + // const dataset = 'abc123' + /** + * Required. Document identifier. + */ + // const documentId = {} + /** + * If set, only fields listed here will be returned. Otherwise, all fields + * will be returned by default. + */ + // const readMask = {} + /** + * List of pages for which the fields specified in the `read_mask` must + * be served. + */ + // const pageRange = {} + + // Imports the Documentai library + const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentServiceClient(); + + async function callGetDocument() { + // Construct request + const request = { + dataset, + documentId, + }; + + // Run request + const response = await documentaiClient.getDocument(request); + console.log(response); + } + + callGetDocument(); + // [END documentai_v1beta3_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-documentai/samples/generated/v1beta3/document_service.import_documents.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.import_documents.js new file mode 100644 index 00000000000..12876659f21 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.import_documents.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(dataset, batchDocumentsImportConfigs) { + // [START documentai_v1beta3_generated_DocumentService_ImportDocuments_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 dataset resource name. + * Format: + * projects/{project}/locations/{location}/processors/{processor}/dataset + */ + // const dataset = 'abc123' + /** + * Required. The Cloud Storage uri containing raw documents that must be + * imported. + */ + // const batchDocumentsImportConfigs = [1,2,3,4] + + // Imports the Documentai library + const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentServiceClient(); + + async function callImportDocuments() { + // Construct request + const request = { + dataset, + batchDocumentsImportConfigs, + }; + + // Run request + const [operation] = await documentaiClient.importDocuments(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportDocuments(); + // [END documentai_v1beta3_generated_DocumentService_ImportDocuments_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-documentai/samples/generated/v1beta3/document_service.list_documents.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.list_documents.js new file mode 100644 index 00000000000..1f3da765e59 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.list_documents.js @@ -0,0 +1,117 @@ +// 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(dataset) { + // [START documentai_v1beta3_generated_DocumentService_ListDocuments_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 of the dataset to be listed. + * Format: + * projects/{project}/locations/{location}/processors/{processor}/dataset + */ + // const dataset = 'abc123' + /** + * The maximum number of documents to return. The service may return + * fewer than this value. + * If unspecified, at most 20 documents will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListDocuments` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListDocuments` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Query to filter the documents based on + * https://google.aip.dev/160. + * ## Currently support query strings are: + * `SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED` + * - `LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED` + * - `DisplayName=\"file_name.pdf\"` + * - `EntityType=abc/def` + * - `TagName=\"auto-labeling-running\"|\"sampled\"` + * Note: + * - Only `AND`, `=` and `!=` are supported. + * e.g. `DisplayName=file_name AND EntityType!=abc` IS supported. + * - Wildcard `*` is supported only in `DisplayName` filter + * - No duplicate filter keys are allowed, + * e.g. `EntityType=a AND EntityType=b` is NOT supported. + * - String match is case sensitive (for filter `DisplayName` & `EntityType`). + */ + // const filter = 'abc123' + /** + * Optional. Controls if the request requires a total size of matched + * documents. See + * ListDocumentsResponse.total_size google.cloud.documentai.v1beta3.ListDocumentsResponse.total_size. + * Enabling this flag may adversely impact performance. + * Defaults to false. + */ + // const returnTotalSize = true + /** + * Optional. Number of results to skip beginning from the `page_token` if + * provided. https://google.aip.dev/158#skipping-results. It must be a + * non-negative integer. Negative values will be rejected. Note that this is + * not the number of pages to skip. If this value causes the cursor to move + * past the end of results, + * ListDocumentsResponse.document_metadata google.cloud.documentai.v1beta3.ListDocumentsResponse.document_metadata + * and + * ListDocumentsResponse.next_page_token google.cloud.documentai.v1beta3.ListDocumentsResponse.next_page_token + * will be empty. + */ + // const skip = 1234 + + // Imports the Documentai library + const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentServiceClient(); + + async function callListDocuments() { + // Construct request + const request = { + dataset, + }; + + // Run request + const iterable = documentaiClient.listDocumentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDocuments(); + // [END documentai_v1beta3_generated_DocumentService_ListDocuments_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-documentai/samples/generated/v1beta3/document_service.update_dataset.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js new file mode 100644 index 00000000000..a6fc0aaccca --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.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(dataset) { + // [START documentai_v1beta3_generated_DocumentService_UpdateDataset_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` field of the `Dataset` is used to identify the + * resource to be updated. + */ + // const dataset = {} + /** + * The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Documentai library + const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentServiceClient(); + + async function callUpdateDataset() { + // Construct request + const request = { + dataset, + }; + + // Run request + const [operation] = await documentaiClient.updateDataset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateDataset(); + // [END documentai_v1beta3_generated_DocumentService_UpdateDataset_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-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js new file mode 100644 index 00000000000..29209b24024 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_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(datasetSchema) { + // [START documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_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 field of the `DatasetSchema` is used to identify the + * resource to be updated. + */ + // const datasetSchema = {} + /** + * The update mask applies to the resource. + */ + // const updateMask = {} + + // Imports the Documentai library + const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; + + // Instantiates a client + const documentaiClient = new DocumentServiceClient(); + + async function callUpdateDatasetSchema() { + // Construct request + const request = { + datasetSchema, + }; + + // Run request + const response = await documentaiClient.updateDatasetSchema(request); + console.log(response); + } + + callUpdateDatasetSchema(); + // [END documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_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-documentai/samples/generated/v1beta3/snippet_metadata_google.cloud.documentai.v1beta3.json b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata_google.cloud.documentai.v1beta3.json new file mode 100644 index 00000000000..89d95bd05b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata_google.cloud.documentai.v1beta3.json @@ -0,0 +1,1427 @@ +{ + "clientLibrary": { + "name": "nodejs-documentai", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.documentai.v1beta3", + "version": "v1beta3" + } + ] + }, + "snippets": [ + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_async", + "title": "DocumentProcessorService processDocument Sample", + "origin": "API_DEFINITION", + "description": " Processes a single document.", + "canonical": true, + "file": "document_processor_service.process_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 109, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ProcessDocument", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument", + "async": true, + "parameters": [ + { + "name": "inline_document", + "type": ".google.cloud.documentai.v1beta3.Document" + }, + { + "name": "raw_document", + "type": ".google.cloud.documentai.v1beta3.RawDocument" + }, + { + "name": "gcs_document", + "type": ".google.cloud.documentai.v1beta3.GcsDocument" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "document", + "type": ".google.cloud.documentai.v1beta3.Document" + }, + { + "name": "skip_human_review", + "type": "TYPE_BOOL" + }, + { + "name": "field_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "process_options", + "type": ".google.cloud.documentai.v1beta3.ProcessOptions" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "imageless_mode", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.ProcessResponse", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ProcessDocument", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_async", + "title": "DocumentProcessorService batchProcessDocuments Sample", + "origin": "API_DEFINITION", + "description": " LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.", + "canonical": true, + "file": "document_processor_service.batch_process_documents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 96, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchProcessDocuments", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input_configs", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "output_config", + "type": ".google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig" + }, + { + "name": "input_documents", + "type": ".google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" + }, + { + "name": "document_output_config", + "type": ".google.cloud.documentai.v1beta3.DocumentOutputConfig" + }, + { + "name": "skip_human_review", + "type": "TYPE_BOOL" + }, + { + "name": "process_options", + "type": ".google.cloud.documentai.v1beta3.ProcessOptions" + }, + { + "name": "labels", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "BatchProcessDocuments", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_async", + "title": "DocumentProcessorService fetchProcessorTypes Sample", + "origin": "API_DEFINITION", + "description": " Fetches processor types. Note that we don't use [ListProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes] here, because it isn't paginated.", + "canonical": true, + "file": "document_processor_service.fetch_processor_types.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchProcessorTypes", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.FetchProcessorTypesResponse", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "FetchProcessorTypes", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_async", + "title": "DocumentProcessorService listProcessorTypes Sample", + "origin": "API_DEFINITION", + "description": " Lists the processor types that exist.", + "canonical": true, + "file": "document_processor_service.list_processor_types.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProcessorTypes", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.ListProcessorTypesResponse", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ListProcessorTypes", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_async", + "title": "DocumentProcessorService getProcessorType Sample", + "origin": "API_DEFINITION", + "description": " Gets a processor type detail.", + "canonical": true, + "file": "document_processor_service.get_processor_type.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProcessorType", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorType", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.ProcessorType", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "GetProcessorType", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorType", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_async", + "title": "DocumentProcessorService listProcessors Sample", + "origin": "API_DEFINITION", + "description": " Lists all processors which belong to this project.", + "canonical": true, + "file": "document_processor_service.list_processors.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProcessors", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessors", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.ListProcessorsResponse", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ListProcessors", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessors", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_async", + "title": "DocumentProcessorService getProcessor Sample", + "origin": "API_DEFINITION", + "description": " Gets a processor detail.", + "canonical": true, + "file": "document_processor_service.get_processor.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProcessor", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessor", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.Processor", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "GetProcessor", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessor", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_async", + "title": "DocumentProcessorService trainProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Trains a new processor version. Operation metadata is returned as [TrainProcessorVersionMetadata][google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata].", + "canonical": true, + "file": "document_processor_service.train_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TrainProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion", + "async": true, + "parameters": [ + { + "name": "custom_document_extraction_options", + "type": ".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions" + }, + { + "name": "foundation_model_tuning_options", + "type": ".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "processor_version", + "type": ".google.cloud.documentai.v1beta3.ProcessorVersion" + }, + { + "name": "document_schema", + "type": ".google.cloud.documentai.v1beta3.DocumentSchema" + }, + { + "name": "input_data", + "type": ".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData" + }, + { + "name": "base_processor_version", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "TrainProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_async", + "title": "DocumentProcessorService getProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Gets a processor version detail.", + "canonical": true, + "file": "document_processor_service.get_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.ProcessorVersion", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "GetProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_async", + "title": "DocumentProcessorService listProcessorVersions Sample", + "origin": "API_DEFINITION", + "description": " Lists all versions of a processor.", + "canonical": true, + "file": "document_processor_service.list_processor_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListProcessorVersions", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.ListProcessorVersionsResponse", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ListProcessorVersions", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersions", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_async", + "title": "DocumentProcessorService deleteProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Deletes the processor version, all artifacts under the processor version will be deleted.", + "canonical": true, + "file": "document_processor_service.delete_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "DeleteProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_async", + "title": "DocumentProcessorService deployProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Deploys the processor version.", + "canonical": true, + "file": "document_processor_service.deploy_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeployProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "DeployProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_async", + "title": "DocumentProcessorService undeployProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Undeploys the processor version.", + "canonical": true, + "file": "document_processor_service.undeploy_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeployProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "UndeployProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_async", + "title": "DocumentProcessorService createProcessor Sample", + "origin": "API_DEFINITION", + "description": " Creates a processor from the [ProcessorType][google.cloud.documentai.v1beta3.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.", + "canonical": true, + "file": "document_processor_service.create_processor.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateProcessor", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessor", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "processor", + "type": ".google.cloud.documentai.v1beta3.Processor" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.Processor", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "CreateProcessor", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessor", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_async", + "title": "DocumentProcessorService deleteProcessor Sample", + "origin": "API_DEFINITION", + "description": " Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.", + "canonical": true, + "file": "document_processor_service.delete_processor.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteProcessor", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "DeleteProcessor", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_async", + "title": "DocumentProcessorService enableProcessor Sample", + "origin": "API_DEFINITION", + "description": " Enables a processor", + "canonical": true, + "file": "document_processor_service.enable_processor.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EnableProcessor", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "EnableProcessor", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_async", + "title": "DocumentProcessorService disableProcessor Sample", + "origin": "API_DEFINITION", + "description": " Disables a processor", + "canonical": true, + "file": "document_processor_service.disable_processor.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DisableProcessor", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "DisableProcessor", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_async", + "title": "DocumentProcessorService setDefaultProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Set the default (active) version of a [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] and [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].", + "canonical": true, + "file": "document_processor_service.set_default_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SetDefaultProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion", + "async": true, + "parameters": [ + { + "name": "processor", + "type": "TYPE_STRING" + }, + { + "name": "default_processor_version", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "SetDefaultProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_async", + "title": "DocumentProcessorService reviewDocument Sample", + "origin": "API_DEFINITION", + "description": " Send a document for Human Review. The input document should be processed by the specified processor.", + "canonical": true, + "file": "document_processor_service.review_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReviewDocument", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument", + "async": true, + "parameters": [ + { + "name": "inline_document", + "type": ".google.cloud.documentai.v1beta3.Document" + }, + { + "name": "human_review_config", + "type": "TYPE_STRING" + }, + { + "name": "document", + "type": ".google.cloud.documentai.v1beta3.Document" + }, + { + "name": "enable_schema_validation", + "type": "TYPE_BOOL" + }, + { + "name": "priority", + "type": ".google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority" + }, + { + "name": "document_schema", + "type": ".google.cloud.documentai.v1beta3.DocumentSchema" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ReviewDocument", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_async", + "title": "DocumentProcessorService evaluateProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.", + "canonical": true, + "file": "document_processor_service.evaluate_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EvaluateProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion", + "async": true, + "parameters": [ + { + "name": "processor_version", + "type": "TYPE_STRING" + }, + { + "name": "evaluation_documents", + "type": ".google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "EvaluateProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_async", + "title": "DocumentProcessorService getEvaluation Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a specific evaluation.", + "canonical": true, + "file": "document_processor_service.get_evaluation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetEvaluation", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.Evaluation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "GetEvaluation", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluation", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_async", + "title": "DocumentProcessorService listEvaluations Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a set of evaluations for a given processor version.", + "canonical": true, + "file": "document_processor_service.list_evaluations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListEvaluations", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.ListEvaluationsResponse", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ListEvaluations", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluations", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_async", + "title": "DocumentProcessorService importProcessorVersion Sample", + "origin": "API_DEFINITION", + "description": " Imports a processor version from source processor version.", + "canonical": true, + "file": "document_processor_service.import_processor_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion", + "async": true, + "parameters": [ + { + "name": "processor_version_source", + "type": "TYPE_STRING" + }, + { + "name": "external_processor_version_source", + "type": ".google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource" + }, + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentProcessorServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" + }, + "method": { + "shortName": "ImportProcessorVersion", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion", + "service": { + "shortName": "DocumentProcessorService", + "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentService_UpdateDataset_async", + "title": "DocumentProcessorService updateDataset Sample", + "origin": "API_DEFINITION", + "description": " Updates metadata associated with a dataset. Note that this method requires the `documentai.googleapis.com/datasets.update` 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.", + "canonical": true, + "file": "document_service.update_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.UpdateDataset", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": ".google.cloud.documentai.v1beta3.Dataset" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" + }, + "method": { + "shortName": "UpdateDataset", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.UpdateDataset", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.documentai.v1beta3.DocumentService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentService_ImportDocuments_async", + "title": "DocumentProcessorService importDocuments Sample", + "origin": "API_DEFINITION", + "description": " Import documents into a dataset.", + "canonical": true, + "file": "document_service.import_documents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportDocuments", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.ImportDocuments", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": "TYPE_STRING" + }, + { + "name": "batch_documents_import_configs", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" + }, + "method": { + "shortName": "ImportDocuments", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.ImportDocuments", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.documentai.v1beta3.DocumentService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentService_GetDocument_async", + "title": "DocumentProcessorService getDocument Sample", + "origin": "API_DEFINITION", + "description": " Returns relevant fields present in the requested document.", + "canonical": true, + "file": "document_service.get_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDocument", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.GetDocument", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": "TYPE_STRING" + }, + { + "name": "document_id", + "type": ".google.cloud.documentai.v1beta3.DocumentId" + }, + { + "name": "read_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "page_range", + "type": ".google.cloud.documentai.v1beta3.DocumentPageRange" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.GetDocumentResponse", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" + }, + "method": { + "shortName": "GetDocument", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.GetDocument", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.documentai.v1beta3.DocumentService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentService_ListDocuments_async", + "title": "DocumentProcessorService listDocuments Sample", + "origin": "API_DEFINITION", + "description": " Returns a list of documents present in the dataset.", + "canonical": true, + "file": "document_service.list_documents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 109, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDocuments", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.ListDocuments", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "return_total_size", + "type": "TYPE_BOOL" + }, + { + "name": "skip", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.ListDocumentsResponse", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" + }, + "method": { + "shortName": "ListDocuments", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.ListDocuments", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.documentai.v1beta3.DocumentService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_async", + "title": "DocumentProcessorService batchDeleteDocuments Sample", + "origin": "API_DEFINITION", + "description": " Deletes a set of documents.", + "canonical": true, + "file": "document_service.batch_delete_documents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchDeleteDocuments", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.BatchDeleteDocuments", + "async": true, + "parameters": [ + { + "name": "dataset", + "type": "TYPE_STRING" + }, + { + "name": "dataset_documents", + "type": ".google.cloud.documentai.v1beta3.BatchDatasetDocuments" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" + }, + "method": { + "shortName": "BatchDeleteDocuments", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.BatchDeleteDocuments", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.documentai.v1beta3.DocumentService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentService_GetDatasetSchema_async", + "title": "DocumentProcessorService getDatasetSchema Sample", + "origin": "API_DEFINITION", + "description": " Gets the `DatasetSchema` of a `Dataset`.", + "canonical": true, + "file": "document_service.get_dataset_schema.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDatasetSchema", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.GetDatasetSchema", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "visible_fields_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.DatasetSchema", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" + }, + "method": { + "shortName": "GetDatasetSchema", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.GetDatasetSchema", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.documentai.v1beta3.DocumentService" + } + } + } + }, + { + "regionTag": "documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_async", + "title": "DocumentProcessorService updateDatasetSchema Sample", + "origin": "API_DEFINITION", + "description": " Updates a `DatasetSchema`.", + "canonical": true, + "file": "document_service.update_dataset_schema.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDatasetSchema", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetSchema", + "async": true, + "parameters": [ + { + "name": "dataset_schema", + "type": ".google.cloud.documentai.v1beta3.DatasetSchema" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.documentai.v1beta3.DatasetSchema", + "client": { + "shortName": "DocumentServiceClient", + "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" + }, + "method": { + "shortName": "UpdateDatasetSchema", + "fullName": "google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetSchema", + "service": { + "shortName": "DocumentService", + "fullName": "google.cloud.documentai.v1beta3.DocumentService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-documentai/src/index.ts b/owl-bot-staging/google-cloud-documentai/src/index.ts new file mode 100644 index 00000000000..07b6a79e6c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/index.ts @@ -0,0 +1,28 @@ +// 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'; +import * as v1beta3 from './v1beta3'; + +const DocumentProcessorServiceClient = v1.DocumentProcessorServiceClient; +type DocumentProcessorServiceClient = v1.DocumentProcessorServiceClient; + +export {v1, v1beta3, DocumentProcessorServiceClient}; +export default {v1, v1beta3, DocumentProcessorServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client.ts b/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client.ts new file mode 100644 index 00000000000..192ecf79e44 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client.ts @@ -0,0 +1,3934 @@ +// 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, PaginationCallback, GaxCall, LocationsClient, LocationProtos} 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_processor_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './document_processor_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * 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. + * @class + * @memberof v1 + */ +export class DocumentProcessorServiceClient { + 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('documentai'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + documentProcessorServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DocumentProcessorServiceClient. + * + * @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 DocumentProcessorServiceClient({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 DocumentProcessorServiceClient; + 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 = 'documentai.' + 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; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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 = { + evaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}' + ), + humanReviewConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + processorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}' + ), + processorTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processorTypes/{processor_type}' + ), + processorVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // 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 = { + listProcessorTypes: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'processorTypes'), + listProcessors: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'processors'), + listProcessorVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'processorVersions'), + listEvaluations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'evaluations') + }; + + 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.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',additional_bindings: [{get: '/uiv1beta3/{name=projects/*}/locations',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/uiv1beta3/{name=projects/*/locations/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/uiv1beta3/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*/operations}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*/operations}',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const batchProcessDocumentsResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.BatchProcessResponse') as gax.protobuf.Type; + const batchProcessDocumentsMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.BatchProcessMetadata') as gax.protobuf.Type; + const trainProcessorVersionResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.TrainProcessorVersionResponse') as gax.protobuf.Type; + const trainProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.TrainProcessorVersionMetadata') as gax.protobuf.Type; + const deleteProcessorVersionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.DeleteProcessorVersionMetadata') as gax.protobuf.Type; + const deployProcessorVersionResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.DeployProcessorVersionResponse') as gax.protobuf.Type; + const deployProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.DeployProcessorVersionMetadata') as gax.protobuf.Type; + const undeployProcessorVersionResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.UndeployProcessorVersionResponse') as gax.protobuf.Type; + const undeployProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.UndeployProcessorVersionMetadata') as gax.protobuf.Type; + const deleteProcessorResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteProcessorMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.DeleteProcessorMetadata') as gax.protobuf.Type; + const enableProcessorResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.EnableProcessorResponse') as gax.protobuf.Type; + const enableProcessorMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.EnableProcessorMetadata') as gax.protobuf.Type; + const disableProcessorResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.DisableProcessorResponse') as gax.protobuf.Type; + const disableProcessorMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.DisableProcessorMetadata') as gax.protobuf.Type; + const setDefaultProcessorVersionResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse') as gax.protobuf.Type; + const setDefaultProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata') as gax.protobuf.Type; + const reviewDocumentResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.ReviewDocumentResponse') as gax.protobuf.Type; + const reviewDocumentMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.ReviewDocumentOperationMetadata') as gax.protobuf.Type; + const evaluateProcessorVersionResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.EvaluateProcessorVersionResponse') as gax.protobuf.Type; + const evaluateProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + batchProcessDocuments: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchProcessDocumentsResponse.decode.bind(batchProcessDocumentsResponse), + batchProcessDocumentsMetadata.decode.bind(batchProcessDocumentsMetadata)), + trainProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + trainProcessorVersionResponse.decode.bind(trainProcessorVersionResponse), + trainProcessorVersionMetadata.decode.bind(trainProcessorVersionMetadata)), + deleteProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteProcessorVersionResponse.decode.bind(deleteProcessorVersionResponse), + deleteProcessorVersionMetadata.decode.bind(deleteProcessorVersionMetadata)), + deployProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployProcessorVersionResponse.decode.bind(deployProcessorVersionResponse), + deployProcessorVersionMetadata.decode.bind(deployProcessorVersionMetadata)), + undeployProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployProcessorVersionResponse.decode.bind(undeployProcessorVersionResponse), + undeployProcessorVersionMetadata.decode.bind(undeployProcessorVersionMetadata)), + deleteProcessor: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteProcessorResponse.decode.bind(deleteProcessorResponse), + deleteProcessorMetadata.decode.bind(deleteProcessorMetadata)), + enableProcessor: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + enableProcessorResponse.decode.bind(enableProcessorResponse), + enableProcessorMetadata.decode.bind(enableProcessorMetadata)), + disableProcessor: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + disableProcessorResponse.decode.bind(disableProcessorResponse), + disableProcessorMetadata.decode.bind(disableProcessorMetadata)), + setDefaultProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + setDefaultProcessorVersionResponse.decode.bind(setDefaultProcessorVersionResponse), + setDefaultProcessorVersionMetadata.decode.bind(setDefaultProcessorVersionMetadata)), + reviewDocument: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + reviewDocumentResponse.decode.bind(reviewDocumentResponse), + reviewDocumentMetadata.decode.bind(reviewDocumentMetadata)), + evaluateProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + evaluateProcessorVersionResponse.decode.bind(evaluateProcessorVersionResponse), + evaluateProcessorVersionMetadata.decode.bind(evaluateProcessorVersionMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.documentai.v1.DocumentProcessorService', 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.documentProcessorServiceStub) { + return this.documentProcessorServiceStub; + } + + // Put together the "service stub" for + // google.cloud.documentai.v1.DocumentProcessorService. + this.documentProcessorServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.documentai.v1.DocumentProcessorService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.documentai.v1.DocumentProcessorService, + 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 documentProcessorServiceStubMethods = + ['processDocument', 'batchProcessDocuments', 'fetchProcessorTypes', 'listProcessorTypes', 'getProcessorType', 'listProcessors', 'getProcessor', 'trainProcessorVersion', 'getProcessorVersion', 'listProcessorVersions', 'deleteProcessorVersion', 'deployProcessorVersion', 'undeployProcessorVersion', 'createProcessor', 'deleteProcessor', 'enableProcessor', 'disableProcessor', 'setDefaultProcessorVersion', 'reviewDocument', 'evaluateProcessorVersion', 'getEvaluation', 'listEvaluations']; + for (const methodName of documentProcessorServiceStubMethods) { + const callPromise = this.documentProcessorServiceStub.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] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.documentProcessorServiceStub; + } + + /** + * 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 'documentai.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 'documentai.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 -- + // ------------------- +/** + * Processes a single document. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.documentai.v1.Document} request.inlineDocument + * An inline document proto. + * @param {google.cloud.documentai.v1.RawDocument} request.rawDocument + * A raw document content (bytes). + * @param {google.cloud.documentai.v1.GcsDocument} request.gcsDocument + * A raw document on Google Cloud Storage. + * @param {string} request.name + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1.Processor|Processor} or + * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} + * to use for processing. If a + * {@link protos.google.cloud.documentai.v1.Processor|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}` + * @param {boolean} request.skipHumanReview + * Whether human review should be skipped for this request. Default to + * `false`. + * @param {google.protobuf.FieldMask} request.fieldMask + * Specifies which fields to include in the + * {@link protos.google.cloud.documentai.v1.ProcessResponse.document|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}`. + * @param {google.cloud.documentai.v1.ProcessOptions} request.processOptions + * Inference-time options for the process API + * @param {number[]} [request.labels] + * 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. + * @param {boolean} [request.imagelessMode] + * Optional. Option to remove images from 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.documentai.v1.ProcessResponse|ProcessResponse}. + * 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_processor_service.process_document.js + * region_tag:documentai_v1_generated_DocumentProcessorService_ProcessDocument_async + */ + processDocument( + request?: protos.google.cloud.documentai.v1.IProcessRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1.IProcessResponse, + protos.google.cloud.documentai.v1.IProcessRequest|undefined, {}|undefined + ]>; + processDocument( + request: protos.google.cloud.documentai.v1.IProcessRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1.IProcessResponse, + protos.google.cloud.documentai.v1.IProcessRequest|null|undefined, + {}|null|undefined>): void; + processDocument( + request: protos.google.cloud.documentai.v1.IProcessRequest, + callback: Callback< + protos.google.cloud.documentai.v1.IProcessResponse, + protos.google.cloud.documentai.v1.IProcessRequest|null|undefined, + {}|null|undefined>): void; + processDocument( + request?: protos.google.cloud.documentai.v1.IProcessRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1.IProcessResponse, + protos.google.cloud.documentai.v1.IProcessRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1.IProcessResponse, + protos.google.cloud.documentai.v1.IProcessRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1.IProcessResponse, + protos.google.cloud.documentai.v1.IProcessRequest|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('processDocument request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1.IProcessResponse, + protos.google.cloud.documentai.v1.IProcessRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('processDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.processDocument(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1.IProcessResponse, + protos.google.cloud.documentai.v1.IProcessRequest|undefined, + {}|undefined + ]) => { + this._log.info('processDocument 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; + }); + } +/** + * Fetches processor types. Note that we don't use + * {@link protos.google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes|ListProcessorTypes} + * here, because it isn't paginated. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * @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.documentai.v1.FetchProcessorTypesResponse|FetchProcessorTypesResponse}. + * 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_processor_service.fetch_processor_types.js + * region_tag:documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_async + */ + fetchProcessorTypes( + request?: protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|undefined, {}|undefined + ]>; + fetchProcessorTypes( + request: protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|null|undefined, + {}|null|undefined>): void; + fetchProcessorTypes( + request: protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest, + callback: Callback< + protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|null|undefined, + {}|null|undefined>): void; + fetchProcessorTypes( + request?: protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|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('fetchProcessorTypes request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('fetchProcessorTypes response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.fetchProcessorTypes(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|undefined, + {}|undefined + ]) => { + this._log.info('fetchProcessorTypes 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 processor type detail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor type resource name. + * @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.documentai.v1.ProcessorType|ProcessorType}. + * 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_processor_service.get_processor_type.js + * region_tag:documentai_v1_generated_DocumentProcessorService_GetProcessorType_async + */ + getProcessorType( + request?: protos.google.cloud.documentai.v1.IGetProcessorTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1.IProcessorType, + protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|undefined, {}|undefined + ]>; + getProcessorType( + request: protos.google.cloud.documentai.v1.IGetProcessorTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1.IProcessorType, + protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|null|undefined, + {}|null|undefined>): void; + getProcessorType( + request: protos.google.cloud.documentai.v1.IGetProcessorTypeRequest, + callback: Callback< + protos.google.cloud.documentai.v1.IProcessorType, + protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|null|undefined, + {}|null|undefined>): void; + getProcessorType( + request?: protos.google.cloud.documentai.v1.IGetProcessorTypeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1.IProcessorType, + protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1.IProcessorType, + protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1.IProcessorType, + protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|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('getProcessorType request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1.IProcessorType, + protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getProcessorType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getProcessorType(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1.IProcessorType, + protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|undefined, + {}|undefined + ]) => { + this._log.info('getProcessorType 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 processor detail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor resource name. + * @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.documentai.v1.Processor|Processor}. + * 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_processor_service.get_processor.js + * region_tag:documentai_v1_generated_DocumentProcessorService_GetProcessor_async + */ + getProcessor( + request?: protos.google.cloud.documentai.v1.IGetProcessorRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.IGetProcessorRequest|undefined, {}|undefined + ]>; + getProcessor( + request: protos.google.cloud.documentai.v1.IGetProcessorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.IGetProcessorRequest|null|undefined, + {}|null|undefined>): void; + getProcessor( + request: protos.google.cloud.documentai.v1.IGetProcessorRequest, + callback: Callback< + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.IGetProcessorRequest|null|undefined, + {}|null|undefined>): void; + getProcessor( + request?: protos.google.cloud.documentai.v1.IGetProcessorRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.IGetProcessorRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.IGetProcessorRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.IGetProcessorRequest|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('getProcessor request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.IGetProcessorRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getProcessor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getProcessor(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.IGetProcessorRequest|undefined, + {}|undefined + ]) => { + this._log.info('getProcessor 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 processor version detail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor resource name. + * @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.documentai.v1.ProcessorVersion|ProcessorVersion}. + * 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_processor_service.get_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_async + */ + getProcessorVersion( + request?: protos.google.cloud.documentai.v1.IGetProcessorVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1.IProcessorVersion, + protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|undefined, {}|undefined + ]>; + getProcessorVersion( + request: protos.google.cloud.documentai.v1.IGetProcessorVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1.IProcessorVersion, + protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|null|undefined, + {}|null|undefined>): void; + getProcessorVersion( + request: protos.google.cloud.documentai.v1.IGetProcessorVersionRequest, + callback: Callback< + protos.google.cloud.documentai.v1.IProcessorVersion, + protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|null|undefined, + {}|null|undefined>): void; + getProcessorVersion( + request?: protos.google.cloud.documentai.v1.IGetProcessorVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1.IProcessorVersion, + protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1.IProcessorVersion, + protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1.IProcessorVersion, + protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|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('getProcessorVersion request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1.IProcessorVersion, + protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getProcessorVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getProcessorVersion(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1.IProcessorVersion, + protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|undefined, + {}|undefined + ]) => { + this._log.info('getProcessorVersion 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; + }); + } +/** + * Creates a processor from the + * {@link protos.google.cloud.documentai.v1.ProcessorType|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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` + * @param {google.cloud.documentai.v1.Processor} request.processor + * Required. The processor to be created, requires + * {@link protos.google.cloud.documentai.v1.Processor.type|Processor.type} and + * {@link protos.google.cloud.documentai.v1.Processor.display_name|Processor.display_name} + * to be set. Also, the + * {@link protos.google.cloud.documentai.v1.Processor.kms_key_name|Processor.kms_key_name} + * field must be set if the processor is under CMEK. + * @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.documentai.v1.Processor|Processor}. + * 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_processor_service.create_processor.js + * region_tag:documentai_v1_generated_DocumentProcessorService_CreateProcessor_async + */ + createProcessor( + request?: protos.google.cloud.documentai.v1.ICreateProcessorRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.ICreateProcessorRequest|undefined, {}|undefined + ]>; + createProcessor( + request: protos.google.cloud.documentai.v1.ICreateProcessorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.ICreateProcessorRequest|null|undefined, + {}|null|undefined>): void; + createProcessor( + request: protos.google.cloud.documentai.v1.ICreateProcessorRequest, + callback: Callback< + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.ICreateProcessorRequest|null|undefined, + {}|null|undefined>): void; + createProcessor( + request?: protos.google.cloud.documentai.v1.ICreateProcessorRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.ICreateProcessorRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.ICreateProcessorRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.ICreateProcessorRequest|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('createProcessor request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.ICreateProcessorRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createProcessor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createProcessor(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1.IProcessor, + protos.google.cloud.documentai.v1.ICreateProcessorRequest|undefined, + {}|undefined + ]) => { + this._log.info('createProcessor 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; + }); + } +/** + * Retrieves a specific evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1.Evaluation|Evaluation} to get. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + * @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.documentai.v1.Evaluation|Evaluation}. + * 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_processor_service.get_evaluation.js + * region_tag:documentai_v1_generated_DocumentProcessorService_GetEvaluation_async + */ + getEvaluation( + request?: protos.google.cloud.documentai.v1.IGetEvaluationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1.IEvaluation, + protos.google.cloud.documentai.v1.IGetEvaluationRequest|undefined, {}|undefined + ]>; + getEvaluation( + request: protos.google.cloud.documentai.v1.IGetEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1.IEvaluation, + protos.google.cloud.documentai.v1.IGetEvaluationRequest|null|undefined, + {}|null|undefined>): void; + getEvaluation( + request: protos.google.cloud.documentai.v1.IGetEvaluationRequest, + callback: Callback< + protos.google.cloud.documentai.v1.IEvaluation, + protos.google.cloud.documentai.v1.IGetEvaluationRequest|null|undefined, + {}|null|undefined>): void; + getEvaluation( + request?: protos.google.cloud.documentai.v1.IGetEvaluationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1.IEvaluation, + protos.google.cloud.documentai.v1.IGetEvaluationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1.IEvaluation, + protos.google.cloud.documentai.v1.IGetEvaluationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1.IEvaluation, + protos.google.cloud.documentai.v1.IGetEvaluationRequest|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('getEvaluation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1.IEvaluation, + protos.google.cloud.documentai.v1.IGetEvaluationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEvaluation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getEvaluation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1.IEvaluation, + protos.google.cloud.documentai.v1.IGetEvaluationRequest|undefined, + {}|undefined + ]) => { + this._log.info('getEvaluation 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; + }); + } + +/** + * LRO endpoint to batch process many documents. The output is written + * to Cloud Storage as JSON in the [Document] format. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of + * {@link protos.google.cloud.documentai.v1.Processor|Processor} or + * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion}. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param {google.cloud.documentai.v1.BatchDocumentsInputConfig} request.inputDocuments + * The input documents for the + * {@link protos.google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments} + * method. + * @param {google.cloud.documentai.v1.DocumentOutputConfig} request.documentOutputConfig + * The output configuration for the + * {@link protos.google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments} + * method. + * @param {boolean} request.skipHumanReview + * Whether human review should be skipped for this request. Default to + * `false`. + * @param {google.cloud.documentai.v1.ProcessOptions} request.processOptions + * Inference-time options for the process API + * @param {number[]} [request.labels] + * 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. + * @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/document_processor_service.batch_process_documents.js + * region_tag:documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_async + */ + batchProcessDocuments( + request?: protos.google.cloud.documentai.v1.IBatchProcessRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchProcessDocuments( + request: protos.google.cloud.documentai.v1.IBatchProcessRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchProcessDocuments( + request: protos.google.cloud.documentai.v1.IBatchProcessRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchProcessDocuments( + request?: protos.google.cloud.documentai.v1.IBatchProcessRequest, + 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('batchProcessDocuments response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchProcessDocuments request %j', request); + return this.innerApiCalls.batchProcessDocuments(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('batchProcessDocuments response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `batchProcessDocuments()`. + * @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/document_processor_service.batch_process_documents.js + * region_tag:documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_async + */ + async checkBatchProcessDocumentsProgress(name: string): Promise>{ + this._log.info('batchProcessDocuments 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.batchProcessDocuments, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Trains a new processor version. + * Operation metadata is returned as + * {@link protos.google.cloud.documentai.v1.TrainProcessorVersionMetadata|TrainProcessorVersionMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} request.customDocumentExtractionOptions + * Options to control Custom Document Extraction (CDE) Processor. + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions} request.foundationModelTuningOptions + * Options to control foundation model tuning of a processor. + * @param {string} request.parent + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. + * @param {google.cloud.documentai.v1.ProcessorVersion} request.processorVersion + * Required. The processor version to be created. + * @param {google.cloud.documentai.v1.DocumentSchema} [request.documentSchema] + * Optional. The schema the processor version will be trained with. + * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData} [request.inputData] + * Optional. The input data used to train the + * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion}. + * @param {string} [request.baseProcessorVersion] + * 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}`. + * @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/document_processor_service.train_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_async + */ + trainProcessorVersion( + request?: protos.google.cloud.documentai.v1.ITrainProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + trainProcessorVersion( + request: protos.google.cloud.documentai.v1.ITrainProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + trainProcessorVersion( + request: protos.google.cloud.documentai.v1.ITrainProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + trainProcessorVersion( + request?: protos.google.cloud.documentai.v1.ITrainProcessorVersionRequest, + 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({ + 'parent': request.parent ?? '', + }); + 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('trainProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('trainProcessorVersion request %j', request); + return this.innerApiCalls.trainProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('trainProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `trainProcessorVersion()`. + * @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/document_processor_service.train_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_async + */ + async checkTrainProcessorVersionProgress(name: string): Promise>{ + this._log.info('trainProcessorVersion 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.trainProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the processor version, all artifacts under the processor version + * will be deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor version resource name to be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/document_processor_service.delete_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_async + */ + deleteProcessorVersion( + request?: protos.google.cloud.documentai.v1.IDeleteProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteProcessorVersion( + request: protos.google.cloud.documentai.v1.IDeleteProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteProcessorVersion( + request: protos.google.cloud.documentai.v1.IDeleteProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteProcessorVersion( + request?: protos.google.cloud.documentai.v1.IDeleteProcessorVersionRequest, + 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('deleteProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteProcessorVersion request %j', request); + return this.innerApiCalls.deleteProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteProcessorVersion()`. + * @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/document_processor_service.delete_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_async + */ + async checkDeleteProcessorVersionProgress(name: string): Promise>{ + this._log.info('deleteProcessorVersion 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.deleteProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deploys the processor version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor version resource name to be deployed. + * @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/document_processor_service.deploy_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_async + */ + deployProcessorVersion( + request?: protos.google.cloud.documentai.v1.IDeployProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deployProcessorVersion( + request: protos.google.cloud.documentai.v1.IDeployProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployProcessorVersion( + request: protos.google.cloud.documentai.v1.IDeployProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployProcessorVersion( + request?: protos.google.cloud.documentai.v1.IDeployProcessorVersionRequest, + 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('deployProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deployProcessorVersion request %j', request); + return this.innerApiCalls.deployProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deployProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deployProcessorVersion()`. + * @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/document_processor_service.deploy_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_async + */ + async checkDeployProcessorVersionProgress(name: string): Promise>{ + this._log.info('deployProcessorVersion 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.deployProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeploys the processor version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor version resource name to be undeployed. + * @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/document_processor_service.undeploy_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_async + */ + undeployProcessorVersion( + request?: protos.google.cloud.documentai.v1.IUndeployProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeployProcessorVersion( + request: protos.google.cloud.documentai.v1.IUndeployProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployProcessorVersion( + request: protos.google.cloud.documentai.v1.IUndeployProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployProcessorVersion( + request?: protos.google.cloud.documentai.v1.IUndeployProcessorVersionRequest, + 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('undeployProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeployProcessorVersion request %j', request); + return this.innerApiCalls.undeployProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('undeployProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `undeployProcessorVersion()`. + * @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/document_processor_service.undeploy_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_async + */ + async checkUndeployProcessorVersionProgress(name: string): Promise>{ + this._log.info('undeployProcessorVersion 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.undeployProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the processor, unloads all deployed model artifacts if it was + * enabled and then deletes all artifacts associated with this processor. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor resource name to be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/document_processor_service.delete_processor.js + * region_tag:documentai_v1_generated_DocumentProcessorService_DeleteProcessor_async + */ + deleteProcessor( + request?: protos.google.cloud.documentai.v1.IDeleteProcessorRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteProcessor( + request: protos.google.cloud.documentai.v1.IDeleteProcessorRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteProcessor( + request: protos.google.cloud.documentai.v1.IDeleteProcessorRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteProcessor( + request?: protos.google.cloud.documentai.v1.IDeleteProcessorRequest, + 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('deleteProcessor response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteProcessor request %j', request); + return this.innerApiCalls.deleteProcessor(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteProcessor response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteProcessor()`. + * @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/document_processor_service.delete_processor.js + * region_tag:documentai_v1_generated_DocumentProcessorService_DeleteProcessor_async + */ + async checkDeleteProcessorProgress(name: string): Promise>{ + this._log.info('deleteProcessor 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.deleteProcessor, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Enables a processor + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor resource name to be enabled. + * @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/document_processor_service.enable_processor.js + * region_tag:documentai_v1_generated_DocumentProcessorService_EnableProcessor_async + */ + enableProcessor( + request?: protos.google.cloud.documentai.v1.IEnableProcessorRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + enableProcessor( + request: protos.google.cloud.documentai.v1.IEnableProcessorRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + enableProcessor( + request: protos.google.cloud.documentai.v1.IEnableProcessorRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + enableProcessor( + request?: protos.google.cloud.documentai.v1.IEnableProcessorRequest, + 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('enableProcessor response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('enableProcessor request %j', request); + return this.innerApiCalls.enableProcessor(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('enableProcessor response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `enableProcessor()`. + * @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/document_processor_service.enable_processor.js + * region_tag:documentai_v1_generated_DocumentProcessorService_EnableProcessor_async + */ + async checkEnableProcessorProgress(name: string): Promise>{ + this._log.info('enableProcessor 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.enableProcessor, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Disables a processor + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor resource name to be disabled. + * @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/document_processor_service.disable_processor.js + * region_tag:documentai_v1_generated_DocumentProcessorService_DisableProcessor_async + */ + disableProcessor( + request?: protos.google.cloud.documentai.v1.IDisableProcessorRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + disableProcessor( + request: protos.google.cloud.documentai.v1.IDisableProcessorRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + disableProcessor( + request: protos.google.cloud.documentai.v1.IDisableProcessorRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + disableProcessor( + request?: protos.google.cloud.documentai.v1.IDisableProcessorRequest, + 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('disableProcessor response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('disableProcessor request %j', request); + return this.innerApiCalls.disableProcessor(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('disableProcessor response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `disableProcessor()`. + * @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/document_processor_service.disable_processor.js + * region_tag:documentai_v1_generated_DocumentProcessorService_DisableProcessor_async + */ + async checkDisableProcessorProgress(name: string): Promise>{ + this._log.info('disableProcessor 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.disableProcessor, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Set the default (active) version of a + * {@link protos.google.cloud.documentai.v1.Processor|Processor} that will be used in + * {@link protos.google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument|ProcessDocument} + * and + * {@link protos.google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.processor + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1.Processor|Processor} to change default + * version. + * @param {string} request.defaultProcessorVersion + * Required. The resource name of child + * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} to use as + * default. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + * @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/document_processor_service.set_default_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_async + */ + setDefaultProcessorVersion( + request?: protos.google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + setDefaultProcessorVersion( + request: protos.google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + setDefaultProcessorVersion( + request: protos.google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + setDefaultProcessorVersion( + request?: protos.google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, + 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({ + 'processor': request.processor ?? '', + }); + 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('setDefaultProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('setDefaultProcessorVersion request %j', request); + return this.innerApiCalls.setDefaultProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('setDefaultProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `setDefaultProcessorVersion()`. + * @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/document_processor_service.set_default_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_async + */ + async checkSetDefaultProcessorVersionProgress(name: string): Promise>{ + this._log.info('setDefaultProcessorVersion 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.setDefaultProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Send a document for Human Review. The input document should be processed by + * the specified processor. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.documentai.v1.Document} request.inlineDocument + * An inline document proto. + * @param {string} request.humanReviewConfig + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1.HumanReviewConfig|HumanReviewConfig} that the + * document will be reviewed with. + * @param {boolean} request.enableSchemaValidation + * Whether the validation should be performed on the ad-hoc review request. + * @param {google.cloud.documentai.v1.ReviewDocumentRequest.Priority} request.priority + * The priority of the human review task. + * @param {google.cloud.documentai.v1.DocumentSchema} request.documentSchema + * The document schema of the human review task. + * @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/document_processor_service.review_document.js + * region_tag:documentai_v1_generated_DocumentProcessorService_ReviewDocument_async + */ + reviewDocument( + request?: protos.google.cloud.documentai.v1.IReviewDocumentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + reviewDocument( + request: protos.google.cloud.documentai.v1.IReviewDocumentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + reviewDocument( + request: protos.google.cloud.documentai.v1.IReviewDocumentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + reviewDocument( + request?: protos.google.cloud.documentai.v1.IReviewDocumentRequest, + 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({ + 'human_review_config': request.humanReviewConfig ?? '', + }); + 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('reviewDocument response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('reviewDocument request %j', request); + return this.innerApiCalls.reviewDocument(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('reviewDocument response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `reviewDocument()`. + * @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/document_processor_service.review_document.js + * region_tag:documentai_v1_generated_DocumentProcessorService_ReviewDocument_async + */ + async checkReviewDocumentProgress(name: string): Promise>{ + this._log.info('reviewDocument 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.reviewDocument, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Evaluates a ProcessorVersion against annotated documents, producing an + * Evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.processorVersion + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} to + * evaluate. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param {google.cloud.documentai.v1.BatchDocumentsInputConfig} [request.evaluationDocuments] + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. + * @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/document_processor_service.evaluate_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_async + */ + evaluateProcessorVersion( + request?: protos.google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + evaluateProcessorVersion( + request: protos.google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + evaluateProcessorVersion( + request: protos.google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + evaluateProcessorVersion( + request?: protos.google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, + 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({ + 'processor_version': request.processorVersion ?? '', + }); + 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('evaluateProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('evaluateProcessorVersion request %j', request); + return this.innerApiCalls.evaluateProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('evaluateProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `evaluateProcessorVersion()`. + * @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/document_processor_service.evaluate_processor_version.js + * region_tag:documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_async + */ + async checkEvaluateProcessorVersionProgress(name: string): Promise>{ + this._log.info('evaluateProcessorVersion 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.evaluateProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists the processor types that exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * Used to retrieve the next page of results, empty if at the end of the list. + * @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.documentai.v1.ProcessorType|ProcessorType}. + * 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 `listProcessorTypesAsync()` + * 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. + */ + listProcessorTypes( + request?: protos.google.cloud.documentai.v1.IListProcessorTypesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1.IProcessorType[], + protos.google.cloud.documentai.v1.IListProcessorTypesRequest|null, + protos.google.cloud.documentai.v1.IListProcessorTypesResponse + ]>; + listProcessorTypes( + request: protos.google.cloud.documentai.v1.IListProcessorTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.documentai.v1.IListProcessorTypesRequest, + protos.google.cloud.documentai.v1.IListProcessorTypesResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessorType>): void; + listProcessorTypes( + request: protos.google.cloud.documentai.v1.IListProcessorTypesRequest, + callback: PaginationCallback< + protos.google.cloud.documentai.v1.IListProcessorTypesRequest, + protos.google.cloud.documentai.v1.IListProcessorTypesResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessorType>): void; + listProcessorTypes( + request?: protos.google.cloud.documentai.v1.IListProcessorTypesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.documentai.v1.IListProcessorTypesRequest, + protos.google.cloud.documentai.v1.IListProcessorTypesResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessorType>, + callback?: PaginationCallback< + protos.google.cloud.documentai.v1.IListProcessorTypesRequest, + protos.google.cloud.documentai.v1.IListProcessorTypesResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessorType>): + Promise<[ + protos.google.cloud.documentai.v1.IProcessorType[], + protos.google.cloud.documentai.v1.IListProcessorTypesRequest|null, + protos.google.cloud.documentai.v1.IListProcessorTypesResponse + ]>|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.documentai.v1.IListProcessorTypesRequest, + protos.google.cloud.documentai.v1.IListProcessorTypesResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessorType>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listProcessorTypes values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listProcessorTypes request %j', request); + return this.innerApiCalls + .listProcessorTypes(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.documentai.v1.IProcessorType[], + protos.google.cloud.documentai.v1.IListProcessorTypesRequest|null, + protos.google.cloud.documentai.v1.IListProcessorTypesResponse + ]) => { + this._log.info('listProcessorTypes values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listProcessorTypes`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * Used to retrieve the next page of results, empty if at the end of the list. + * @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.documentai.v1.ProcessorType|ProcessorType} 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 `listProcessorTypesAsync()` + * 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. + */ + listProcessorTypesStream( + request?: protos.google.cloud.documentai.v1.IListProcessorTypesRequest, + 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['listProcessorTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listProcessorTypes stream %j', request); + return this.descriptors.page.listProcessorTypes.createStream( + this.innerApiCalls.listProcessorTypes as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listProcessorTypes`, 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 location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * Used to retrieve the next page of results, empty if at the end of the list. + * @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.documentai.v1.ProcessorType|ProcessorType}. 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_processor_service.list_processor_types.js + * region_tag:documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_async + */ + listProcessorTypesAsync( + request?: protos.google.cloud.documentai.v1.IListProcessorTypesRequest, + 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['listProcessorTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listProcessorTypes iterate %j', request); + return this.descriptors.page.listProcessorTypes.asyncIterate( + this.innerApiCalls['listProcessorTypes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all processors which belong to this project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * We will return the processors sorted by creation time. The page token + * will point to the next processor. + * @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.documentai.v1.Processor|Processor}. + * 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 `listProcessorsAsync()` + * 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. + */ + listProcessors( + request?: protos.google.cloud.documentai.v1.IListProcessorsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1.IProcessor[], + protos.google.cloud.documentai.v1.IListProcessorsRequest|null, + protos.google.cloud.documentai.v1.IListProcessorsResponse + ]>; + listProcessors( + request: protos.google.cloud.documentai.v1.IListProcessorsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.documentai.v1.IListProcessorsRequest, + protos.google.cloud.documentai.v1.IListProcessorsResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessor>): void; + listProcessors( + request: protos.google.cloud.documentai.v1.IListProcessorsRequest, + callback: PaginationCallback< + protos.google.cloud.documentai.v1.IListProcessorsRequest, + protos.google.cloud.documentai.v1.IListProcessorsResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessor>): void; + listProcessors( + request?: protos.google.cloud.documentai.v1.IListProcessorsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.documentai.v1.IListProcessorsRequest, + protos.google.cloud.documentai.v1.IListProcessorsResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessor>, + callback?: PaginationCallback< + protos.google.cloud.documentai.v1.IListProcessorsRequest, + protos.google.cloud.documentai.v1.IListProcessorsResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessor>): + Promise<[ + protos.google.cloud.documentai.v1.IProcessor[], + protos.google.cloud.documentai.v1.IListProcessorsRequest|null, + protos.google.cloud.documentai.v1.IListProcessorsResponse + ]>|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.documentai.v1.IListProcessorsRequest, + protos.google.cloud.documentai.v1.IListProcessorsResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessor>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listProcessors values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listProcessors request %j', request); + return this.innerApiCalls + .listProcessors(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.documentai.v1.IProcessor[], + protos.google.cloud.documentai.v1.IListProcessorsRequest|null, + protos.google.cloud.documentai.v1.IListProcessorsResponse + ]) => { + this._log.info('listProcessors values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listProcessors`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * We will return the processors sorted by creation time. The page token + * will point to the next processor. + * @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.documentai.v1.Processor|Processor} 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 `listProcessorsAsync()` + * 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. + */ + listProcessorsStream( + request?: protos.google.cloud.documentai.v1.IListProcessorsRequest, + 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['listProcessors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listProcessors stream %j', request); + return this.descriptors.page.listProcessors.createStream( + this.innerApiCalls.listProcessors as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listProcessors`, 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 (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * We will return the processors sorted by creation time. The page token + * will point to the next processor. + * @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.documentai.v1.Processor|Processor}. 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_processor_service.list_processors.js + * region_tag:documentai_v1_generated_DocumentProcessorService_ListProcessors_async + */ + listProcessorsAsync( + request?: protos.google.cloud.documentai.v1.IListProcessorsRequest, + 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['listProcessors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listProcessors iterate %j', request); + return this.descriptors.page.listProcessors.asyncIterate( + this.innerApiCalls['listProcessors'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all versions of a processor. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * We will return the processor versions sorted by creation time. The page + * token will point to the next processor version. + * @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.documentai.v1.ProcessorVersion|ProcessorVersion}. + * 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 `listProcessorVersionsAsync()` + * 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. + */ + listProcessorVersions( + request?: protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1.IProcessorVersion[], + protos.google.cloud.documentai.v1.IListProcessorVersionsRequest|null, + protos.google.cloud.documentai.v1.IListProcessorVersionsResponse + ]>; + listProcessorVersions( + request: protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, + protos.google.cloud.documentai.v1.IListProcessorVersionsResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessorVersion>): void; + listProcessorVersions( + request: protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, + protos.google.cloud.documentai.v1.IListProcessorVersionsResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessorVersion>): void; + listProcessorVersions( + request?: protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, + protos.google.cloud.documentai.v1.IListProcessorVersionsResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessorVersion>, + callback?: PaginationCallback< + protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, + protos.google.cloud.documentai.v1.IListProcessorVersionsResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessorVersion>): + Promise<[ + protos.google.cloud.documentai.v1.IProcessorVersion[], + protos.google.cloud.documentai.v1.IListProcessorVersionsRequest|null, + protos.google.cloud.documentai.v1.IListProcessorVersionsResponse + ]>|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.documentai.v1.IListProcessorVersionsRequest, + protos.google.cloud.documentai.v1.IListProcessorVersionsResponse|null|undefined, + protos.google.cloud.documentai.v1.IProcessorVersion>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listProcessorVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listProcessorVersions request %j', request); + return this.innerApiCalls + .listProcessorVersions(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.documentai.v1.IProcessorVersion[], + protos.google.cloud.documentai.v1.IListProcessorVersionsRequest|null, + protos.google.cloud.documentai.v1.IListProcessorVersionsResponse + ]) => { + this._log.info('listProcessorVersions values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listProcessorVersions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * We will return the processor versions sorted by creation time. The page + * token will point to the next processor version. + * @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.documentai.v1.ProcessorVersion|ProcessorVersion} 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 `listProcessorVersionsAsync()` + * 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. + */ + listProcessorVersionsStream( + request?: protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, + 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['listProcessorVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listProcessorVersions stream %j', request); + return this.descriptors.page.listProcessorVersions.createStream( + this.innerApiCalls.listProcessorVersions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listProcessorVersions`, 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 (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * We will return the processor versions sorted by creation time. The page + * token will point to the next processor version. + * @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.documentai.v1.ProcessorVersion|ProcessorVersion}. 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_processor_service.list_processor_versions.js + * region_tag:documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_async + */ + listProcessorVersionsAsync( + request?: protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, + 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['listProcessorVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listProcessorVersions iterate %j', request); + return this.descriptors.page.listProcessorVersions.asyncIterate( + this.innerApiCalls['listProcessorVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Retrieves a set of evaluations for a given processor version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} to list + * evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * A page token, received from a previous `ListEvaluations` call. + * Provide this to retrieve the subsequent page. + * @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.documentai.v1.Evaluation|Evaluation}. + * 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 `listEvaluationsAsync()` + * 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. + */ + listEvaluations( + request?: protos.google.cloud.documentai.v1.IListEvaluationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1.IEvaluation[], + protos.google.cloud.documentai.v1.IListEvaluationsRequest|null, + protos.google.cloud.documentai.v1.IListEvaluationsResponse + ]>; + listEvaluations( + request: protos.google.cloud.documentai.v1.IListEvaluationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.documentai.v1.IListEvaluationsRequest, + protos.google.cloud.documentai.v1.IListEvaluationsResponse|null|undefined, + protos.google.cloud.documentai.v1.IEvaluation>): void; + listEvaluations( + request: protos.google.cloud.documentai.v1.IListEvaluationsRequest, + callback: PaginationCallback< + protos.google.cloud.documentai.v1.IListEvaluationsRequest, + protos.google.cloud.documentai.v1.IListEvaluationsResponse|null|undefined, + protos.google.cloud.documentai.v1.IEvaluation>): void; + listEvaluations( + request?: protos.google.cloud.documentai.v1.IListEvaluationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.documentai.v1.IListEvaluationsRequest, + protos.google.cloud.documentai.v1.IListEvaluationsResponse|null|undefined, + protos.google.cloud.documentai.v1.IEvaluation>, + callback?: PaginationCallback< + protos.google.cloud.documentai.v1.IListEvaluationsRequest, + protos.google.cloud.documentai.v1.IListEvaluationsResponse|null|undefined, + protos.google.cloud.documentai.v1.IEvaluation>): + Promise<[ + protos.google.cloud.documentai.v1.IEvaluation[], + protos.google.cloud.documentai.v1.IListEvaluationsRequest|null, + protos.google.cloud.documentai.v1.IListEvaluationsResponse + ]>|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.documentai.v1.IListEvaluationsRequest, + protos.google.cloud.documentai.v1.IListEvaluationsResponse|null|undefined, + protos.google.cloud.documentai.v1.IEvaluation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEvaluations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEvaluations request %j', request); + return this.innerApiCalls + .listEvaluations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.documentai.v1.IEvaluation[], + protos.google.cloud.documentai.v1.IListEvaluationsRequest|null, + protos.google.cloud.documentai.v1.IListEvaluationsResponse + ]) => { + this._log.info('listEvaluations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listEvaluations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} to list + * evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * A page token, received from a previous `ListEvaluations` call. + * Provide this to retrieve the subsequent page. + * @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.documentai.v1.Evaluation|Evaluation} 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 `listEvaluationsAsync()` + * 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. + */ + listEvaluationsStream( + request?: protos.google.cloud.documentai.v1.IListEvaluationsRequest, + 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['listEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluations stream %j', request); + return this.descriptors.page.listEvaluations.createStream( + this.innerApiCalls.listEvaluations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEvaluations`, 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 resource name of the + * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} to list + * evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * A page token, received from a previous `ListEvaluations` call. + * Provide this to retrieve the subsequent page. + * @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.documentai.v1.Evaluation|Evaluation}. 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_processor_service.list_evaluations.js + * region_tag:documentai_v1_generated_DocumentProcessorService_ListEvaluations_async + */ + listEvaluationsAsync( + request?: protos.google.cloud.documentai.v1.IListEvaluationsRequest, + 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['listEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluations iterate %j', request); + return this.descriptors.page.listEvaluations.asyncIterate( + this.innerApiCalls['listEvaluations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list 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 google.cloud.location.Location | Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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 evaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @param {string} processor_version + * @param {string} evaluation + * @returns {string} Resource name string. + */ + evaluationPath(project:string,location:string,processor:string,processorVersion:string,evaluation:string) { + return this.pathTemplates.evaluationPathTemplate.render({ + project: project, + location: location, + processor: processor, + processor_version: processorVersion, + evaluation: evaluation, + }); + } + + /** + * Parse the project from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project; + } + + /** + * Parse the location from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location; + } + + /** + * Parse the processor from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).processor; + } + + /** + * Parse the processor_version from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the processor_version. + */ + matchProcessorVersionFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).processor_version; + } + + /** + * Parse the evaluation from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation; + } + + /** + * Return a fully-qualified humanReviewConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + humanReviewConfigPath(project:string,location:string,processor:string) { + return this.pathTemplates.humanReviewConfigPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from HumanReviewConfig resource. + * + * @param {string} humanReviewConfigName + * A fully-qualified path representing HumanReviewConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHumanReviewConfigName(humanReviewConfigName: string) { + return this.pathTemplates.humanReviewConfigPathTemplate.match(humanReviewConfigName).project; + } + + /** + * Parse the location from HumanReviewConfig resource. + * + * @param {string} humanReviewConfigName + * A fully-qualified path representing HumanReviewConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHumanReviewConfigName(humanReviewConfigName: string) { + return this.pathTemplates.humanReviewConfigPathTemplate.match(humanReviewConfigName).location; + } + + /** + * Parse the processor from HumanReviewConfig resource. + * + * @param {string} humanReviewConfigName + * A fully-qualified path representing HumanReviewConfig resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromHumanReviewConfigName(humanReviewConfigName: string) { + return this.pathTemplates.humanReviewConfigPathTemplate.match(humanReviewConfigName).processor; + } + + /** + * 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 processor resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + processorPath(project:string,location:string,processor:string) { + return this.pathTemplates.processorPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName).project; + } + + /** + * Parse the location from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName).location; + } + + /** + * Parse the processor from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName).processor; + } + + /** + * Return a fully-qualified processorType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor_type + * @returns {string} Resource name string. + */ + processorTypePath(project:string,location:string,processorType:string) { + return this.pathTemplates.processorTypePathTemplate.render({ + project: project, + location: location, + processor_type: processorType, + }); + } + + /** + * Parse the project from ProcessorType resource. + * + * @param {string} processorTypeName + * A fully-qualified path representing ProcessorType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorTypeName(processorTypeName: string) { + return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).project; + } + + /** + * Parse the location from ProcessorType resource. + * + * @param {string} processorTypeName + * A fully-qualified path representing ProcessorType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorTypeName(processorTypeName: string) { + return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).location; + } + + /** + * Parse the processor_type from ProcessorType resource. + * + * @param {string} processorTypeName + * A fully-qualified path representing ProcessorType resource. + * @returns {string} A string representing the processor_type. + */ + matchProcessorTypeFromProcessorTypeName(processorTypeName: string) { + return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).processor_type; + } + + /** + * Return a fully-qualified processorVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @param {string} processor_version + * @returns {string} Resource name string. + */ + processorVersionPath(project:string,location:string,processor:string,processorVersion:string) { + return this.pathTemplates.processorVersionPathTemplate.render({ + project: project, + location: location, + processor: processor, + processor_version: processorVersion, + }); + } + + /** + * Parse the project from ProcessorVersion resource. + * + * @param {string} processorVersionName + * A fully-qualified path representing ProcessorVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorVersionName(processorVersionName: string) { + return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).project; + } + + /** + * Parse the location from ProcessorVersion resource. + * + * @param {string} processorVersionName + * A fully-qualified path representing ProcessorVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorVersionName(processorVersionName: string) { + return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).location; + } + + /** + * Parse the processor from ProcessorVersion resource. + * + * @param {string} processorVersionName + * A fully-qualified path representing ProcessorVersion resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromProcessorVersionName(processorVersionName: string) { + return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).processor; + } + + /** + * Parse the processor_version from ProcessorVersion resource. + * + * @param {string} processorVersionName + * A fully-qualified path representing ProcessorVersion resource. + * @returns {string} A string representing the processor_version. + */ + matchProcessorVersionFromProcessorVersionName(processorVersionName: string) { + return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).processor_version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * 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.documentProcessorServiceStub && !this._terminated) { + return this.documentProcessorServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client_config.json b/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client_config.json new file mode 100644 index 00000000000..dc1f741acb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client_config.json @@ -0,0 +1,140 @@ +{ + "interfaces": { + "google.cloud.documentai.v1.DocumentProcessorService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "deadline_exceeded_resource_exhausted_unavailable": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "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 + }, + "cf44f94e283152b741c30fbc9df4a6abb71aa468": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 9, + "max_retry_delay_millis": 90000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "c85d7af2fd532496a9c7916f9bf84795125b2bf2": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.5, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ProcessDocument": { + "timeout_millis": 300000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cf44f94e283152b741c30fbc9df4a6abb71aa468" + }, + "BatchProcessDocuments": { + "timeout_millis": 120000, + "retry_codes_name": "idempotent", + "retry_params_name": "c85d7af2fd532496a9c7916f9bf84795125b2bf2" + }, + "FetchProcessorTypes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListProcessorTypes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetProcessorType": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListProcessors": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TrainProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListProcessorVersions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeployProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeployProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "EnableProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DisableProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetDefaultProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReviewDocument": { + "timeout_millis": 120000, + "retry_codes_name": "idempotent", + "retry_params_name": "c85d7af2fd532496a9c7916f9bf84795125b2bf2" + }, + "EvaluateProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEvaluation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEvaluations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_proto_list.json b/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_proto_list.json new file mode 100644 index 00000000000..6289f351f4a --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/documentai/v1/barcode.proto", + "../../protos/google/cloud/documentai/v1/document.proto", + "../../protos/google/cloud/documentai/v1/document_io.proto", + "../../protos/google/cloud/documentai/v1/document_processor_service.proto", + "../../protos/google/cloud/documentai/v1/document_schema.proto", + "../../protos/google/cloud/documentai/v1/evaluation.proto", + "../../protos/google/cloud/documentai/v1/geometry.proto", + "../../protos/google/cloud/documentai/v1/operation_metadata.proto", + "../../protos/google/cloud/documentai/v1/processor.proto", + "../../protos/google/cloud/documentai/v1/processor_type.proto" +] diff --git a/owl-bot-staging/google-cloud-documentai/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-documentai/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..59cbeb99dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1/gapic_metadata.json @@ -0,0 +1,259 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.documentai.v1", + "libraryPackage": "@google-cloud/documentai", + "services": { + "DocumentProcessorService": { + "clients": { + "grpc": { + "libraryClient": "DocumentProcessorServiceClient", + "rpcs": { + "ProcessDocument": { + "methods": [ + "processDocument" + ] + }, + "FetchProcessorTypes": { + "methods": [ + "fetchProcessorTypes" + ] + }, + "GetProcessorType": { + "methods": [ + "getProcessorType" + ] + }, + "GetProcessor": { + "methods": [ + "getProcessor" + ] + }, + "GetProcessorVersion": { + "methods": [ + "getProcessorVersion" + ] + }, + "CreateProcessor": { + "methods": [ + "createProcessor" + ] + }, + "GetEvaluation": { + "methods": [ + "getEvaluation" + ] + }, + "BatchProcessDocuments": { + "methods": [ + "batchProcessDocuments" + ] + }, + "TrainProcessorVersion": { + "methods": [ + "trainProcessorVersion" + ] + }, + "DeleteProcessorVersion": { + "methods": [ + "deleteProcessorVersion" + ] + }, + "DeployProcessorVersion": { + "methods": [ + "deployProcessorVersion" + ] + }, + "UndeployProcessorVersion": { + "methods": [ + "undeployProcessorVersion" + ] + }, + "DeleteProcessor": { + "methods": [ + "deleteProcessor" + ] + }, + "EnableProcessor": { + "methods": [ + "enableProcessor" + ] + }, + "DisableProcessor": { + "methods": [ + "disableProcessor" + ] + }, + "SetDefaultProcessorVersion": { + "methods": [ + "setDefaultProcessorVersion" + ] + }, + "ReviewDocument": { + "methods": [ + "reviewDocument" + ] + }, + "EvaluateProcessorVersion": { + "methods": [ + "evaluateProcessorVersion" + ] + }, + "ListProcessorTypes": { + "methods": [ + "listProcessorTypes", + "listProcessorTypesStream", + "listProcessorTypesAsync" + ] + }, + "ListProcessors": { + "methods": [ + "listProcessors", + "listProcessorsStream", + "listProcessorsAsync" + ] + }, + "ListProcessorVersions": { + "methods": [ + "listProcessorVersions", + "listProcessorVersionsStream", + "listProcessorVersionsAsync" + ] + }, + "ListEvaluations": { + "methods": [ + "listEvaluations", + "listEvaluationsStream", + "listEvaluationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DocumentProcessorServiceClient", + "rpcs": { + "ProcessDocument": { + "methods": [ + "processDocument" + ] + }, + "FetchProcessorTypes": { + "methods": [ + "fetchProcessorTypes" + ] + }, + "GetProcessorType": { + "methods": [ + "getProcessorType" + ] + }, + "GetProcessor": { + "methods": [ + "getProcessor" + ] + }, + "GetProcessorVersion": { + "methods": [ + "getProcessorVersion" + ] + }, + "CreateProcessor": { + "methods": [ + "createProcessor" + ] + }, + "GetEvaluation": { + "methods": [ + "getEvaluation" + ] + }, + "BatchProcessDocuments": { + "methods": [ + "batchProcessDocuments" + ] + }, + "TrainProcessorVersion": { + "methods": [ + "trainProcessorVersion" + ] + }, + "DeleteProcessorVersion": { + "methods": [ + "deleteProcessorVersion" + ] + }, + "DeployProcessorVersion": { + "methods": [ + "deployProcessorVersion" + ] + }, + "UndeployProcessorVersion": { + "methods": [ + "undeployProcessorVersion" + ] + }, + "DeleteProcessor": { + "methods": [ + "deleteProcessor" + ] + }, + "EnableProcessor": { + "methods": [ + "enableProcessor" + ] + }, + "DisableProcessor": { + "methods": [ + "disableProcessor" + ] + }, + "SetDefaultProcessorVersion": { + "methods": [ + "setDefaultProcessorVersion" + ] + }, + "ReviewDocument": { + "methods": [ + "reviewDocument" + ] + }, + "EvaluateProcessorVersion": { + "methods": [ + "evaluateProcessorVersion" + ] + }, + "ListProcessorTypes": { + "methods": [ + "listProcessorTypes", + "listProcessorTypesStream", + "listProcessorTypesAsync" + ] + }, + "ListProcessors": { + "methods": [ + "listProcessors", + "listProcessorsStream", + "listProcessorsAsync" + ] + }, + "ListProcessorVersions": { + "methods": [ + "listProcessorVersions", + "listProcessorVersionsStream", + "listProcessorVersionsAsync" + ] + }, + "ListEvaluations": { + "methods": [ + "listEvaluations", + "listEvaluationsStream", + "listEvaluationsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-documentai/src/v1/index.ts b/owl-bot-staging/google-cloud-documentai/src/v1/index.ts new file mode 100644 index 00000000000..d0e9c42d965 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1/index.ts @@ -0,0 +1,19 @@ +// 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 {DocumentProcessorServiceClient} from './document_processor_service_client'; diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts new file mode 100644 index 00000000000..27cb62e3cd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts @@ -0,0 +1,4176 @@ +// 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, PaginationCallback, GaxCall, LocationsClient, LocationProtos} 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/v1beta3/document_processor_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './document_processor_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * 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. + * @class + * @memberof v1beta3 + */ +export class DocumentProcessorServiceClient { + 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('documentai'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + documentProcessorServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DocumentProcessorServiceClient. + * + * @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 DocumentProcessorServiceClient({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 DocumentProcessorServiceClient; + 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 = 'documentai.' + 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; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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 = { + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}/dataset' + ), + datasetSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema' + ), + evaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}' + ), + humanReviewConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + processorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}' + ), + processorTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processorTypes/{processor_type}' + ), + processorVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + }; + + // 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 = { + listProcessorTypes: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'processorTypes'), + listProcessors: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'processors'), + listProcessorVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'processorVersions'), + listEvaluations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'evaluations') + }; + + 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.cloud.location.Locations.GetLocation',get: '/v1beta3/{name=projects/*/locations/*}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1beta3/{name=projects/*}/locations',additional_bindings: [{get: '/uiv1beta3/{name=projects/*}/locations',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1beta3/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/uiv1beta3/{name=projects/*/locations/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta3/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta3/{name=projects/*/locations/*/operations}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*/operations}',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const batchProcessDocumentsResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.BatchProcessResponse') as gax.protobuf.Type; + const batchProcessDocumentsMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.BatchProcessMetadata') as gax.protobuf.Type; + const trainProcessorVersionResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.TrainProcessorVersionResponse') as gax.protobuf.Type; + const trainProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata') as gax.protobuf.Type; + const deleteProcessorVersionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata') as gax.protobuf.Type; + const deployProcessorVersionResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse') as gax.protobuf.Type; + const deployProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata') as gax.protobuf.Type; + const undeployProcessorVersionResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse') as gax.protobuf.Type; + const undeployProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata') as gax.protobuf.Type; + const deleteProcessorResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteProcessorMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.DeleteProcessorMetadata') as gax.protobuf.Type; + const enableProcessorResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.EnableProcessorResponse') as gax.protobuf.Type; + const enableProcessorMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.EnableProcessorMetadata') as gax.protobuf.Type; + const disableProcessorResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.DisableProcessorResponse') as gax.protobuf.Type; + const disableProcessorMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.DisableProcessorMetadata') as gax.protobuf.Type; + const setDefaultProcessorVersionResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse') as gax.protobuf.Type; + const setDefaultProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata') as gax.protobuf.Type; + const reviewDocumentResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.ReviewDocumentResponse') as gax.protobuf.Type; + const reviewDocumentMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata') as gax.protobuf.Type; + const evaluateProcessorVersionResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse') as gax.protobuf.Type; + const evaluateProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata') as gax.protobuf.Type; + const importProcessorVersionResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.ImportProcessorVersionResponse') as gax.protobuf.Type; + const importProcessorVersionMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + batchProcessDocuments: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchProcessDocumentsResponse.decode.bind(batchProcessDocumentsResponse), + batchProcessDocumentsMetadata.decode.bind(batchProcessDocumentsMetadata)), + trainProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + trainProcessorVersionResponse.decode.bind(trainProcessorVersionResponse), + trainProcessorVersionMetadata.decode.bind(trainProcessorVersionMetadata)), + deleteProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteProcessorVersionResponse.decode.bind(deleteProcessorVersionResponse), + deleteProcessorVersionMetadata.decode.bind(deleteProcessorVersionMetadata)), + deployProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployProcessorVersionResponse.decode.bind(deployProcessorVersionResponse), + deployProcessorVersionMetadata.decode.bind(deployProcessorVersionMetadata)), + undeployProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeployProcessorVersionResponse.decode.bind(undeployProcessorVersionResponse), + undeployProcessorVersionMetadata.decode.bind(undeployProcessorVersionMetadata)), + deleteProcessor: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteProcessorResponse.decode.bind(deleteProcessorResponse), + deleteProcessorMetadata.decode.bind(deleteProcessorMetadata)), + enableProcessor: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + enableProcessorResponse.decode.bind(enableProcessorResponse), + enableProcessorMetadata.decode.bind(enableProcessorMetadata)), + disableProcessor: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + disableProcessorResponse.decode.bind(disableProcessorResponse), + disableProcessorMetadata.decode.bind(disableProcessorMetadata)), + setDefaultProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + setDefaultProcessorVersionResponse.decode.bind(setDefaultProcessorVersionResponse), + setDefaultProcessorVersionMetadata.decode.bind(setDefaultProcessorVersionMetadata)), + reviewDocument: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + reviewDocumentResponse.decode.bind(reviewDocumentResponse), + reviewDocumentMetadata.decode.bind(reviewDocumentMetadata)), + evaluateProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + evaluateProcessorVersionResponse.decode.bind(evaluateProcessorVersionResponse), + evaluateProcessorVersionMetadata.decode.bind(evaluateProcessorVersionMetadata)), + importProcessorVersion: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importProcessorVersionResponse.decode.bind(importProcessorVersionResponse), + importProcessorVersionMetadata.decode.bind(importProcessorVersionMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.documentai.v1beta3.DocumentProcessorService', 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.documentProcessorServiceStub) { + return this.documentProcessorServiceStub; + } + + // Put together the "service stub" for + // google.cloud.documentai.v1beta3.DocumentProcessorService. + this.documentProcessorServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.documentai.v1beta3.DocumentProcessorService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.documentai.v1beta3.DocumentProcessorService, + 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 documentProcessorServiceStubMethods = + ['processDocument', 'batchProcessDocuments', 'fetchProcessorTypes', 'listProcessorTypes', 'getProcessorType', 'listProcessors', 'getProcessor', 'trainProcessorVersion', 'getProcessorVersion', 'listProcessorVersions', 'deleteProcessorVersion', 'deployProcessorVersion', 'undeployProcessorVersion', 'createProcessor', 'deleteProcessor', 'enableProcessor', 'disableProcessor', 'setDefaultProcessorVersion', 'reviewDocument', 'evaluateProcessorVersion', 'getEvaluation', 'listEvaluations', 'importProcessorVersion']; + for (const methodName of documentProcessorServiceStubMethods) { + const callPromise = this.documentProcessorServiceStub.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] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.documentProcessorServiceStub; + } + + /** + * 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 'documentai.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 'documentai.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 -- + // ------------------- +/** + * Processes a single document. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.documentai.v1beta3.Document} request.inlineDocument + * An inline document proto. + * @param {google.cloud.documentai.v1beta3.RawDocument} request.rawDocument + * A raw document content (bytes). + * @param {google.cloud.documentai.v1beta3.GcsDocument} request.gcsDocument + * A raw document on Google Cloud Storage. + * @param {string} request.name + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1beta3.Processor|Processor} or + * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} + * to use for processing. If a + * {@link protos.google.cloud.documentai.v1beta3.Processor|Processor} is specified, the + * server will use its [default + * version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param {google.cloud.documentai.v1beta3.Document} request.document + * The document payload, the + * {@link protos.google.cloud.documentai.v1beta3.Document.content|content} and + * {@link protos.google.cloud.documentai.v1beta3.Document.mime_type|mime_type} fields must + * be set. + * @param {boolean} request.skipHumanReview + * Whether human review should be skipped for this request. Default to + * `false`. + * @param {google.protobuf.FieldMask} request.fieldMask + * Specifies which fields to include in the + * {@link protos.google.cloud.documentai.v1beta3.ProcessResponse.document|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}`. + * @param {google.cloud.documentai.v1beta3.ProcessOptions} request.processOptions + * Inference-time options for the process API + * @param {number[]} [request.labels] + * 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. + * @param {boolean} [request.imagelessMode] + * Optional. Option to remove images from 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.documentai.v1beta3.ProcessResponse|ProcessResponse}. + * 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/v1beta3/document_processor_service.process_document.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_async + */ + processDocument( + request?: protos.google.cloud.documentai.v1beta3.IProcessRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessResponse, + protos.google.cloud.documentai.v1beta3.IProcessRequest|undefined, {}|undefined + ]>; + processDocument( + request: protos.google.cloud.documentai.v1beta3.IProcessRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessResponse, + protos.google.cloud.documentai.v1beta3.IProcessRequest|null|undefined, + {}|null|undefined>): void; + processDocument( + request: protos.google.cloud.documentai.v1beta3.IProcessRequest, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessResponse, + protos.google.cloud.documentai.v1beta3.IProcessRequest|null|undefined, + {}|null|undefined>): void; + processDocument( + request?: protos.google.cloud.documentai.v1beta3.IProcessRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1beta3.IProcessResponse, + protos.google.cloud.documentai.v1beta3.IProcessRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1beta3.IProcessResponse, + protos.google.cloud.documentai.v1beta3.IProcessRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessResponse, + protos.google.cloud.documentai.v1beta3.IProcessRequest|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('processDocument request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessResponse, + protos.google.cloud.documentai.v1beta3.IProcessRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('processDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.processDocument(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1beta3.IProcessResponse, + protos.google.cloud.documentai.v1beta3.IProcessRequest|undefined, + {}|undefined + ]) => { + this._log.info('processDocument 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; + }); + } +/** + * Fetches processor types. Note that we don't use + * {@link protos.google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes|ListProcessorTypes} + * here, because it isn't paginated. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * @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.documentai.v1beta3.FetchProcessorTypesResponse|FetchProcessorTypesResponse}. + * 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/v1beta3/document_processor_service.fetch_processor_types.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_async + */ + fetchProcessorTypes( + request?: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|undefined, {}|undefined + ]>; + fetchProcessorTypes( + request: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|null|undefined, + {}|null|undefined>): void; + fetchProcessorTypes( + request: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|null|undefined, + {}|null|undefined>): void; + fetchProcessorTypes( + request?: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|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('fetchProcessorTypes request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('fetchProcessorTypes response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.fetchProcessorTypes(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, + protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|undefined, + {}|undefined + ]) => { + this._log.info('fetchProcessorTypes 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 processor type detail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor type resource name. + * @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.documentai.v1beta3.ProcessorType|ProcessorType}. + * 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/v1beta3/document_processor_service.get_processor_type.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_async + */ + getProcessorType( + request?: protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessorType, + protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|undefined, {}|undefined + ]>; + getProcessorType( + request: protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessorType, + protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|null|undefined, + {}|null|undefined>): void; + getProcessorType( + request: protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessorType, + protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|null|undefined, + {}|null|undefined>): void; + getProcessorType( + request?: protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1beta3.IProcessorType, + protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1beta3.IProcessorType, + protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessorType, + protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|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('getProcessorType request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessorType, + protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getProcessorType response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getProcessorType(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1beta3.IProcessorType, + protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|undefined, + {}|undefined + ]) => { + this._log.info('getProcessorType 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 processor detail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor resource name. + * @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.documentai.v1beta3.Processor|Processor}. + * 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/v1beta3/document_processor_service.get_processor.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_async + */ + getProcessor( + request?: protos.google.cloud.documentai.v1beta3.IGetProcessorRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|undefined, {}|undefined + ]>; + getProcessor( + request: protos.google.cloud.documentai.v1beta3.IGetProcessorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|null|undefined, + {}|null|undefined>): void; + getProcessor( + request: protos.google.cloud.documentai.v1beta3.IGetProcessorRequest, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|null|undefined, + {}|null|undefined>): void; + getProcessor( + request?: protos.google.cloud.documentai.v1beta3.IGetProcessorRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|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('getProcessor request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getProcessor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getProcessor(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|undefined, + {}|undefined + ]) => { + this._log.info('getProcessor 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 processor version detail. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor resource name. + * @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.documentai.v1beta3.ProcessorVersion|ProcessorVersion}. + * 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/v1beta3/document_processor_service.get_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_async + */ + getProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessorVersion, + protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|undefined, {}|undefined + ]>; + getProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessorVersion, + protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|null|undefined, + {}|null|undefined>): void; + getProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessorVersion, + protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|null|undefined, + {}|null|undefined>): void; + getProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1beta3.IProcessorVersion, + protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1beta3.IProcessorVersion, + protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessorVersion, + protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|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('getProcessorVersion request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessorVersion, + protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getProcessorVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getProcessorVersion(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1beta3.IProcessorVersion, + protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|undefined, + {}|undefined + ]) => { + this._log.info('getProcessorVersion 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; + }); + } +/** + * Creates a processor from the + * {@link protos.google.cloud.documentai.v1beta3.ProcessorType|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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent (project and location) under which to create the + * processor. Format: `projects/{project}/locations/{location}` + * @param {google.cloud.documentai.v1beta3.Processor} request.processor + * Required. The processor to be created, requires + * {@link protos.google.cloud.documentai.v1beta3.Processor.type|Processor.type} and + * {@link protos.google.cloud.documentai.v1beta3.Processor.display_name|Processor.display_name} + * to be set. Also, the + * {@link protos.google.cloud.documentai.v1beta3.Processor.kms_key_name|Processor.kms_key_name} + * field must be set if the processor is under CMEK. + * @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.documentai.v1beta3.Processor|Processor}. + * 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/v1beta3/document_processor_service.create_processor.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_async + */ + createProcessor( + request?: protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|undefined, {}|undefined + ]>; + createProcessor( + request: protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|null|undefined, + {}|null|undefined>): void; + createProcessor( + request: protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|null|undefined, + {}|null|undefined>): void; + createProcessor( + request?: protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|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('createProcessor request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createProcessor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createProcessor(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1beta3.IProcessor, + protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|undefined, + {}|undefined + ]) => { + this._log.info('createProcessor 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; + }); + } +/** + * Retrieves a specific evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1beta3.Evaluation|Evaluation} to get. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + * @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.documentai.v1beta3.Evaluation|Evaluation}. + * 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/v1beta3/document_processor_service.get_evaluation.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_async + */ + getEvaluation( + request?: protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IEvaluation, + protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|undefined, {}|undefined + ]>; + getEvaluation( + request: protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IEvaluation, + protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|null|undefined, + {}|null|undefined>): void; + getEvaluation( + request: protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IEvaluation, + protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|null|undefined, + {}|null|undefined>): void; + getEvaluation( + request?: protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1beta3.IEvaluation, + protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1beta3.IEvaluation, + protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IEvaluation, + protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|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('getEvaluation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1beta3.IEvaluation, + protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEvaluation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getEvaluation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1beta3.IEvaluation, + protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|undefined, + {}|undefined + ]) => { + this._log.info('getEvaluation 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; + }); + } + +/** + * LRO endpoint to batch process many documents. The output is written + * to Cloud Storage as JSON in the [Document] format. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of + * {@link protos.google.cloud.documentai.v1beta3.Processor|Processor} or + * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion}. + * Format: `projects/{project}/locations/{location}/processors/{processor}`, + * or + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param {number[]} request.inputConfigs + * The input config for each single document in the batch process. + * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig} request.outputConfig + * The overall output config for batch process. + * @param {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} request.inputDocuments + * The input documents for the + * {@link protos.google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments} + * method. + * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig} request.documentOutputConfig + * The output configuration for the + * {@link protos.google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments} + * method. + * @param {boolean} request.skipHumanReview + * Whether human review should be skipped for this request. Default to + * `false`. + * @param {google.cloud.documentai.v1beta3.ProcessOptions} request.processOptions + * Inference-time options for the process API + * @param {number[]} [request.labels] + * 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. + * @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/v1beta3/document_processor_service.batch_process_documents.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_async + */ + batchProcessDocuments( + request?: protos.google.cloud.documentai.v1beta3.IBatchProcessRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchProcessDocuments( + request: protos.google.cloud.documentai.v1beta3.IBatchProcessRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchProcessDocuments( + request: protos.google.cloud.documentai.v1beta3.IBatchProcessRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchProcessDocuments( + request?: protos.google.cloud.documentai.v1beta3.IBatchProcessRequest, + 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('batchProcessDocuments response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchProcessDocuments request %j', request); + return this.innerApiCalls.batchProcessDocuments(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('batchProcessDocuments response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `batchProcessDocuments()`. + * @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/v1beta3/document_processor_service.batch_process_documents.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_async + */ + async checkBatchProcessDocumentsProgress(name: string): Promise>{ + this._log.info('batchProcessDocuments 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.batchProcessDocuments, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Trains a new processor version. + * Operation metadata is returned as + * {@link protos.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata|TrainProcessorVersionMetadata}. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} request.customDocumentExtractionOptions + * Options to control Custom Document Extraction (CDE) Processor. + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions} request.foundationModelTuningOptions + * Options to control foundation model tuning of a processor. + * @param {string} request.parent + * Required. The parent (project, location and processor) to create the new + * version for. Format: + * `projects/{project}/locations/{location}/processors/{processor}`. + * @param {google.cloud.documentai.v1beta3.ProcessorVersion} request.processorVersion + * Required. The processor version to be created. + * @param {google.cloud.documentai.v1beta3.DocumentSchema} [request.documentSchema] + * Optional. The schema the processor version will be trained with. + * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} [request.inputData] + * Optional. The input data used to train the + * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion}. + * @param {string} [request.baseProcessorVersion] + * 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}`. + * @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/v1beta3/document_processor_service.train_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_async + */ + trainProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + trainProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + trainProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + trainProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, + 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({ + 'parent': request.parent ?? '', + }); + 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('trainProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('trainProcessorVersion request %j', request); + return this.innerApiCalls.trainProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('trainProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `trainProcessorVersion()`. + * @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/v1beta3/document_processor_service.train_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_async + */ + async checkTrainProcessorVersionProgress(name: string): Promise>{ + this._log.info('trainProcessorVersion 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.trainProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the processor version, all artifacts under the processor version + * will be deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor version resource name to be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/v1beta3/document_processor_service.delete_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_async + */ + deleteProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, + 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('deleteProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteProcessorVersion request %j', request); + return this.innerApiCalls.deleteProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteProcessorVersion()`. + * @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/v1beta3/document_processor_service.delete_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_async + */ + async checkDeleteProcessorVersionProgress(name: string): Promise>{ + this._log.info('deleteProcessorVersion 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.deleteProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deploys the processor version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor version resource name to be deployed. + * @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/v1beta3/document_processor_service.deploy_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_async + */ + deployProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deployProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deployProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, + 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('deployProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deployProcessorVersion request %j', request); + return this.innerApiCalls.deployProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deployProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deployProcessorVersion()`. + * @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/v1beta3/document_processor_service.deploy_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_async + */ + async checkDeployProcessorVersionProgress(name: string): Promise>{ + this._log.info('deployProcessorVersion 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.deployProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Undeploys the processor version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor version resource name to be undeployed. + * @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/v1beta3/document_processor_service.undeploy_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_async + */ + undeployProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + undeployProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + undeployProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, + 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('undeployProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeployProcessorVersion request %j', request); + return this.innerApiCalls.undeployProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('undeployProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `undeployProcessorVersion()`. + * @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/v1beta3/document_processor_service.undeploy_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_async + */ + async checkUndeployProcessorVersionProgress(name: string): Promise>{ + this._log.info('undeployProcessorVersion 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.undeployProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the processor, unloads all deployed model artifacts if it was + * enabled and then deletes all artifacts associated with this processor. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor resource name to be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/v1beta3/document_processor_service.delete_processor.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_async + */ + deleteProcessor( + request?: protos.google.cloud.documentai.v1beta3.IDeleteProcessorRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteProcessor( + request: protos.google.cloud.documentai.v1beta3.IDeleteProcessorRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteProcessor( + request: protos.google.cloud.documentai.v1beta3.IDeleteProcessorRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteProcessor( + request?: protos.google.cloud.documentai.v1beta3.IDeleteProcessorRequest, + 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('deleteProcessor response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteProcessor request %j', request); + return this.innerApiCalls.deleteProcessor(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteProcessor response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteProcessor()`. + * @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/v1beta3/document_processor_service.delete_processor.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_async + */ + async checkDeleteProcessorProgress(name: string): Promise>{ + this._log.info('deleteProcessor 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.deleteProcessor, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Enables a processor + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor resource name to be enabled. + * @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/v1beta3/document_processor_service.enable_processor.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_async + */ + enableProcessor( + request?: protos.google.cloud.documentai.v1beta3.IEnableProcessorRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + enableProcessor( + request: protos.google.cloud.documentai.v1beta3.IEnableProcessorRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + enableProcessor( + request: protos.google.cloud.documentai.v1beta3.IEnableProcessorRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + enableProcessor( + request?: protos.google.cloud.documentai.v1beta3.IEnableProcessorRequest, + 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('enableProcessor response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('enableProcessor request %j', request); + return this.innerApiCalls.enableProcessor(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('enableProcessor response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `enableProcessor()`. + * @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/v1beta3/document_processor_service.enable_processor.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_async + */ + async checkEnableProcessorProgress(name: string): Promise>{ + this._log.info('enableProcessor 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.enableProcessor, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Disables a processor + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The processor resource name to be disabled. + * @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/v1beta3/document_processor_service.disable_processor.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_async + */ + disableProcessor( + request?: protos.google.cloud.documentai.v1beta3.IDisableProcessorRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + disableProcessor( + request: protos.google.cloud.documentai.v1beta3.IDisableProcessorRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + disableProcessor( + request: protos.google.cloud.documentai.v1beta3.IDisableProcessorRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + disableProcessor( + request?: protos.google.cloud.documentai.v1beta3.IDisableProcessorRequest, + 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('disableProcessor response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('disableProcessor request %j', request); + return this.innerApiCalls.disableProcessor(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('disableProcessor response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `disableProcessor()`. + * @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/v1beta3/document_processor_service.disable_processor.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_async + */ + async checkDisableProcessorProgress(name: string): Promise>{ + this._log.info('disableProcessor 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.disableProcessor, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Set the default (active) version of a + * {@link protos.google.cloud.documentai.v1beta3.Processor|Processor} that will be used in + * {@link protos.google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument|ProcessDocument} + * and + * {@link protos.google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.processor + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1beta3.Processor|Processor} to change default + * version. + * @param {string} request.defaultProcessorVersion + * Required. The resource name of child + * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to use + * as default. Format: + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` + * @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/v1beta3/document_processor_service.set_default_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_async + */ + setDefaultProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + setDefaultProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + setDefaultProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + setDefaultProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, + 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({ + 'processor': request.processor ?? '', + }); + 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('setDefaultProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('setDefaultProcessorVersion request %j', request); + return this.innerApiCalls.setDefaultProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('setDefaultProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `setDefaultProcessorVersion()`. + * @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/v1beta3/document_processor_service.set_default_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_async + */ + async checkSetDefaultProcessorVersionProgress(name: string): Promise>{ + this._log.info('setDefaultProcessorVersion 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.setDefaultProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Send a document for Human Review. The input document should be processed by + * the specified processor. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.documentai.v1beta3.Document} request.inlineDocument + * An inline document proto. + * @param {string} request.humanReviewConfig + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1beta3.HumanReviewConfig|HumanReviewConfig} that + * the document will be reviewed with. + * @param {google.cloud.documentai.v1beta3.Document} request.document + * The document that needs human review. + * @param {boolean} request.enableSchemaValidation + * Whether the validation should be performed on the ad-hoc review request. + * @param {google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority} request.priority + * The priority of the human review task. + * @param {google.cloud.documentai.v1beta3.DocumentSchema} request.documentSchema + * The document schema of the human review task. + * @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/v1beta3/document_processor_service.review_document.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_async + * @deprecated ReviewDocument is deprecated and may be removed in a future version. + */ + reviewDocument( + request?: protos.google.cloud.documentai.v1beta3.IReviewDocumentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + reviewDocument( + request: protos.google.cloud.documentai.v1beta3.IReviewDocumentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + reviewDocument( + request: protos.google.cloud.documentai.v1beta3.IReviewDocumentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + reviewDocument( + request?: protos.google.cloud.documentai.v1beta3.IReviewDocumentRequest, + 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({ + 'human_review_config': request.humanReviewConfig ?? '', + }); + this.initialize().catch(err => {throw err}); + this.warn('DEP$DocumentProcessorService-$ReviewDocument','ReviewDocument is deprecated and may be removed in a future version.', 'DeprecationWarning'); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('reviewDocument response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('reviewDocument request %j', request); + return this.innerApiCalls.reviewDocument(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('reviewDocument response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `reviewDocument()`. + * @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/v1beta3/document_processor_service.review_document.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_async + * @deprecated ReviewDocument is deprecated and may be removed in a future version. + */ + async checkReviewDocumentProgress(name: string): Promise>{ + this.warn('DEP$DocumentProcessorService-$checkReviewDocumentProgress','checkReviewDocumentProgress is deprecated and may be removed in a future version.', 'DeprecationWarning'); + this._log.info('reviewDocument 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.reviewDocument, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Evaluates a ProcessorVersion against annotated documents, producing an + * Evaluation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.processorVersion + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to + * evaluate. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} [request.evaluationDocuments] + * Optional. The documents used in the evaluation. If unspecified, use the + * processor's dataset as evaluation input. + * @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/v1beta3/document_processor_service.evaluate_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_async + */ + evaluateProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + evaluateProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + evaluateProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + evaluateProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, + 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({ + 'processor_version': request.processorVersion ?? '', + }); + 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('evaluateProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('evaluateProcessorVersion request %j', request); + return this.innerApiCalls.evaluateProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('evaluateProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `evaluateProcessorVersion()`. + * @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/v1beta3/document_processor_service.evaluate_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_async + */ + async checkEvaluateProcessorVersionProgress(name: string): Promise>{ + this._log.info('evaluateProcessorVersion 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.evaluateProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Imports a processor version from source processor version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.processorVersionSource + * The source processor version to import from. The source processor version + * and destination processor need to be in the same environment and region. + * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource} request.externalProcessorVersionSource + * The source processor version to import from. It can be from a different + * environment and region than the destination processor. + * @param {string} request.parent + * Required. The destination processor name to create the processor version + * in. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * @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/v1beta3/document_processor_service.import_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_async + */ + importProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importProcessorVersion( + request: protos.google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importProcessorVersion( + request?: protos.google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, + 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({ + 'parent': request.parent ?? '', + }); + 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('importProcessorVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importProcessorVersion request %j', request); + return this.innerApiCalls.importProcessorVersion(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('importProcessorVersion response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `importProcessorVersion()`. + * @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/v1beta3/document_processor_service.import_processor_version.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_async + */ + async checkImportProcessorVersionProgress(name: string): Promise>{ + this._log.info('importProcessorVersion 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.importProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists the processor types that exist. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * Used to retrieve the next page of results, empty if at the end of the list. + * @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.documentai.v1beta3.ProcessorType|ProcessorType}. + * 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 `listProcessorTypesAsync()` + * 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. + */ + listProcessorTypes( + request?: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessorType[], + protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest|null, + protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse + ]>; + listProcessorTypes( + request: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessorType>): void; + listProcessorTypes( + request: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, + callback: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessorType>): void; + listProcessorTypes( + request?: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessorType>, + callback?: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessorType>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessorType[], + protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest|null, + protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse + ]>|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.documentai.v1beta3.IListProcessorTypesRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessorType>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listProcessorTypes values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listProcessorTypes request %j', request); + return this.innerApiCalls + .listProcessorTypes(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.documentai.v1beta3.IProcessorType[], + protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest|null, + protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse + ]) => { + this._log.info('listProcessorTypes values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listProcessorTypes`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * Used to retrieve the next page of results, empty if at the end of the list. + * @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.documentai.v1beta3.ProcessorType|ProcessorType} 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 `listProcessorTypesAsync()` + * 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. + */ + listProcessorTypesStream( + request?: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, + 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['listProcessorTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listProcessorTypes stream %j', request); + return this.descriptors.page.listProcessorTypes.createStream( + this.innerApiCalls.listProcessorTypes as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listProcessorTypes`, 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 location of processor types to list. + * Format: `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * Used to retrieve the next page of results, empty if at the end of the list. + * @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.documentai.v1beta3.ProcessorType|ProcessorType}. 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/v1beta3/document_processor_service.list_processor_types.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_async + */ + listProcessorTypesAsync( + request?: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, + 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['listProcessorTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listProcessorTypes iterate %j', request); + return this.descriptors.page.listProcessorTypes.asyncIterate( + this.innerApiCalls['listProcessorTypes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all processors which belong to this project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * We will return the processors sorted by creation time. The page token + * will point to the next processor. + * @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.documentai.v1beta3.Processor|Processor}. + * 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 `listProcessorsAsync()` + * 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. + */ + listProcessors( + request?: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessor[], + protos.google.cloud.documentai.v1beta3.IListProcessorsRequest|null, + protos.google.cloud.documentai.v1beta3.IListProcessorsResponse + ]>; + listProcessors( + request: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessor>): void; + listProcessors( + request: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, + callback: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessor>): void; + listProcessors( + request?: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessor>, + callback?: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessor>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessor[], + protos.google.cloud.documentai.v1beta3.IListProcessorsRequest|null, + protos.google.cloud.documentai.v1beta3.IListProcessorsResponse + ]>|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.documentai.v1beta3.IListProcessorsRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessor>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listProcessors values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listProcessors request %j', request); + return this.innerApiCalls + .listProcessors(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.documentai.v1beta3.IProcessor[], + protos.google.cloud.documentai.v1beta3.IListProcessorsRequest|null, + protos.google.cloud.documentai.v1beta3.IListProcessorsResponse + ]) => { + this._log.info('listProcessors values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listProcessors`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * We will return the processors sorted by creation time. The page token + * will point to the next processor. + * @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.documentai.v1beta3.Processor|Processor} 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 `listProcessorsAsync()` + * 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. + */ + listProcessorsStream( + request?: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, + 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['listProcessors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listProcessors stream %j', request); + return this.descriptors.page.listProcessors.createStream( + this.innerApiCalls.listProcessors as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listProcessors`, 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 (project and location) which owns this collection of + * Processors. Format: `projects/{project}/locations/{location}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * We will return the processors sorted by creation time. The page token + * will point to the next processor. + * @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.documentai.v1beta3.Processor|Processor}. 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/v1beta3/document_processor_service.list_processors.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_async + */ + listProcessorsAsync( + request?: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, + 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['listProcessors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listProcessors iterate %j', request); + return this.descriptors.page.listProcessors.asyncIterate( + this.innerApiCalls['listProcessors'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all versions of a processor. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * We will return the processor versions sorted by creation time. The page + * token will point to the next processor version. + * @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.documentai.v1beta3.ProcessorVersion|ProcessorVersion}. + * 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 `listProcessorVersionsAsync()` + * 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. + */ + listProcessorVersions( + request?: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessorVersion[], + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest|null, + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse + ]>; + listProcessorVersions( + request: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessorVersion>): void; + listProcessorVersions( + request: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessorVersion>): void; + listProcessorVersions( + request?: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessorVersion>, + callback?: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessorVersion>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IProcessorVersion[], + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest|null, + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse + ]>|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.documentai.v1beta3.IListProcessorVersionsRequest, + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IProcessorVersion>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listProcessorVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listProcessorVersions request %j', request); + return this.innerApiCalls + .listProcessorVersions(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.documentai.v1beta3.IProcessorVersion[], + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest|null, + protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse + ]) => { + this._log.info('listProcessorVersions values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listProcessorVersions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * We will return the processor versions sorted by creation time. The page + * token will point to the next processor version. + * @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.documentai.v1beta3.ProcessorVersion|ProcessorVersion} 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 `listProcessorVersionsAsync()` + * 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. + */ + listProcessorVersionsStream( + request?: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, + 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['listProcessorVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listProcessorVersions stream %j', request); + return this.descriptors.page.listProcessorVersions.createStream( + this.innerApiCalls.listProcessorVersions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listProcessorVersions`, 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 (project, location and processor) to list all + * versions. Format: + * `projects/{project}/locations/{location}/processors/{processor}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * We will return the processor versions sorted by creation time. The page + * token will point to the next processor version. + * @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.documentai.v1beta3.ProcessorVersion|ProcessorVersion}. 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/v1beta3/document_processor_service.list_processor_versions.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_async + */ + listProcessorVersionsAsync( + request?: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, + 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['listProcessorVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listProcessorVersions iterate %j', request); + return this.descriptors.page.listProcessorVersions.asyncIterate( + this.innerApiCalls['listProcessorVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Retrieves a set of evaluations for a given processor version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to + * list evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * A page token, received from a previous `ListEvaluations` call. + * Provide this to retrieve the subsequent page. + * @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.documentai.v1beta3.Evaluation|Evaluation}. + * 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 `listEvaluationsAsync()` + * 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. + */ + listEvaluations( + request?: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IEvaluation[], + protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest|null, + protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse + ]>; + listEvaluations( + request: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, + protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IEvaluation>): void; + listEvaluations( + request: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, + callback: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, + protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IEvaluation>): void; + listEvaluations( + request?: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, + protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IEvaluation>, + callback?: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, + protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IEvaluation>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IEvaluation[], + protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest|null, + protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse + ]>|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.documentai.v1beta3.IListEvaluationsRequest, + protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IEvaluation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEvaluations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEvaluations request %j', request); + return this.innerApiCalls + .listEvaluations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.documentai.v1beta3.IEvaluation[], + protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest|null, + protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse + ]) => { + this._log.info('listEvaluations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listEvaluations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the + * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to + * list evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * A page token, received from a previous `ListEvaluations` call. + * Provide this to retrieve the subsequent page. + * @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.documentai.v1beta3.Evaluation|Evaluation} 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 `listEvaluationsAsync()` + * 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. + */ + listEvaluationsStream( + request?: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, + 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['listEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluations stream %j', request); + return this.descriptors.page.listEvaluations.createStream( + this.innerApiCalls.listEvaluations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listEvaluations`, 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 resource name of the + * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to + * list evaluations for. + * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + * @param {number} request.pageSize + * 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`. + * @param {string} request.pageToken + * A page token, received from a previous `ListEvaluations` call. + * Provide this to retrieve the subsequent page. + * @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.documentai.v1beta3.Evaluation|Evaluation}. 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/v1beta3/document_processor_service.list_evaluations.js + * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_async + */ + listEvaluationsAsync( + request?: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, + 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['listEvaluations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listEvaluations iterate %j', request); + return this.descriptors.page.listEvaluations.asyncIterate( + this.innerApiCalls['listEvaluations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list 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 google.cloud.location.Location | Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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 dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,processor:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the processor from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).processor; + } + + /** + * Return a fully-qualified datasetSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + datasetSchemaPath(project:string,location:string,processor:string) { + return this.pathTemplates.datasetSchemaPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from DatasetSchema resource. + * + * @param {string} datasetSchemaName + * A fully-qualified path representing DatasetSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetSchemaName(datasetSchemaName: string) { + return this.pathTemplates.datasetSchemaPathTemplate.match(datasetSchemaName).project; + } + + /** + * Parse the location from DatasetSchema resource. + * + * @param {string} datasetSchemaName + * A fully-qualified path representing DatasetSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetSchemaName(datasetSchemaName: string) { + return this.pathTemplates.datasetSchemaPathTemplate.match(datasetSchemaName).location; + } + + /** + * Parse the processor from DatasetSchema resource. + * + * @param {string} datasetSchemaName + * A fully-qualified path representing DatasetSchema resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromDatasetSchemaName(datasetSchemaName: string) { + return this.pathTemplates.datasetSchemaPathTemplate.match(datasetSchemaName).processor; + } + + /** + * Return a fully-qualified evaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @param {string} processor_version + * @param {string} evaluation + * @returns {string} Resource name string. + */ + evaluationPath(project:string,location:string,processor:string,processorVersion:string,evaluation:string) { + return this.pathTemplates.evaluationPathTemplate.render({ + project: project, + location: location, + processor: processor, + processor_version: processorVersion, + evaluation: evaluation, + }); + } + + /** + * Parse the project from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project; + } + + /** + * Parse the location from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location; + } + + /** + * Parse the processor from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).processor; + } + + /** + * Parse the processor_version from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the processor_version. + */ + matchProcessorVersionFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).processor_version; + } + + /** + * Parse the evaluation from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation; + } + + /** + * Return a fully-qualified humanReviewConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + humanReviewConfigPath(project:string,location:string,processor:string) { + return this.pathTemplates.humanReviewConfigPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from HumanReviewConfig resource. + * + * @param {string} humanReviewConfigName + * A fully-qualified path representing HumanReviewConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHumanReviewConfigName(humanReviewConfigName: string) { + return this.pathTemplates.humanReviewConfigPathTemplate.match(humanReviewConfigName).project; + } + + /** + * Parse the location from HumanReviewConfig resource. + * + * @param {string} humanReviewConfigName + * A fully-qualified path representing HumanReviewConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHumanReviewConfigName(humanReviewConfigName: string) { + return this.pathTemplates.humanReviewConfigPathTemplate.match(humanReviewConfigName).location; + } + + /** + * Parse the processor from HumanReviewConfig resource. + * + * @param {string} humanReviewConfigName + * A fully-qualified path representing HumanReviewConfig resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromHumanReviewConfigName(humanReviewConfigName: string) { + return this.pathTemplates.humanReviewConfigPathTemplate.match(humanReviewConfigName).processor; + } + + /** + * 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 processor resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + processorPath(project:string,location:string,processor:string) { + return this.pathTemplates.processorPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName).project; + } + + /** + * Parse the location from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName).location; + } + + /** + * Parse the processor from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName).processor; + } + + /** + * Return a fully-qualified processorType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor_type + * @returns {string} Resource name string. + */ + processorTypePath(project:string,location:string,processorType:string) { + return this.pathTemplates.processorTypePathTemplate.render({ + project: project, + location: location, + processor_type: processorType, + }); + } + + /** + * Parse the project from ProcessorType resource. + * + * @param {string} processorTypeName + * A fully-qualified path representing ProcessorType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorTypeName(processorTypeName: string) { + return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).project; + } + + /** + * Parse the location from ProcessorType resource. + * + * @param {string} processorTypeName + * A fully-qualified path representing ProcessorType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorTypeName(processorTypeName: string) { + return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).location; + } + + /** + * Parse the processor_type from ProcessorType resource. + * + * @param {string} processorTypeName + * A fully-qualified path representing ProcessorType resource. + * @returns {string} A string representing the processor_type. + */ + matchProcessorTypeFromProcessorTypeName(processorTypeName: string) { + return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).processor_type; + } + + /** + * Return a fully-qualified processorVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @param {string} processor_version + * @returns {string} Resource name string. + */ + processorVersionPath(project:string,location:string,processor:string,processorVersion:string) { + return this.pathTemplates.processorVersionPathTemplate.render({ + project: project, + location: location, + processor: processor, + processor_version: processorVersion, + }); + } + + /** + * Parse the project from ProcessorVersion resource. + * + * @param {string} processorVersionName + * A fully-qualified path representing ProcessorVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorVersionName(processorVersionName: string) { + return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).project; + } + + /** + * Parse the location from ProcessorVersion resource. + * + * @param {string} processorVersionName + * A fully-qualified path representing ProcessorVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorVersionName(processorVersionName: string) { + return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).location; + } + + /** + * Parse the processor from ProcessorVersion resource. + * + * @param {string} processorVersionName + * A fully-qualified path representing ProcessorVersion resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromProcessorVersionName(processorVersionName: string) { + return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).processor; + } + + /** + * Parse the processor_version from ProcessorVersion resource. + * + * @param {string} processorVersionName + * A fully-qualified path representing ProcessorVersion resource. + * @returns {string} A string representing the processor_version. + */ + matchProcessorVersionFromProcessorVersionName(processorVersionName: string) { + return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).processor_version; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * 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.documentProcessorServiceStub && !this._terminated) { + return this.documentProcessorServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client_config.json b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client_config.json new file mode 100644 index 00000000000..04847ad3c4f --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client_config.json @@ -0,0 +1,144 @@ +{ + "interfaces": { + "google.cloud.documentai.v1beta3.DocumentProcessorService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "deadline_exceeded_resource_exhausted_unavailable": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "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 + }, + "cf44f94e283152b741c30fbc9df4a6abb71aa468": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 9, + "max_retry_delay_millis": 90000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "c85d7af2fd532496a9c7916f9bf84795125b2bf2": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.5, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ProcessDocument": { + "timeout_millis": 300000, + "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", + "retry_params_name": "cf44f94e283152b741c30fbc9df4a6abb71aa468" + }, + "BatchProcessDocuments": { + "timeout_millis": 120000, + "retry_codes_name": "idempotent", + "retry_params_name": "c85d7af2fd532496a9c7916f9bf84795125b2bf2" + }, + "FetchProcessorTypes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListProcessorTypes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetProcessorType": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListProcessors": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TrainProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListProcessorVersions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeployProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeployProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "EnableProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DisableProcessor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetDefaultProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReviewDocument": { + "timeout_millis": 120000, + "retry_codes_name": "idempotent", + "retry_params_name": "c85d7af2fd532496a9c7916f9bf84795125b2bf2" + }, + "EvaluateProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEvaluation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListEvaluations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportProcessorVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_proto_list.json b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_proto_list.json new file mode 100644 index 00000000000..db4c908da7b --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_proto_list.json @@ -0,0 +1,14 @@ +[ + "../../protos/google/cloud/documentai/v1beta3/barcode.proto", + "../../protos/google/cloud/documentai/v1beta3/dataset.proto", + "../../protos/google/cloud/documentai/v1beta3/document.proto", + "../../protos/google/cloud/documentai/v1beta3/document_io.proto", + "../../protos/google/cloud/documentai/v1beta3/document_processor_service.proto", + "../../protos/google/cloud/documentai/v1beta3/document_schema.proto", + "../../protos/google/cloud/documentai/v1beta3/document_service.proto", + "../../protos/google/cloud/documentai/v1beta3/evaluation.proto", + "../../protos/google/cloud/documentai/v1beta3/geometry.proto", + "../../protos/google/cloud/documentai/v1beta3/operation_metadata.proto", + "../../protos/google/cloud/documentai/v1beta3/processor.proto", + "../../protos/google/cloud/documentai/v1beta3/processor_type.proto" +] diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client.ts b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client.ts new file mode 100644 index 00000000000..514109c7b44 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client.ts @@ -0,0 +1,2032 @@ +// 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, PaginationCallback, GaxCall, LocationsClient, LocationProtos} 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/v1beta3/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; + +/** + * Service to call Cloud DocumentAI to manage document collection (dataset). + * @class + * @memberof v1beta3 + */ +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('documentai'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + 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 = 'documentai.' + 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; + } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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 = { + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}/dataset' + ), + datasetSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema' + ), + evaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}' + ), + processorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}' + ), + processorTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processorTypes/{processor_type}' + ), + processorVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}' + ), + }; + + // 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 = { + listDocuments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documentMetadata') + }; + + 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.cloud.location.Locations.GetLocation',get: '/v1beta3/{name=projects/*/locations/*}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1beta3/{name=projects/*}/locations',additional_bindings: [{get: '/uiv1beta3/{name=projects/*}/locations',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1beta3/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/uiv1beta3/{name=projects/*/locations/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta3/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta3/{name=projects/*/locations/*/operations}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*/operations}',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const updateDatasetResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.Dataset') as gax.protobuf.Type; + const updateDatasetMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata') as gax.protobuf.Type; + const importDocumentsResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.ImportDocumentsResponse') as gax.protobuf.Type; + const importDocumentsMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.ImportDocumentsMetadata') as gax.protobuf.Type; + const batchDeleteDocumentsResponse = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse') as gax.protobuf.Type; + const batchDeleteDocumentsMetadata = protoFilesRoot.lookup( + '.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + updateDataset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDatasetResponse.decode.bind(updateDatasetResponse), + updateDatasetMetadata.decode.bind(updateDatasetMetadata)), + importDocuments: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importDocumentsResponse.decode.bind(importDocumentsResponse), + importDocumentsMetadata.decode.bind(importDocumentsMetadata)), + batchDeleteDocuments: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + batchDeleteDocumentsResponse.decode.bind(batchDeleteDocumentsResponse), + batchDeleteDocumentsMetadata.decode.bind(batchDeleteDocumentsMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.documentai.v1beta3.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.documentai.v1beta3.DocumentService. + this.documentServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.documentai.v1beta3.DocumentService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.documentai.v1beta3.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 = + ['updateDataset', 'importDocuments', 'getDocument', 'listDocuments', 'batchDeleteDocuments', 'getDatasetSchema', 'updateDatasetSchema']; + 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] || + this.descriptors.longrunning[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 'documentai.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 'documentai.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 -- + // ------------------- +/** + * Returns relevant fields present in the requested document. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.dataset + * Required. The resource name of the dataset that the document belongs to . + * Format: + * projects/{project}/locations/{location}/processors/{processor}/dataset + * @param {google.cloud.documentai.v1beta3.DocumentId} request.documentId + * Required. Document identifier. + * @param {google.protobuf.FieldMask} request.readMask + * If set, only fields listed here will be returned. Otherwise, all fields + * will be returned by default. + * @param {google.cloud.documentai.v1beta3.DocumentPageRange} request.pageRange + * List of pages for which the fields specified in the `read_mask` must + * be served. + * @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.documentai.v1beta3.GetDocumentResponse|GetDocumentResponse}. + * 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/v1beta3/document_service.get_document.js + * region_tag:documentai_v1beta3_generated_DocumentService_GetDocument_async + */ + getDocument( + request?: protos.google.cloud.documentai.v1beta3.IGetDocumentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, + protos.google.cloud.documentai.v1beta3.IGetDocumentRequest|undefined, {}|undefined + ]>; + getDocument( + request: protos.google.cloud.documentai.v1beta3.IGetDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, + protos.google.cloud.documentai.v1beta3.IGetDocumentRequest|null|undefined, + {}|null|undefined>): void; + getDocument( + request: protos.google.cloud.documentai.v1beta3.IGetDocumentRequest, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, + protos.google.cloud.documentai.v1beta3.IGetDocumentRequest|null|undefined, + {}|null|undefined>): void; + getDocument( + request?: protos.google.cloud.documentai.v1beta3.IGetDocumentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, + protos.google.cloud.documentai.v1beta3.IGetDocumentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, + protos.google.cloud.documentai.v1beta3.IGetDocumentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, + protos.google.cloud.documentai.v1beta3.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({ + 'dataset': request.dataset ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getDocument request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, + protos.google.cloud.documentai.v1beta3.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.documentai.v1beta3.IGetDocumentResponse, + protos.google.cloud.documentai.v1beta3.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; + }); + } +/** + * Gets the `DatasetSchema` of a `Dataset`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The dataset schema resource name. + * Format: + * projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema + * @param {boolean} request.visibleFieldsOnly + * If set, only returns the visible fields of the schema. + * @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.documentai.v1beta3.DatasetSchema|DatasetSchema}. + * 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/v1beta3/document_service.get_dataset_schema.js + * region_tag:documentai_v1beta3_generated_DocumentService_GetDatasetSchema_async + */ + getDatasetSchema( + request?: protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|undefined, {}|undefined + ]>; + getDatasetSchema( + request: protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|null|undefined, + {}|null|undefined>): void; + getDatasetSchema( + request: protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|null|undefined, + {}|null|undefined>): void; + getDatasetSchema( + request?: protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|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('getDatasetSchema request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDatasetSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getDatasetSchema(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|undefined, + {}|undefined + ]) => { + this._log.info('getDatasetSchema 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 `DatasetSchema`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.documentai.v1beta3.DatasetSchema} request.datasetSchema + * Required. The name field of the `DatasetSchema` is used to identify the + * resource to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.documentai.v1beta3.DatasetSchema|DatasetSchema}. + * 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/v1beta3/document_service.update_dataset_schema.js + * region_tag:documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_async + */ + updateDatasetSchema( + request?: protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|undefined, {}|undefined + ]>; + updateDatasetSchema( + request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|null|undefined, + {}|null|undefined>): void; + updateDatasetSchema( + request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, + callback: Callback< + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|null|undefined, + {}|null|undefined>): void; + updateDatasetSchema( + request?: protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|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({ + 'dataset_schema.name': request.datasetSchema!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateDatasetSchema request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDatasetSchema response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateDatasetSchema(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.documentai.v1beta3.IDatasetSchema, + protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateDatasetSchema 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 metadata associated with a dataset. + * Note that this method requires the + * `documentai.googleapis.com/datasets.update` 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.documentai.v1beta3.Dataset} request.dataset + * Required. The `name` field of the `Dataset` is used to identify the + * resource to be updated. + * @param {google.protobuf.FieldMask} request.updateMask + * The update mask applies to the resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/v1beta3/document_service.update_dataset.js + * region_tag:documentai_v1beta3_generated_DocumentService_UpdateDataset_async + */ + updateDataset( + request?: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateDataset( + request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateDataset( + request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateDataset( + request?: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, + 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({ + 'dataset.name': request.dataset!.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('updateDataset response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateDataset request %j', request); + return this.innerApiCalls.updateDataset(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateDataset response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateDataset()`. + * @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/v1beta3/document_service.update_dataset.js + * region_tag:documentai_v1beta3_generated_DocumentService_UpdateDataset_async + */ + async checkUpdateDatasetProgress(name: string): Promise>{ + this._log.info('updateDataset 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.updateDataset, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Import documents into a dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.dataset + * Required. The dataset resource name. + * Format: + * projects/{project}/locations/{location}/processors/{processor}/dataset + * @param {number[]} request.batchDocumentsImportConfigs + * Required. The Cloud Storage uri containing raw documents that must be + * imported. + * @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/v1beta3/document_service.import_documents.js + * region_tag:documentai_v1beta3_generated_DocumentService_ImportDocuments_async + */ + importDocuments( + request?: protos.google.cloud.documentai.v1beta3.IImportDocumentsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + importDocuments( + request: protos.google.cloud.documentai.v1beta3.IImportDocumentsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importDocuments( + request: protos.google.cloud.documentai.v1beta3.IImportDocumentsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + importDocuments( + request?: protos.google.cloud.documentai.v1beta3.IImportDocumentsRequest, + 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({ + 'dataset': request.dataset ?? '', + }); + 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('importDocuments response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importDocuments request %j', request); + return this.innerApiCalls.importDocuments(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('importDocuments response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `importDocuments()`. + * @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/v1beta3/document_service.import_documents.js + * region_tag:documentai_v1beta3_generated_DocumentService_ImportDocuments_async + */ + async checkImportDocumentsProgress(name: string): Promise>{ + this._log.info('importDocuments 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.importDocuments, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a set of documents. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.dataset + * Required. The dataset resource name. + * Format: + * projects/{project}/locations/{location}/processors/{processor}/dataset + * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments} request.datasetDocuments + * Required. Dataset documents input. If given `filter`, all documents + * satisfying the filter will be deleted. If given documentIds, a maximum of + * 50 documents can be deleted in a batch. The request will be rejected if + * more than 50 document_ids are provided. + * @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/v1beta3/document_service.batch_delete_documents.js + * region_tag:documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_async + */ + batchDeleteDocuments( + request?: protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + batchDeleteDocuments( + request: protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchDeleteDocuments( + request: protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + batchDeleteDocuments( + request?: protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, + 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({ + 'dataset': request.dataset ?? '', + }); + 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('batchDeleteDocuments response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchDeleteDocuments request %j', request); + return this.innerApiCalls.batchDeleteDocuments(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('batchDeleteDocuments response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `batchDeleteDocuments()`. + * @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/v1beta3/document_service.batch_delete_documents.js + * region_tag:documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_async + */ + async checkBatchDeleteDocumentsProgress(name: string): Promise>{ + this._log.info('batchDeleteDocuments 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.batchDeleteDocuments, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Returns a list of documents present in the dataset. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.dataset + * Required. The resource name of the dataset to be listed. + * Format: + * projects/{project}/locations/{location}/processors/{processor}/dataset + * @param {number} request.pageSize + * The maximum number of documents to return. The service may return + * fewer than this value. + * If unspecified, at most 20 documents will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous `ListDocuments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDocuments` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Query to filter the documents based on + * https://google.aip.dev/160. + * ## Currently support query strings are: + * + * `SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED` + * - `LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED` + * - `DisplayName=\"file_name.pdf\"` + * - `EntityType=abc/def` + * - `TagName=\"auto-labeling-running\"|\"sampled\"` + * + * Note: + * - Only `AND`, `=` and `!=` are supported. + * e.g. `DisplayName=file_name AND EntityType!=abc` IS supported. + * - Wildcard `*` is supported only in `DisplayName` filter + * - No duplicate filter keys are allowed, + * e.g. `EntityType=a AND EntityType=b` is NOT supported. + * - String match is case sensitive (for filter `DisplayName` & `EntityType`). + * @param {boolean} [request.returnTotalSize] + * Optional. Controls if the request requires a total size of matched + * documents. See + * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.total_size|ListDocumentsResponse.total_size}. + * + * Enabling this flag may adversely impact performance. + * + * Defaults to false. + * @param {number} [request.skip] + * Optional. Number of results to skip beginning from the `page_token` if + * provided. https://google.aip.dev/158#skipping-results. It must be a + * non-negative integer. Negative values will be rejected. Note that this is + * not the number of pages to skip. If this value causes the cursor to move + * past the end of results, + * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.document_metadata|ListDocumentsResponse.document_metadata} + * and + * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token} + * will be empty. + * @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.documentai.v1beta3.DocumentMetadata|DocumentMetadata}. + * 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 `listDocumentsAsync()` + * 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. + */ + listDocuments( + request?: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.documentai.v1beta3.IDocumentMetadata[], + protos.google.cloud.documentai.v1beta3.IListDocumentsRequest|null, + protos.google.cloud.documentai.v1beta3.IListDocumentsResponse + ]>; + listDocuments( + request: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, + protos.google.cloud.documentai.v1beta3.IListDocumentsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IDocumentMetadata>): void; + listDocuments( + request: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, + callback: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, + protos.google.cloud.documentai.v1beta3.IListDocumentsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IDocumentMetadata>): void; + listDocuments( + request?: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, + protos.google.cloud.documentai.v1beta3.IListDocumentsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IDocumentMetadata>, + callback?: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, + protos.google.cloud.documentai.v1beta3.IListDocumentsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IDocumentMetadata>): + Promise<[ + protos.google.cloud.documentai.v1beta3.IDocumentMetadata[], + protos.google.cloud.documentai.v1beta3.IListDocumentsRequest|null, + protos.google.cloud.documentai.v1beta3.IListDocumentsResponse + ]>|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({ + 'dataset': request.dataset ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, + protos.google.cloud.documentai.v1beta3.IListDocumentsResponse|null|undefined, + protos.google.cloud.documentai.v1beta3.IDocumentMetadata>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDocuments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDocuments request %j', request); + return this.innerApiCalls + .listDocuments(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.documentai.v1beta3.IDocumentMetadata[], + protos.google.cloud.documentai.v1beta3.IListDocumentsRequest|null, + protos.google.cloud.documentai.v1beta3.IListDocumentsResponse + ]) => { + this._log.info('listDocuments values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDocuments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.dataset + * Required. The resource name of the dataset to be listed. + * Format: + * projects/{project}/locations/{location}/processors/{processor}/dataset + * @param {number} request.pageSize + * The maximum number of documents to return. The service may return + * fewer than this value. + * If unspecified, at most 20 documents will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous `ListDocuments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDocuments` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Query to filter the documents based on + * https://google.aip.dev/160. + * ## Currently support query strings are: + * + * `SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED` + * - `LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED` + * - `DisplayName=\"file_name.pdf\"` + * - `EntityType=abc/def` + * - `TagName=\"auto-labeling-running\"|\"sampled\"` + * + * Note: + * - Only `AND`, `=` and `!=` are supported. + * e.g. `DisplayName=file_name AND EntityType!=abc` IS supported. + * - Wildcard `*` is supported only in `DisplayName` filter + * - No duplicate filter keys are allowed, + * e.g. `EntityType=a AND EntityType=b` is NOT supported. + * - String match is case sensitive (for filter `DisplayName` & `EntityType`). + * @param {boolean} [request.returnTotalSize] + * Optional. Controls if the request requires a total size of matched + * documents. See + * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.total_size|ListDocumentsResponse.total_size}. + * + * Enabling this flag may adversely impact performance. + * + * Defaults to false. + * @param {number} [request.skip] + * Optional. Number of results to skip beginning from the `page_token` if + * provided. https://google.aip.dev/158#skipping-results. It must be a + * non-negative integer. Negative values will be rejected. Note that this is + * not the number of pages to skip. If this value causes the cursor to move + * past the end of results, + * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.document_metadata|ListDocumentsResponse.document_metadata} + * and + * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token} + * will be empty. + * @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.documentai.v1beta3.DocumentMetadata|DocumentMetadata} 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 `listDocumentsAsync()` + * 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. + */ + listDocumentsStream( + request?: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, + 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({ + 'dataset': request.dataset ?? '', + }); + const defaultCallSettings = this._defaults['listDocuments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDocuments stream %j', request); + return this.descriptors.page.listDocuments.createStream( + this.innerApiCalls.listDocuments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDocuments`, 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.dataset + * Required. The resource name of the dataset to be listed. + * Format: + * projects/{project}/locations/{location}/processors/{processor}/dataset + * @param {number} request.pageSize + * The maximum number of documents to return. The service may return + * fewer than this value. + * If unspecified, at most 20 documents will be returned. + * The maximum value is 100; values above 100 will be coerced to 100. + * @param {string} request.pageToken + * A page token, received from a previous `ListDocuments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListDocuments` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Query to filter the documents based on + * https://google.aip.dev/160. + * ## Currently support query strings are: + * + * `SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED` + * - `LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED` + * - `DisplayName=\"file_name.pdf\"` + * - `EntityType=abc/def` + * - `TagName=\"auto-labeling-running\"|\"sampled\"` + * + * Note: + * - Only `AND`, `=` and `!=` are supported. + * e.g. `DisplayName=file_name AND EntityType!=abc` IS supported. + * - Wildcard `*` is supported only in `DisplayName` filter + * - No duplicate filter keys are allowed, + * e.g. `EntityType=a AND EntityType=b` is NOT supported. + * - String match is case sensitive (for filter `DisplayName` & `EntityType`). + * @param {boolean} [request.returnTotalSize] + * Optional. Controls if the request requires a total size of matched + * documents. See + * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.total_size|ListDocumentsResponse.total_size}. + * + * Enabling this flag may adversely impact performance. + * + * Defaults to false. + * @param {number} [request.skip] + * Optional. Number of results to skip beginning from the `page_token` if + * provided. https://google.aip.dev/158#skipping-results. It must be a + * non-negative integer. Negative values will be rejected. Note that this is + * not the number of pages to skip. If this value causes the cursor to move + * past the end of results, + * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.document_metadata|ListDocumentsResponse.document_metadata} + * and + * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token} + * will be empty. + * @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.documentai.v1beta3.DocumentMetadata|DocumentMetadata}. 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/v1beta3/document_service.list_documents.js + * region_tag:documentai_v1beta3_generated_DocumentService_ListDocuments_async + */ + listDocumentsAsync( + request?: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, + 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({ + 'dataset': request.dataset ?? '', + }); + const defaultCallSettings = this._defaults['listDocuments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDocuments iterate %j', request); + return this.descriptors.page.listDocuments.asyncIterate( + this.innerApiCalls['listDocuments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list 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 google.cloud.location.Location | Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * 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 dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + datasetPath(project:string,location:string,processor:string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the processor from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).processor; + } + + /** + * Return a fully-qualified datasetSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + datasetSchemaPath(project:string,location:string,processor:string) { + return this.pathTemplates.datasetSchemaPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from DatasetSchema resource. + * + * @param {string} datasetSchemaName + * A fully-qualified path representing DatasetSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetSchemaName(datasetSchemaName: string) { + return this.pathTemplates.datasetSchemaPathTemplate.match(datasetSchemaName).project; + } + + /** + * Parse the location from DatasetSchema resource. + * + * @param {string} datasetSchemaName + * A fully-qualified path representing DatasetSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetSchemaName(datasetSchemaName: string) { + return this.pathTemplates.datasetSchemaPathTemplate.match(datasetSchemaName).location; + } + + /** + * Parse the processor from DatasetSchema resource. + * + * @param {string} datasetSchemaName + * A fully-qualified path representing DatasetSchema resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromDatasetSchemaName(datasetSchemaName: string) { + return this.pathTemplates.datasetSchemaPathTemplate.match(datasetSchemaName).processor; + } + + /** + * Return a fully-qualified evaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @param {string} processor_version + * @param {string} evaluation + * @returns {string} Resource name string. + */ + evaluationPath(project:string,location:string,processor:string,processorVersion:string,evaluation:string) { + return this.pathTemplates.evaluationPathTemplate.render({ + project: project, + location: location, + processor: processor, + processor_version: processorVersion, + evaluation: evaluation, + }); + } + + /** + * Parse the project from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project; + } + + /** + * Parse the location from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location; + } + + /** + * Parse the processor from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).processor; + } + + /** + * Parse the processor_version from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the processor_version. + */ + matchProcessorVersionFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).processor_version; + } + + /** + * Parse the evaluation from Evaluation resource. + * + * @param {string} evaluationName + * A fully-qualified path representing Evaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromEvaluationName(evaluationName: string) { + return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation; + } + + /** + * Return a fully-qualified processor resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @returns {string} Resource name string. + */ + processorPath(project:string,location:string,processor:string) { + return this.pathTemplates.processorPathTemplate.render({ + project: project, + location: location, + processor: processor, + }); + } + + /** + * Parse the project from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName).project; + } + + /** + * Parse the location from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName).location; + } + + /** + * Parse the processor from Processor resource. + * + * @param {string} processorName + * A fully-qualified path representing Processor resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromProcessorName(processorName: string) { + return this.pathTemplates.processorPathTemplate.match(processorName).processor; + } + + /** + * Return a fully-qualified processorType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor_type + * @returns {string} Resource name string. + */ + processorTypePath(project:string,location:string,processorType:string) { + return this.pathTemplates.processorTypePathTemplate.render({ + project: project, + location: location, + processor_type: processorType, + }); + } + + /** + * Parse the project from ProcessorType resource. + * + * @param {string} processorTypeName + * A fully-qualified path representing ProcessorType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorTypeName(processorTypeName: string) { + return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).project; + } + + /** + * Parse the location from ProcessorType resource. + * + * @param {string} processorTypeName + * A fully-qualified path representing ProcessorType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorTypeName(processorTypeName: string) { + return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).location; + } + + /** + * Parse the processor_type from ProcessorType resource. + * + * @param {string} processorTypeName + * A fully-qualified path representing ProcessorType resource. + * @returns {string} A string representing the processor_type. + */ + matchProcessorTypeFromProcessorTypeName(processorTypeName: string) { + return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).processor_type; + } + + /** + * Return a fully-qualified processorVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} processor + * @param {string} processor_version + * @returns {string} Resource name string. + */ + processorVersionPath(project:string,location:string,processor:string,processorVersion:string) { + return this.pathTemplates.processorVersionPathTemplate.render({ + project: project, + location: location, + processor: processor, + processor_version: processorVersion, + }); + } + + /** + * Parse the project from ProcessorVersion resource. + * + * @param {string} processorVersionName + * A fully-qualified path representing ProcessorVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProcessorVersionName(processorVersionName: string) { + return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).project; + } + + /** + * Parse the location from ProcessorVersion resource. + * + * @param {string} processorVersionName + * A fully-qualified path representing ProcessorVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProcessorVersionName(processorVersionName: string) { + return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).location; + } + + /** + * Parse the processor from ProcessorVersion resource. + * + * @param {string} processorVersionName + * A fully-qualified path representing ProcessorVersion resource. + * @returns {string} A string representing the processor. + */ + matchProcessorFromProcessorVersionName(processorVersionName: string) { + return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).processor; + } + + /** + * Parse the processor_version from ProcessorVersion resource. + * + * @param {string} processorVersionName + * A fully-qualified path representing ProcessorVersion resource. + * @returns {string} A string representing the processor_version. + */ + matchProcessorVersionFromProcessorVersionName(processorVersionName: string) { + return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).processor_version; + } + + /** + * 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(); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client_config.json b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client_config.json new file mode 100644 index 00000000000..1b9c7897100 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.documentai.v1beta3.DocumentService": { + "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": { + "UpdateDataset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportDocuments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDocument": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDocuments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchDeleteDocuments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDatasetSchema": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDatasetSchema": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_proto_list.json b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_proto_list.json new file mode 100644 index 00000000000..db4c908da7b --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_proto_list.json @@ -0,0 +1,14 @@ +[ + "../../protos/google/cloud/documentai/v1beta3/barcode.proto", + "../../protos/google/cloud/documentai/v1beta3/dataset.proto", + "../../protos/google/cloud/documentai/v1beta3/document.proto", + "../../protos/google/cloud/documentai/v1beta3/document_io.proto", + "../../protos/google/cloud/documentai/v1beta3/document_processor_service.proto", + "../../protos/google/cloud/documentai/v1beta3/document_schema.proto", + "../../protos/google/cloud/documentai/v1beta3/document_service.proto", + "../../protos/google/cloud/documentai/v1beta3/evaluation.proto", + "../../protos/google/cloud/documentai/v1beta3/geometry.proto", + "../../protos/google/cloud/documentai/v1beta3/operation_metadata.proto", + "../../protos/google/cloud/documentai/v1beta3/processor.proto", + "../../protos/google/cloud/documentai/v1beta3/processor_type.proto" +] diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/gapic_metadata.json b/owl-bot-staging/google-cloud-documentai/src/v1beta3/gapic_metadata.json new file mode 100644 index 00000000000..263a76d30e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1beta3/gapic_metadata.json @@ -0,0 +1,357 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.documentai.v1beta3", + "libraryPackage": "@google-cloud/documentai", + "services": { + "DocumentProcessorService": { + "clients": { + "grpc": { + "libraryClient": "DocumentProcessorServiceClient", + "rpcs": { + "ProcessDocument": { + "methods": [ + "processDocument" + ] + }, + "FetchProcessorTypes": { + "methods": [ + "fetchProcessorTypes" + ] + }, + "GetProcessorType": { + "methods": [ + "getProcessorType" + ] + }, + "GetProcessor": { + "methods": [ + "getProcessor" + ] + }, + "GetProcessorVersion": { + "methods": [ + "getProcessorVersion" + ] + }, + "CreateProcessor": { + "methods": [ + "createProcessor" + ] + }, + "GetEvaluation": { + "methods": [ + "getEvaluation" + ] + }, + "BatchProcessDocuments": { + "methods": [ + "batchProcessDocuments" + ] + }, + "TrainProcessorVersion": { + "methods": [ + "trainProcessorVersion" + ] + }, + "DeleteProcessorVersion": { + "methods": [ + "deleteProcessorVersion" + ] + }, + "DeployProcessorVersion": { + "methods": [ + "deployProcessorVersion" + ] + }, + "UndeployProcessorVersion": { + "methods": [ + "undeployProcessorVersion" + ] + }, + "DeleteProcessor": { + "methods": [ + "deleteProcessor" + ] + }, + "EnableProcessor": { + "methods": [ + "enableProcessor" + ] + }, + "DisableProcessor": { + "methods": [ + "disableProcessor" + ] + }, + "SetDefaultProcessorVersion": { + "methods": [ + "setDefaultProcessorVersion" + ] + }, + "ReviewDocument": { + "methods": [ + "reviewDocument" + ] + }, + "EvaluateProcessorVersion": { + "methods": [ + "evaluateProcessorVersion" + ] + }, + "ImportProcessorVersion": { + "methods": [ + "importProcessorVersion" + ] + }, + "ListProcessorTypes": { + "methods": [ + "listProcessorTypes", + "listProcessorTypesStream", + "listProcessorTypesAsync" + ] + }, + "ListProcessors": { + "methods": [ + "listProcessors", + "listProcessorsStream", + "listProcessorsAsync" + ] + }, + "ListProcessorVersions": { + "methods": [ + "listProcessorVersions", + "listProcessorVersionsStream", + "listProcessorVersionsAsync" + ] + }, + "ListEvaluations": { + "methods": [ + "listEvaluations", + "listEvaluationsStream", + "listEvaluationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DocumentProcessorServiceClient", + "rpcs": { + "ProcessDocument": { + "methods": [ + "processDocument" + ] + }, + "FetchProcessorTypes": { + "methods": [ + "fetchProcessorTypes" + ] + }, + "GetProcessorType": { + "methods": [ + "getProcessorType" + ] + }, + "GetProcessor": { + "methods": [ + "getProcessor" + ] + }, + "GetProcessorVersion": { + "methods": [ + "getProcessorVersion" + ] + }, + "CreateProcessor": { + "methods": [ + "createProcessor" + ] + }, + "GetEvaluation": { + "methods": [ + "getEvaluation" + ] + }, + "BatchProcessDocuments": { + "methods": [ + "batchProcessDocuments" + ] + }, + "TrainProcessorVersion": { + "methods": [ + "trainProcessorVersion" + ] + }, + "DeleteProcessorVersion": { + "methods": [ + "deleteProcessorVersion" + ] + }, + "DeployProcessorVersion": { + "methods": [ + "deployProcessorVersion" + ] + }, + "UndeployProcessorVersion": { + "methods": [ + "undeployProcessorVersion" + ] + }, + "DeleteProcessor": { + "methods": [ + "deleteProcessor" + ] + }, + "EnableProcessor": { + "methods": [ + "enableProcessor" + ] + }, + "DisableProcessor": { + "methods": [ + "disableProcessor" + ] + }, + "SetDefaultProcessorVersion": { + "methods": [ + "setDefaultProcessorVersion" + ] + }, + "ReviewDocument": { + "methods": [ + "reviewDocument" + ] + }, + "EvaluateProcessorVersion": { + "methods": [ + "evaluateProcessorVersion" + ] + }, + "ImportProcessorVersion": { + "methods": [ + "importProcessorVersion" + ] + }, + "ListProcessorTypes": { + "methods": [ + "listProcessorTypes", + "listProcessorTypesStream", + "listProcessorTypesAsync" + ] + }, + "ListProcessors": { + "methods": [ + "listProcessors", + "listProcessorsStream", + "listProcessorsAsync" + ] + }, + "ListProcessorVersions": { + "methods": [ + "listProcessorVersions", + "listProcessorVersionsStream", + "listProcessorVersionsAsync" + ] + }, + "ListEvaluations": { + "methods": [ + "listEvaluations", + "listEvaluationsStream", + "listEvaluationsAsync" + ] + } + } + } + } + }, + "DocumentService": { + "clients": { + "grpc": { + "libraryClient": "DocumentServiceClient", + "rpcs": { + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "GetDatasetSchema": { + "methods": [ + "getDatasetSchema" + ] + }, + "UpdateDatasetSchema": { + "methods": [ + "updateDatasetSchema" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "ImportDocuments": { + "methods": [ + "importDocuments" + ] + }, + "BatchDeleteDocuments": { + "methods": [ + "batchDeleteDocuments" + ] + }, + "ListDocuments": { + "methods": [ + "listDocuments", + "listDocumentsStream", + "listDocumentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DocumentServiceClient", + "rpcs": { + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "GetDatasetSchema": { + "methods": [ + "getDatasetSchema" + ] + }, + "UpdateDatasetSchema": { + "methods": [ + "updateDatasetSchema" + ] + }, + "UpdateDataset": { + "methods": [ + "updateDataset" + ] + }, + "ImportDocuments": { + "methods": [ + "importDocuments" + ] + }, + "BatchDeleteDocuments": { + "methods": [ + "batchDeleteDocuments" + ] + }, + "ListDocuments": { + "methods": [ + "listDocuments", + "listDocumentsStream", + "listDocumentsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/index.ts b/owl-bot-staging/google-cloud-documentai/src/v1beta3/index.ts new file mode 100644 index 00000000000..ad757a8edc3 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/src/v1beta3/index.ts @@ -0,0 +1,20 @@ +// 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 {DocumentProcessorServiceClient} from './document_processor_service_client'; +export {DocumentServiceClient} from './document_service_client'; diff --git a/owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..a3b5aa4a874 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// 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 documentai = require('@google-cloud/documentai'); + +function main() { + const documentProcessorServiceClient = new documentai.DocumentProcessorServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..5e87e3e26b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.ts @@ -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. ** + +import {DocumentProcessorServiceClient} from '@google-cloud/documentai'; + +// check that the client class type name can be used +function doStuffWithDocumentProcessorServiceClient(client: DocumentProcessorServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const documentProcessorServiceClient = new DocumentProcessorServiceClient(); + doStuffWithDocumentProcessorServiceClient(documentProcessorServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-documentai/system-test/install.ts b/owl-bot-staging/google-cloud-documentai/system-test/install.ts new file mode 100644 index 00000000000..394f3362d20 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/test/gapic_document_processor_service_v1.ts b/owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1.ts new file mode 100644 index 00000000000..e6e8ff1f9ba --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1.ts @@ -0,0 +1,4453 @@ +// 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 documentprocessorserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, LocationProtos} 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 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 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.DocumentProcessorServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'documentai.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient(); + 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 = documentprocessorserviceModule.v1.DocumentProcessorServiceClient.servicePath; + assert.strictEqual(servicePath, 'documentai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = documentprocessorserviceModule.v1.DocumentProcessorServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'documentai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'documentai.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'documentai.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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'documentai.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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'documentai.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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = documentprocessorserviceModule.v1.DocumentProcessorServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentProcessorServiceStub, undefined); + await client.initialize(); + assert(client.documentProcessorServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.documentProcessorServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentProcessorServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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('processDocument', () => { + it('invokes processDocument without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.ProcessResponse() + ); + client.innerApiCalls.processDocument = stubSimpleCall(expectedResponse); + const [response] = await client.processDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.processDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.processDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes processDocument without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.ProcessResponse() + ); + client.innerApiCalls.processDocument = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.processDocument( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.processDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.processDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes processDocument with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.processDocument = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.processDocument(request), expectedError); + const actualRequest = (client.innerApiCalls.processDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.processDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes processDocument with closed client', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ProcessRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.processDocument(request), expectedError); + }); + }); + + describe('fetchProcessorTypes', () => { + it('invokes fetchProcessorTypes without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.FetchProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.FetchProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.FetchProcessorTypesResponse() + ); + client.innerApiCalls.fetchProcessorTypes = stubSimpleCall(expectedResponse); + const [response] = await client.fetchProcessorTypes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchProcessorTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchProcessorTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchProcessorTypes without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.FetchProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.FetchProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.FetchProcessorTypesResponse() + ); + client.innerApiCalls.fetchProcessorTypes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchProcessorTypes( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchProcessorTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchProcessorTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchProcessorTypes with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.FetchProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.FetchProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchProcessorTypes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchProcessorTypes(request), expectedError); + const actualRequest = (client.innerApiCalls.fetchProcessorTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchProcessorTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchProcessorTypes with closed client', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.FetchProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.FetchProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.fetchProcessorTypes(request), expectedError); + }); + }); + + describe('getProcessorType', () => { + it('invokes getProcessorType without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetProcessorTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.ProcessorType() + ); + client.innerApiCalls.getProcessorType = stubSimpleCall(expectedResponse); + const [response] = await client.getProcessorType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProcessorType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessorType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessorType without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetProcessorTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.ProcessorType() + ); + client.innerApiCalls.getProcessorType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProcessorType( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessorType|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProcessorType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessorType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessorType with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetProcessorTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProcessorType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getProcessorType(request), expectedError); + const actualRequest = (client.innerApiCalls.getProcessorType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessorType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessorType with closed client', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetProcessorTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorTypeRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getProcessorType(request), expectedError); + }); + }); + + describe('getProcessor', () => { + it('invokes getProcessor without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.Processor() + ); + client.innerApiCalls.getProcessor = stubSimpleCall(expectedResponse); + const [response] = await client.getProcessor(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessor without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.Processor() + ); + client.innerApiCalls.getProcessor = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProcessor( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessor|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessor with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProcessor = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getProcessor(request), expectedError); + const actualRequest = (client.innerApiCalls.getProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessor with closed client', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getProcessor(request), expectedError); + }); + }); + + describe('getProcessorVersion', () => { + it('invokes getProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.ProcessorVersion() + ); + client.innerApiCalls.getProcessorVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getProcessorVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.ProcessorVersion() + ); + client.innerApiCalls.getProcessorVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProcessorVersion( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessorVersion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessorVersion with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProcessorVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.getProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessorVersion with closed client', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getProcessorVersion(request), expectedError); + }); + }); + + describe('createProcessor', () => { + it('invokes createProcessor without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.CreateProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.CreateProcessorRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.Processor() + ); + client.innerApiCalls.createProcessor = stubSimpleCall(expectedResponse); + const [response] = await client.createProcessor(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createProcessor without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.CreateProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.CreateProcessorRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.Processor() + ); + client.innerApiCalls.createProcessor = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createProcessor( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessor|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createProcessor with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.CreateProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.CreateProcessorRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createProcessor = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createProcessor(request), expectedError); + const actualRequest = (client.innerApiCalls.createProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createProcessor with closed client', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.CreateProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.CreateProcessorRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createProcessor(request), expectedError); + }); + }); + + describe('getEvaluation', () => { + it('invokes getEvaluation without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.Evaluation() + ); + client.innerApiCalls.getEvaluation = stubSimpleCall(expectedResponse); + const [response] = await client.getEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluation without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1.Evaluation() + ); + client.innerApiCalls.getEvaluation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEvaluation( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1.IEvaluation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluation with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEvaluation(request), expectedError); + const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluation with closed client', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.GetEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.GetEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getEvaluation(request), expectedError); + }); + }); + + describe('batchProcessDocuments', () => { + it('invokes batchProcessDocuments without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.BatchProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.BatchProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchProcessDocuments = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchProcessDocuments(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchProcessDocuments without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.BatchProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.BatchProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchProcessDocuments = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchProcessDocuments( + 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.batchProcessDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchProcessDocuments with call error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.BatchProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.BatchProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchProcessDocuments = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchProcessDocuments(request), expectedError); + const actualRequest = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchProcessDocuments with LRO error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.BatchProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.BatchProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchProcessDocuments = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchProcessDocuments(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchProcessDocumentsProgress without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkBatchProcessDocumentsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchProcessDocumentsProgress with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkBatchProcessDocumentsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('trainProcessorVersion', () => { + it('invokes trainProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.TrainProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.TrainProcessorVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.trainProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.trainProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes trainProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.TrainProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.TrainProcessorVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.trainProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.trainProcessorVersion( + 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.trainProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes trainProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.TrainProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.TrainProcessorVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.trainProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.trainProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes trainProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.TrainProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.TrainProcessorVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.trainProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.trainProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkTrainProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkTrainProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkTrainProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkTrainProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteProcessorVersion', () => { + it('invokes deleteProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DeleteProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DeleteProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteProcessorVersion( + 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.deleteProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DeleteProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DeleteProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkDeleteProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkDeleteProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deployProcessorVersion', () => { + it('invokes deployProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployProcessorVersion( + 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.deployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deployProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deployProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeployProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkDeployProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkDeployProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeployProcessorVersion', () => { + it('invokes undeployProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.UndeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.UndeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeployProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.UndeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.UndeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeployProcessorVersion( + 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.undeployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.UndeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.UndeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeployProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.UndeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.UndeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeployProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeployProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkUndeployProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeployProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkUndeployProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteProcessor', () => { + it('invokes deleteProcessor without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DeleteProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteProcessor = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteProcessor(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessor without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DeleteProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteProcessor = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteProcessor( + 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.deleteProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessor with call error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DeleteProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProcessor = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteProcessor(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessor with LRO error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DeleteProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProcessor = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteProcessor(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteProcessorProgress without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkDeleteProcessorProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteProcessorProgress with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkDeleteProcessorProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('enableProcessor', () => { + it('invokes enableProcessor without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.EnableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.EnableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.enableProcessor = stubLongRunningCall(expectedResponse); + const [operation] = await client.enableProcessor(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableProcessor without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.EnableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.EnableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.enableProcessor = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enableProcessor( + 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.enableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableProcessor with call error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.EnableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.EnableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.enableProcessor = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.enableProcessor(request), expectedError); + const actualRequest = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableProcessor with LRO error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.EnableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.EnableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.enableProcessor = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.enableProcessor(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkEnableProcessorProgress without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkEnableProcessorProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkEnableProcessorProgress with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkEnableProcessorProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('disableProcessor', () => { + it('invokes disableProcessor without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DisableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DisableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.disableProcessor = stubLongRunningCall(expectedResponse); + const [operation] = await client.disableProcessor(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableProcessor without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DisableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DisableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.disableProcessor = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.disableProcessor( + 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.disableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableProcessor with call error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DisableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DisableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.disableProcessor = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.disableProcessor(request), expectedError); + const actualRequest = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableProcessor with LRO error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.DisableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.DisableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.disableProcessor = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.disableProcessor(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDisableProcessorProgress without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkDisableProcessorProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDisableProcessorProgress with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkDisableProcessorProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('setDefaultProcessorVersion', () => { + it('invokes setDefaultProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest', ['processor']); + request.processor = defaultValue1; + const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.setDefaultProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setDefaultProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest', ['processor']); + request.processor = defaultValue1; + const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setDefaultProcessorVersion( + 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.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setDefaultProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest', ['processor']); + request.processor = defaultValue1; + const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.setDefaultProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setDefaultProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest', ['processor']); + request.processor = defaultValue1; + const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.setDefaultProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSetDefaultProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkSetDefaultProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSetDefaultProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkSetDefaultProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('reviewDocument', () => { + it('invokes reviewDocument without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ReviewDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ReviewDocumentRequest', ['humanReviewConfig']); + request.humanReviewConfig = defaultValue1; + const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.reviewDocument = stubLongRunningCall(expectedResponse); + const [operation] = await client.reviewDocument(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes reviewDocument without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ReviewDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ReviewDocumentRequest', ['humanReviewConfig']); + request.humanReviewConfig = defaultValue1; + const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.reviewDocument = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.reviewDocument( + 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.reviewDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes reviewDocument with call error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ReviewDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ReviewDocumentRequest', ['humanReviewConfig']); + request.humanReviewConfig = defaultValue1; + const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.reviewDocument = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.reviewDocument(request), expectedError); + const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes reviewDocument with LRO error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ReviewDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ReviewDocumentRequest', ['humanReviewConfig']); + request.humanReviewConfig = defaultValue1; + const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.reviewDocument = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.reviewDocument(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkReviewDocumentProgress without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkReviewDocumentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkReviewDocumentProgress with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkReviewDocumentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('evaluateProcessorVersion', () => { + it('invokes evaluateProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.EvaluateProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.EvaluateProcessorVersionRequest', ['processorVersion']); + request.processorVersion = defaultValue1; + const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.evaluateProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes evaluateProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.EvaluateProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.EvaluateProcessorVersionRequest', ['processorVersion']); + request.processorVersion = defaultValue1; + const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.evaluateProcessorVersion( + 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.evaluateProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes evaluateProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.EvaluateProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.EvaluateProcessorVersionRequest', ['processorVersion']); + request.processorVersion = defaultValue1; + const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.evaluateProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes evaluateProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.EvaluateProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.EvaluateProcessorVersionRequest', ['processorVersion']); + request.processorVersion = defaultValue1; + const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.evaluateProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkEvaluateProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkEvaluateProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkEvaluateProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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.checkEvaluateProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listProcessorTypes', () => { + it('invokes listProcessorTypes without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), + ]; + client.innerApiCalls.listProcessorTypes = stubSimpleCall(expectedResponse); + const [response] = await client.listProcessorTypes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listProcessorTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessorTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorTypes without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), + ]; + client.innerApiCalls.listProcessorTypes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProcessorTypes( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessorType[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listProcessorTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessorTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorTypes with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listProcessorTypes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listProcessorTypes(request), expectedError); + const actualRequest = (client.innerApiCalls.listProcessorTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessorTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorTypesStream without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), + ]; + client.descriptors.page.listProcessorTypes.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listProcessorTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1.ProcessorType[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1.ProcessorType) => { + 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.listProcessorTypes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProcessorTypes, request)); + assert( + (client.descriptors.page.listProcessorTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listProcessorTypesStream with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessorTypes.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listProcessorTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1.ProcessorType[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1.ProcessorType) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listProcessorTypes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProcessorTypes, request)); + assert( + (client.descriptors.page.listProcessorTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProcessorTypes without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), + ]; + client.descriptors.page.listProcessorTypes.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.documentai.v1.IProcessorType[] = []; + const iterable = client.listProcessorTypesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProcessorTypes with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessorTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listProcessorTypesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.documentai.v1.IProcessorType[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listProcessors', () => { + it('invokes listProcessors without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), + ]; + client.innerApiCalls.listProcessors = stubSimpleCall(expectedResponse); + const [response] = await client.listProcessors(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listProcessors as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessors as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessors without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), + ]; + client.innerApiCalls.listProcessors = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProcessors( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessor[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listProcessors as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessors as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessors with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listProcessors = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listProcessors(request), expectedError); + const actualRequest = (client.innerApiCalls.listProcessors as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessors as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorsStream without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), + ]; + client.descriptors.page.listProcessors.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listProcessorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1.Processor[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1.Processor) => { + 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.listProcessors.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProcessors, request)); + assert( + (client.descriptors.page.listProcessors.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listProcessorsStream with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessors.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listProcessorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1.Processor[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1.Processor) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listProcessors.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProcessors, request)); + assert( + (client.descriptors.page.listProcessors.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProcessors without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), + ]; + client.descriptors.page.listProcessors.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.documentai.v1.IProcessor[] = []; + const iterable = client.listProcessorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listProcessors.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listProcessors.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProcessors with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listProcessorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.documentai.v1.IProcessor[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listProcessors.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listProcessors.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listProcessorVersions', () => { + it('invokes listProcessorVersions without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), + ]; + client.innerApiCalls.listProcessorVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listProcessorVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listProcessorVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessorVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorVersions without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), + ]; + client.innerApiCalls.listProcessorVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProcessorVersions( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessorVersion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listProcessorVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessorVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorVersions with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listProcessorVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listProcessorVersions(request), expectedError); + const actualRequest = (client.innerApiCalls.listProcessorVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessorVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorVersionsStream without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), + ]; + client.descriptors.page.listProcessorVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listProcessorVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1.ProcessorVersion[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1.ProcessorVersion) => { + 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.listProcessorVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProcessorVersions, request)); + assert( + (client.descriptors.page.listProcessorVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listProcessorVersionsStream with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessorVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listProcessorVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1.ProcessorVersion[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1.ProcessorVersion) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listProcessorVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProcessorVersions, request)); + assert( + (client.descriptors.page.listProcessorVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProcessorVersions without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), + ]; + client.descriptors.page.listProcessorVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.documentai.v1.IProcessorVersion[] = []; + const iterable = client.listProcessorVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProcessorVersions with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessorVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listProcessorVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.documentai.v1.IProcessorVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEvaluations', () => { + it('invokes listEvaluations without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), + ]; + client.innerApiCalls.listEvaluations = stubSimpleCall(expectedResponse); + const [response] = await client.listEvaluations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluations without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), + ]; + client.innerApiCalls.listEvaluations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEvaluations( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1.IEvaluation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluations with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEvaluations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEvaluations(request), expectedError); + const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationsStream without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), + ]; + client.descriptors.page.listEvaluations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1.Evaluation[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1.Evaluation) => { + 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.listEvaluations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluations, request)); + assert( + (client.descriptors.page.listEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEvaluationsStream with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1.Evaluation[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1.Evaluation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEvaluations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluations, request)); + assert( + (client.descriptors.page.listEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluations without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), + ]; + client.descriptors.page.listEvaluations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.documentai.v1.IEvaluation[] = []; + const iterable = client.listEvaluationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluations with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEvaluationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.documentai.v1.IEvaluation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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('evaluation', async () => { + const fakePath = "/rendered/path/evaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + processor_version: "processorVersionValue", + evaluation: "evaluationValue", + }; + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationPath', () => { + const result = client.evaluationPath("projectValue", "locationValue", "processorValue", "processorVersionValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationName', () => { + const result = client.matchProjectFromEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationName', () => { + const result = client.matchLocationFromEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromEvaluationName', () => { + const result = client.matchProcessorFromEvaluationName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorVersionFromEvaluationName', () => { + const result = client.matchProcessorVersionFromEvaluationName(fakePath); + assert.strictEqual(result, "processorVersionValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationName', () => { + const result = client.matchEvaluationFromEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('humanReviewConfig', async () => { + const fakePath = "/rendered/path/humanReviewConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + }; + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.humanReviewConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.humanReviewConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('humanReviewConfigPath', () => { + const result = client.humanReviewConfigPath("projectValue", "locationValue", "processorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.humanReviewConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHumanReviewConfigName', () => { + const result = client.matchProjectFromHumanReviewConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.humanReviewConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHumanReviewConfigName', () => { + const result = client.matchLocationFromHumanReviewConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.humanReviewConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromHumanReviewConfigName', () => { + const result = client.matchProcessorFromHumanReviewConfigName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.humanReviewConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + 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('processor', async () => { + const fakePath = "/rendered/path/processor"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + }; + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.processorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('processorPath', () => { + const result = client.processorPath("projectValue", "locationValue", "processorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.processorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProcessorName', () => { + const result = client.matchProjectFromProcessorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProcessorName', () => { + const result = client.matchLocationFromProcessorName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromProcessorName', () => { + const result = client.matchProcessorFromProcessorName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('processorType', async () => { + const fakePath = "/rendered/path/processorType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor_type: "processorTypeValue", + }; + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.processorTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('processorTypePath', () => { + const result = client.processorTypePath("projectValue", "locationValue", "processorTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.processorTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProcessorTypeName', () => { + const result = client.matchProjectFromProcessorTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProcessorTypeName', () => { + const result = client.matchLocationFromProcessorTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorTypeFromProcessorTypeName', () => { + const result = client.matchProcessorTypeFromProcessorTypeName(fakePath); + assert.strictEqual(result, "processorTypeValue"); + assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('processorVersion', async () => { + const fakePath = "/rendered/path/processorVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + processor_version: "processorVersionValue", + }; + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.processorVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('processorVersionPath', () => { + const result = client.processorVersionPath("projectValue", "locationValue", "processorValue", "processorVersionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.processorVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProcessorVersionName', () => { + const result = client.matchProjectFromProcessorVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProcessorVersionName', () => { + const result = client.matchLocationFromProcessorVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromProcessorVersionName', () => { + const result = client.matchProcessorFromProcessorVersionName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorVersionFromProcessorVersionName', () => { + const result = client.matchProcessorVersionFromProcessorVersionName(fakePath); + assert.strictEqual(result, "processorVersionValue"); + assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1beta3.ts b/owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1beta3.ts new file mode 100644 index 00000000000..693ad00eb7b --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1beta3.ts @@ -0,0 +1,4711 @@ +// 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 documentprocessorserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, LocationProtos} 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 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 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('v1beta3.DocumentProcessorServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'documentai.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient(); + 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 = documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient.servicePath; + assert.strictEqual(servicePath, 'documentai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'documentai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'documentai.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'documentai.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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'documentai.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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'documentai.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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentProcessorServiceStub, undefined); + await client.initialize(); + assert(client.documentProcessorServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.documentProcessorServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentProcessorServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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('processDocument', () => { + it('invokes processDocument without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ProcessResponse() + ); + client.innerApiCalls.processDocument = stubSimpleCall(expectedResponse); + const [response] = await client.processDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.processDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.processDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes processDocument without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ProcessResponse() + ); + client.innerApiCalls.processDocument = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.processDocument( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.processDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.processDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes processDocument with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.processDocument = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.processDocument(request), expectedError); + const actualRequest = (client.innerApiCalls.processDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.processDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes processDocument with closed client', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ProcessRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.processDocument(request), expectedError); + }); + }); + + describe('fetchProcessorTypes', () => { + it('invokes fetchProcessorTypes without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse() + ); + client.innerApiCalls.fetchProcessorTypes = stubSimpleCall(expectedResponse); + const [response] = await client.fetchProcessorTypes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchProcessorTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchProcessorTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchProcessorTypes without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse() + ); + client.innerApiCalls.fetchProcessorTypes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchProcessorTypes( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchProcessorTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchProcessorTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchProcessorTypes with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchProcessorTypes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchProcessorTypes(request), expectedError); + const actualRequest = (client.innerApiCalls.fetchProcessorTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchProcessorTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchProcessorTypes with closed client', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.fetchProcessorTypes(request), expectedError); + }); + }); + + describe('getProcessorType', () => { + it('invokes getProcessorType without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetProcessorTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ProcessorType() + ); + client.innerApiCalls.getProcessorType = stubSimpleCall(expectedResponse); + const [response] = await client.getProcessorType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProcessorType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessorType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessorType without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetProcessorTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ProcessorType() + ); + client.innerApiCalls.getProcessorType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProcessorType( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessorType|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProcessorType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessorType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessorType with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetProcessorTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProcessorType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getProcessorType(request), expectedError); + const actualRequest = (client.innerApiCalls.getProcessorType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessorType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessorType with closed client', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetProcessorTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorTypeRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getProcessorType(request), expectedError); + }); + }); + + describe('getProcessor', () => { + it('invokes getProcessor without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.Processor() + ); + client.innerApiCalls.getProcessor = stubSimpleCall(expectedResponse); + const [response] = await client.getProcessor(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessor without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.Processor() + ); + client.innerApiCalls.getProcessor = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProcessor( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessor|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessor with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProcessor = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getProcessor(request), expectedError); + const actualRequest = (client.innerApiCalls.getProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessor with closed client', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getProcessor(request), expectedError); + }); + }); + + describe('getProcessorVersion', () => { + it('invokes getProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ProcessorVersion() + ); + client.innerApiCalls.getProcessorVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getProcessorVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ProcessorVersion() + ); + client.innerApiCalls.getProcessorVersion = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getProcessorVersion( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessorVersion|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessorVersion with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getProcessorVersion = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.getProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getProcessorVersion with closed client', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getProcessorVersion(request), expectedError); + }); + }); + + describe('createProcessor', () => { + it('invokes createProcessor without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.CreateProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.CreateProcessorRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.Processor() + ); + client.innerApiCalls.createProcessor = stubSimpleCall(expectedResponse); + const [response] = await client.createProcessor(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createProcessor without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.CreateProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.CreateProcessorRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.Processor() + ); + client.innerApiCalls.createProcessor = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createProcessor( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessor|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createProcessor with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.CreateProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.CreateProcessorRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createProcessor = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createProcessor(request), expectedError); + const actualRequest = (client.innerApiCalls.createProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createProcessor with closed client', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.CreateProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.CreateProcessorRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createProcessor(request), expectedError); + }); + }); + + describe('getEvaluation', () => { + it('invokes getEvaluation without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.Evaluation() + ); + client.innerApiCalls.getEvaluation = stubSimpleCall(expectedResponse); + const [response] = await client.getEvaluation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluation without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.Evaluation() + ); + client.innerApiCalls.getEvaluation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEvaluation( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IEvaluation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluation with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEvaluation(request), expectedError); + const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getEvaluation with closed client', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getEvaluation(request), expectedError); + }); + }); + + describe('batchProcessDocuments', () => { + it('invokes batchProcessDocuments without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.BatchProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchProcessDocuments = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchProcessDocuments(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchProcessDocuments without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.BatchProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchProcessDocuments = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchProcessDocuments( + 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.batchProcessDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchProcessDocuments with call error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.BatchProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchProcessDocuments = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchProcessDocuments(request), expectedError); + const actualRequest = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchProcessDocuments with LRO error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.BatchProcessRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchProcessRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchProcessDocuments = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchProcessDocuments(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchProcessDocumentsProgress without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkBatchProcessDocumentsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchProcessDocumentsProgress with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkBatchProcessDocumentsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('trainProcessorVersion', () => { + it('invokes trainProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.trainProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.trainProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes trainProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.trainProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.trainProcessorVersion( + 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.trainProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes trainProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.trainProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.trainProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes trainProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.trainProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.trainProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkTrainProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkTrainProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkTrainProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkTrainProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteProcessorVersion', () => { + it('invokes deleteProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteProcessorVersion( + 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.deleteProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkDeleteProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkDeleteProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deployProcessorVersion', () => { + it('invokes deployProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.deployProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deployProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployProcessorVersion( + 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.deployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deployProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deployProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeployProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkDeployProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkDeployProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('undeployProcessorVersion', () => { + it('invokes undeployProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.undeployProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeployProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeployProcessorVersion( + 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.undeployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeployProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeployProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeployProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeployProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkUndeployProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeployProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkUndeployProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteProcessor', () => { + it('invokes deleteProcessor without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DeleteProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteProcessor = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteProcessor(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessor without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DeleteProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteProcessor = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteProcessor( + 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.deleteProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessor with call error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DeleteProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProcessor = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteProcessor(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteProcessor with LRO error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DeleteProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteProcessor = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteProcessor(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteProcessorProgress without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkDeleteProcessorProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteProcessorProgress with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkDeleteProcessorProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('enableProcessor', () => { + it('invokes enableProcessor without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.EnableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.EnableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.enableProcessor = stubLongRunningCall(expectedResponse); + const [operation] = await client.enableProcessor(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableProcessor without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.EnableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.EnableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.enableProcessor = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enableProcessor( + 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.enableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableProcessor with call error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.EnableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.EnableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.enableProcessor = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.enableProcessor(request), expectedError); + const actualRequest = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes enableProcessor with LRO error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.EnableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.EnableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.enableProcessor = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.enableProcessor(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkEnableProcessorProgress without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkEnableProcessorProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkEnableProcessorProgress with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkEnableProcessorProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('disableProcessor', () => { + it('invokes disableProcessor without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DisableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DisableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.disableProcessor = stubLongRunningCall(expectedResponse); + const [operation] = await client.disableProcessor(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableProcessor without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DisableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DisableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.disableProcessor = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.disableProcessor( + 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.disableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableProcessor with call error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DisableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DisableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.disableProcessor = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.disableProcessor(request), expectedError); + const actualRequest = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes disableProcessor with LRO error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DisableProcessorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.DisableProcessorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.disableProcessor = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.disableProcessor(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDisableProcessorProgress without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkDisableProcessorProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDisableProcessorProgress with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkDisableProcessorProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('setDefaultProcessorVersion', () => { + it('invokes setDefaultProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest', ['processor']); + request.processor = defaultValue1; + const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.setDefaultProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setDefaultProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest', ['processor']); + request.processor = defaultValue1; + const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setDefaultProcessorVersion( + 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.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setDefaultProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest', ['processor']); + request.processor = defaultValue1; + const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.setDefaultProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes setDefaultProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest', ['processor']); + request.processor = defaultValue1; + const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.setDefaultProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSetDefaultProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkSetDefaultProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSetDefaultProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkSetDefaultProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('reviewDocument', () => { + it('invokes reviewDocument without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ReviewDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ReviewDocumentRequest', ['humanReviewConfig']); + request.humanReviewConfig = defaultValue1; + const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.reviewDocument = stubLongRunningCall(expectedResponse); + const [operation] = await client.reviewDocument(request); + const [response] = await operation.promise(); + assert(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes reviewDocument without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ReviewDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ReviewDocumentRequest', ['humanReviewConfig']); + request.humanReviewConfig = defaultValue1; + const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.reviewDocument = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.reviewDocument( + 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(stub.calledOnce); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes reviewDocument with call error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ReviewDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ReviewDocumentRequest', ['humanReviewConfig']); + request.humanReviewConfig = defaultValue1; + const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.reviewDocument = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.reviewDocument(request), expectedError); + assert(stub.calledOnce); + const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes reviewDocument with LRO error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ReviewDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ReviewDocumentRequest', ['humanReviewConfig']); + request.humanReviewConfig = defaultValue1; + const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.reviewDocument = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.reviewDocument(request); + await assert.rejects(operation.promise(), expectedError); + assert(stub.calledOnce); + const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkReviewDocumentProgress without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + 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.checkReviewDocumentProgress(expectedResponse.name); + assert(stub.calledOnce); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkReviewDocumentProgress with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const stub = sinon.stub(client, 'warn'); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkReviewDocumentProgress(''), expectedError); + assert(stub.calledOnce); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('evaluateProcessorVersion', () => { + it('invokes evaluateProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest', ['processorVersion']); + request.processorVersion = defaultValue1; + const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.evaluateProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes evaluateProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest', ['processorVersion']); + request.processorVersion = defaultValue1; + const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.evaluateProcessorVersion( + 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.evaluateProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes evaluateProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest', ['processorVersion']); + request.processorVersion = defaultValue1; + const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.evaluateProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes evaluateProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest', ['processorVersion']); + request.processorVersion = defaultValue1; + const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.evaluateProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkEvaluateProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkEvaluateProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkEvaluateProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkEvaluateProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importProcessorVersion', () => { + it('invokes importProcessorVersion without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importProcessorVersion = stubLongRunningCall(expectedResponse); + const [operation] = await client.importProcessorVersion(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.importProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importProcessorVersion without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importProcessorVersion( + 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.importProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importProcessorVersion with call error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importProcessorVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importProcessorVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.importProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importProcessorVersion with LRO error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importProcessorVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importProcessorVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importProcessorVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportProcessorVersionProgress without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkImportProcessorVersionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportProcessorVersionProgress with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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.checkImportProcessorVersionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listProcessorTypes', () => { + it('invokes listProcessorTypes without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), + ]; + client.innerApiCalls.listProcessorTypes = stubSimpleCall(expectedResponse); + const [response] = await client.listProcessorTypes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listProcessorTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessorTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorTypes without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), + ]; + client.innerApiCalls.listProcessorTypes = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProcessorTypes( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessorType[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listProcessorTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessorTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorTypes with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listProcessorTypes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listProcessorTypes(request), expectedError); + const actualRequest = (client.innerApiCalls.listProcessorTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessorTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorTypesStream without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), + ]; + client.descriptors.page.listProcessorTypes.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listProcessorTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1beta3.ProcessorType[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1beta3.ProcessorType) => { + 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.listProcessorTypes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProcessorTypes, request)); + assert( + (client.descriptors.page.listProcessorTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listProcessorTypesStream with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessorTypes.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listProcessorTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1beta3.ProcessorType[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1beta3.ProcessorType) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listProcessorTypes.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProcessorTypes, request)); + assert( + (client.descriptors.page.listProcessorTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProcessorTypes without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), + ]; + client.descriptors.page.listProcessorTypes.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.documentai.v1beta3.IProcessorType[] = []; + const iterable = client.listProcessorTypesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProcessorTypes with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessorTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listProcessorTypesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.documentai.v1beta3.IProcessorType[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listProcessors', () => { + it('invokes listProcessors without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), + ]; + client.innerApiCalls.listProcessors = stubSimpleCall(expectedResponse); + const [response] = await client.listProcessors(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listProcessors as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessors as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessors without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), + ]; + client.innerApiCalls.listProcessors = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProcessors( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessor[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listProcessors as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessors as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessors with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listProcessors = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listProcessors(request), expectedError); + const actualRequest = (client.innerApiCalls.listProcessors as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessors as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorsStream without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), + ]; + client.descriptors.page.listProcessors.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listProcessorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1beta3.Processor[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1beta3.Processor) => { + 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.listProcessors.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProcessors, request)); + assert( + (client.descriptors.page.listProcessors.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listProcessorsStream with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessors.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listProcessorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1beta3.Processor[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1beta3.Processor) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listProcessors.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProcessors, request)); + assert( + (client.descriptors.page.listProcessors.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProcessors without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), + ]; + client.descriptors.page.listProcessors.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.documentai.v1beta3.IProcessor[] = []; + const iterable = client.listProcessorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listProcessors.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listProcessors.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProcessors with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listProcessorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.documentai.v1beta3.IProcessor[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listProcessors.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listProcessors.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listProcessorVersions', () => { + it('invokes listProcessorVersions without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), + ]; + client.innerApiCalls.listProcessorVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listProcessorVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listProcessorVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessorVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorVersions without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), + ]; + client.innerApiCalls.listProcessorVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listProcessorVersions( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessorVersion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listProcessorVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessorVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorVersions with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listProcessorVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listProcessorVersions(request), expectedError); + const actualRequest = (client.innerApiCalls.listProcessorVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listProcessorVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listProcessorVersionsStream without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), + ]; + client.descriptors.page.listProcessorVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listProcessorVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1beta3.ProcessorVersion[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1beta3.ProcessorVersion) => { + 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.listProcessorVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProcessorVersions, request)); + assert( + (client.descriptors.page.listProcessorVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listProcessorVersionsStream with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessorVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listProcessorVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1beta3.ProcessorVersion[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1beta3.ProcessorVersion) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listProcessorVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listProcessorVersions, request)); + assert( + (client.descriptors.page.listProcessorVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProcessorVersions without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), + ]; + client.descriptors.page.listProcessorVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.documentai.v1beta3.IProcessorVersion[] = []; + const iterable = client.listProcessorVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listProcessorVersions with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listProcessorVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listProcessorVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.documentai.v1beta3.IProcessorVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listEvaluations', () => { + it('invokes listEvaluations without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), + ]; + client.innerApiCalls.listEvaluations = stubSimpleCall(expectedResponse); + const [response] = await client.listEvaluations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluations without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), + ]; + client.innerApiCalls.listEvaluations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listEvaluations( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IEvaluation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluations with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEvaluations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEvaluations(request), expectedError); + const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listEvaluationsStream without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), + ]; + client.descriptors.page.listEvaluations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1beta3.Evaluation[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1beta3.Evaluation) => { + 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.listEvaluations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluations, request)); + assert( + (client.descriptors.page.listEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listEvaluationsStream with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listEvaluationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1beta3.Evaluation[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1beta3.Evaluation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listEvaluations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listEvaluations, request)); + assert( + (client.descriptors.page.listEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluations without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), + ]; + client.descriptors.page.listEvaluations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.documentai.v1beta3.IEvaluation[] = []; + const iterable = client.listEvaluationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listEvaluations with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listEvaluationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.documentai.v1beta3.IEvaluation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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('dataset', async () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + }; + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "processorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromDatasetName', () => { + const result = client.matchProcessorFromDatasetName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('datasetSchema', async () => { + const fakePath = "/rendered/path/datasetSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + }; + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.datasetSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetSchemaPath', () => { + const result = client.datasetSchemaPath("projectValue", "locationValue", "processorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetSchemaName', () => { + const result = client.matchProjectFromDatasetSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetSchemaName', () => { + const result = client.matchLocationFromDatasetSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromDatasetSchemaName', () => { + const result = client.matchProcessorFromDatasetSchemaName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.datasetSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluation', async () => { + const fakePath = "/rendered/path/evaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + processor_version: "processorVersionValue", + evaluation: "evaluationValue", + }; + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationPath', () => { + const result = client.evaluationPath("projectValue", "locationValue", "processorValue", "processorVersionValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationName', () => { + const result = client.matchProjectFromEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationName', () => { + const result = client.matchLocationFromEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromEvaluationName', () => { + const result = client.matchProcessorFromEvaluationName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorVersionFromEvaluationName', () => { + const result = client.matchProcessorVersionFromEvaluationName(fakePath); + assert.strictEqual(result, "processorVersionValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationName', () => { + const result = client.matchEvaluationFromEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('humanReviewConfig', async () => { + const fakePath = "/rendered/path/humanReviewConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + }; + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.humanReviewConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.humanReviewConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('humanReviewConfigPath', () => { + const result = client.humanReviewConfigPath("projectValue", "locationValue", "processorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.humanReviewConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromHumanReviewConfigName', () => { + const result = client.matchProjectFromHumanReviewConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.humanReviewConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromHumanReviewConfigName', () => { + const result = client.matchLocationFromHumanReviewConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.humanReviewConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromHumanReviewConfigName', () => { + const result = client.matchProcessorFromHumanReviewConfigName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.humanReviewConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + 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('processor', async () => { + const fakePath = "/rendered/path/processor"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + }; + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.processorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('processorPath', () => { + const result = client.processorPath("projectValue", "locationValue", "processorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.processorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProcessorName', () => { + const result = client.matchProjectFromProcessorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProcessorName', () => { + const result = client.matchLocationFromProcessorName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromProcessorName', () => { + const result = client.matchProcessorFromProcessorName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('processorType', async () => { + const fakePath = "/rendered/path/processorType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor_type: "processorTypeValue", + }; + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.processorTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('processorTypePath', () => { + const result = client.processorTypePath("projectValue", "locationValue", "processorTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.processorTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProcessorTypeName', () => { + const result = client.matchProjectFromProcessorTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProcessorTypeName', () => { + const result = client.matchLocationFromProcessorTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorTypeFromProcessorTypeName', () => { + const result = client.matchProcessorTypeFromProcessorTypeName(fakePath); + assert.strictEqual(result, "processorTypeValue"); + assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('processorVersion', async () => { + const fakePath = "/rendered/path/processorVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + processor_version: "processorVersionValue", + }; + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.processorVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('processorVersionPath', () => { + const result = client.processorVersionPath("projectValue", "locationValue", "processorValue", "processorVersionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.processorVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProcessorVersionName', () => { + const result = client.matchProjectFromProcessorVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProcessorVersionName', () => { + const result = client.matchLocationFromProcessorVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromProcessorVersionName', () => { + const result = client.matchProcessorFromProcessorVersionName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorVersionFromProcessorVersionName', () => { + const result = client.matchProcessorVersionFromProcessorVersionName(fakePath); + assert.strictEqual(result, "processorVersionValue"); + assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-documentai/test/gapic_document_service_v1beta3.ts b/owl-bot-staging/google-cloud-documentai/test/gapic_document_service_v1beta3.ts new file mode 100644 index 00000000000..723a87a1654 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/test/gapic_document_service_v1beta3.ts @@ -0,0 +1,2040 @@ +// 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, LROperation, operationsProtos, LocationProtos} 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 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 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('v1beta3.DocumentServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'documentai.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new documentserviceModule.v1beta3.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.v1beta3.DocumentServiceClient.servicePath; + assert.strictEqual(servicePath, 'documentai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = documentserviceModule.v1beta3.DocumentServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'documentai.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'documentai.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'documentai.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.v1beta3.DocumentServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'documentai.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.v1beta3.DocumentServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'documentai.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.v1beta3.DocumentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = documentserviceModule.v1beta3.DocumentServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new documentserviceModule.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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('getDocument', () => { + it('invokes getDocument without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDocumentRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetDocumentResponse() + ); + 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.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDocumentRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetDocumentResponse() + ); + client.innerApiCalls.getDocument = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDocument( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IGetDocumentResponse|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.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDocumentRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${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.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetDocumentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDocumentRequest', ['dataset']); + request.dataset = 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('getDatasetSchema', () => { + it('invokes getDatasetSchema without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DatasetSchema() + ); + client.innerApiCalls.getDatasetSchema = stubSimpleCall(expectedResponse); + const [response] = await client.getDatasetSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDatasetSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDatasetSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDatasetSchema without error using callback', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DatasetSchema() + ); + client.innerApiCalls.getDatasetSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDatasetSchema( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IDatasetSchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDatasetSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDatasetSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDatasetSchema with error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDatasetSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDatasetSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.getDatasetSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDatasetSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDatasetSchema with closed client', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getDatasetSchema(request), expectedError); + }); + }); + + describe('updateDatasetSchema', () => { + it('invokes updateDatasetSchema without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest() + ); + request.datasetSchema ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest', ['datasetSchema', 'name']); + request.datasetSchema.name = defaultValue1; + const expectedHeaderRequestParams = `dataset_schema.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DatasetSchema() + ); + client.innerApiCalls.updateDatasetSchema = stubSimpleCall(expectedResponse); + const [response] = await client.updateDatasetSchema(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDatasetSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDatasetSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatasetSchema without error using callback', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest() + ); + request.datasetSchema ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest', ['datasetSchema', 'name']); + request.datasetSchema.name = defaultValue1; + const expectedHeaderRequestParams = `dataset_schema.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.DatasetSchema() + ); + client.innerApiCalls.updateDatasetSchema = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDatasetSchema( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IDatasetSchema|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDatasetSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDatasetSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatasetSchema with error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest() + ); + request.datasetSchema ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest', ['datasetSchema', 'name']); + request.datasetSchema.name = defaultValue1; + const expectedHeaderRequestParams = `dataset_schema.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDatasetSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDatasetSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDatasetSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDatasetSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatasetSchema with closed client', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest() + ); + request.datasetSchema ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest', ['datasetSchema', 'name']); + request.datasetSchema.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateDatasetSchema(request), expectedError); + }); + }); + + describe('updateDataset', () => { + it('invokes updateDataset without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetRequest', ['dataset', 'name']); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDataset = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDataset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset without error using callback', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetRequest', ['dataset', 'name']); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDataset = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataset( + 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.updateDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset with call error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetRequest', ['dataset', 'name']); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataset = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataset with LRO error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.UpdateDatasetRequest() + ); + request.dataset ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetRequest', ['dataset', 'name']); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataset = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateDataset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDatasetProgress without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + 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.checkUpdateDatasetProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDatasetProgress with error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + 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.checkUpdateDatasetProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('importDocuments', () => { + it('invokes importDocuments without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ImportDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importDocuments = stubLongRunningCall(expectedResponse); + const [operation] = await client.importDocuments(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.importDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importDocuments without error using callback', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ImportDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importDocuments = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importDocuments( + 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.importDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importDocuments with call error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ImportDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importDocuments = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importDocuments(request), expectedError); + const actualRequest = (client.innerApiCalls.importDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importDocuments with LRO error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ImportDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.importDocuments = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importDocuments(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportDocumentsProgress without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + 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.checkImportDocumentsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportDocumentsProgress with error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + 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.checkImportDocumentsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('batchDeleteDocuments', () => { + it('invokes batchDeleteDocuments without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchDeleteDocuments = stubLongRunningCall(expectedResponse); + const [operation] = await client.batchDeleteDocuments(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchDeleteDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteDocuments without error using callback', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.batchDeleteDocuments = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchDeleteDocuments( + 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.batchDeleteDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteDocuments with call error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteDocuments = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchDeleteDocuments(request), expectedError); + const actualRequest = (client.innerApiCalls.batchDeleteDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteDocuments with LRO error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteDocuments = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchDeleteDocuments(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchDeleteDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkBatchDeleteDocumentsProgress without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + 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.checkBatchDeleteDocumentsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkBatchDeleteDocumentsProgress with error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + 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.checkBatchDeleteDocumentsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listDocuments', () => { + it('invokes listDocuments without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), + ]; + client.innerApiCalls.listDocuments = stubSimpleCall(expectedResponse); + const [response] = await client.listDocuments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDocuments without error using callback', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), + ]; + client.innerApiCalls.listDocuments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDocuments( + request, + (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IDocumentMetadata[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDocuments with error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDocuments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDocuments(request), expectedError); + const actualRequest = (client.innerApiCalls.listDocuments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDocuments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDocumentsStream without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), + ]; + client.descriptors.page.listDocuments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDocumentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1beta3.DocumentMetadata[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1beta3.DocumentMetadata) => { + 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.listDocuments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDocuments, request)); + assert( + (client.descriptors.page.listDocuments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDocumentsStream with error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDocuments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDocumentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.documentai.v1beta3.DocumentMetadata[] = []; + stream.on('data', (response: protos.google.cloud.documentai.v1beta3.DocumentMetadata) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDocuments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDocuments, request)); + assert( + (client.descriptors.page.listDocuments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDocuments without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), + generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), + ]; + client.descriptors.page.listDocuments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.documentai.v1beta3.IDocumentMetadata[] = []; + const iterable = client.listDocumentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDocuments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDocuments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDocuments with error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); + request.dataset = defaultValue1; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDocuments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDocumentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.documentai.v1beta3.IDocumentMetadata[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDocuments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDocuments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + 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 documentserviceModule.v1beta3.DocumentServiceClient({ + 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 documentserviceModule.v1beta3.DocumentServiceClient({ + 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 documentserviceModule.v1beta3.DocumentServiceClient({ + 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 documentserviceModule.v1beta3.DocumentServiceClient({ + 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 documentserviceModule.v1beta3.DocumentServiceClient({ + 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 documentserviceModule.v1beta3.DocumentServiceClient({ + 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 documentserviceModule.v1beta3.DocumentServiceClient({ + 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 documentserviceModule.v1beta3.DocumentServiceClient({ + 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 documentserviceModule.v1beta3.DocumentServiceClient({ + 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 documentserviceModule.v1beta3.DocumentServiceClient({ + 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('dataset', async () => { + const fakePath = "/rendered/path/dataset"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + }; + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.datasetPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath("projectValue", "locationValue", "processorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromDatasetName', () => { + const result = client.matchProcessorFromDatasetName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('datasetSchema', async () => { + const fakePath = "/rendered/path/datasetSchema"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + }; + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.datasetSchemaPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.datasetSchemaPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('datasetSchemaPath', () => { + const result = client.datasetSchemaPath("projectValue", "locationValue", "processorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.datasetSchemaPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDatasetSchemaName', () => { + const result = client.matchProjectFromDatasetSchemaName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.datasetSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDatasetSchemaName', () => { + const result = client.matchLocationFromDatasetSchemaName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.datasetSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromDatasetSchemaName', () => { + const result = client.matchProcessorFromDatasetSchemaName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.datasetSchemaPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('evaluation', async () => { + const fakePath = "/rendered/path/evaluation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + processor_version: "processorVersionValue", + evaluation: "evaluationValue", + }; + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.evaluationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.evaluationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('evaluationPath', () => { + const result = client.evaluationPath("projectValue", "locationValue", "processorValue", "processorVersionValue", "evaluationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.evaluationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromEvaluationName', () => { + const result = client.matchProjectFromEvaluationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromEvaluationName', () => { + const result = client.matchLocationFromEvaluationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromEvaluationName', () => { + const result = client.matchProcessorFromEvaluationName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorVersionFromEvaluationName', () => { + const result = client.matchProcessorVersionFromEvaluationName(fakePath); + assert.strictEqual(result, "processorVersionValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchEvaluationFromEvaluationName', () => { + const result = client.matchEvaluationFromEvaluationName(fakePath); + assert.strictEqual(result, "evaluationValue"); + assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('processor', async () => { + const fakePath = "/rendered/path/processor"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + }; + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.processorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('processorPath', () => { + const result = client.processorPath("projectValue", "locationValue", "processorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.processorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProcessorName', () => { + const result = client.matchProjectFromProcessorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProcessorName', () => { + const result = client.matchLocationFromProcessorName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromProcessorName', () => { + const result = client.matchProcessorFromProcessorName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.processorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('processorType', async () => { + const fakePath = "/rendered/path/processorType"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor_type: "processorTypeValue", + }; + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorTypePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.processorTypePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('processorTypePath', () => { + const result = client.processorTypePath("projectValue", "locationValue", "processorTypeValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.processorTypePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProcessorTypeName', () => { + const result = client.matchProjectFromProcessorTypeName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProcessorTypeName', () => { + const result = client.matchLocationFromProcessorTypeName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorTypeFromProcessorTypeName', () => { + const result = client.matchProcessorTypeFromProcessorTypeName(fakePath); + assert.strictEqual(result, "processorTypeValue"); + assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('processorVersion', async () => { + const fakePath = "/rendered/path/processorVersion"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + processor: "processorValue", + processor_version: "processorVersionValue", + }; + const client = new documentserviceModule.v1beta3.DocumentServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.processorVersionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.processorVersionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('processorVersionPath', () => { + const result = client.processorVersionPath("projectValue", "locationValue", "processorValue", "processorVersionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.processorVersionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProcessorVersionName', () => { + const result = client.matchProjectFromProcessorVersionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProcessorVersionName', () => { + const result = client.matchLocationFromProcessorVersionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorFromProcessorVersionName', () => { + const result = client.matchProcessorFromProcessorVersionName(fakePath); + assert.strictEqual(result, "processorValue"); + assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchProcessorVersionFromProcessorVersionName', () => { + const result = client.matchProcessorVersionFromProcessorVersionName(fakePath); + assert.strictEqual(result, "processorVersionValue"); + assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-documentai/tsconfig.json b/owl-bot-staging/google-cloud-documentai/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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-documentai/webpack.config.js b/owl-bot-staging/google-cloud-documentai/webpack.config.js new file mode 100644 index 00000000000..fc7bef574e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-documentai/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: 'DocumentProcessorService', + filename: './document-processor-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 9495a646c862c6bafa99a114d67c2f22fc67f6f1 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 6 Feb 2026 16:30:21 +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 --- .../google-cloud-documentai/.OwlBot.yaml | 19 - .../google-cloud-documentai/.eslintignore | 7 - .../google-cloud-documentai/.eslintrc.json | 3 - .../google-cloud-documentai/.gitattributes | 4 - .../google-cloud-documentai/.gitignore | 14 - .../google-cloud-documentai/.jsdoc.js | 55 - .../google-cloud-documentai/.mocharc.js | 33 - .../google-cloud-documentai/.nycrc | 24 - .../google-cloud-documentai/.prettierignore | 6 - .../google-cloud-documentai/.prettierrc.js | 22 - .../CODE_OF_CONDUCT.md | 94 - .../google-cloud-documentai/CONTRIBUTING.md | 76 - .../google-cloud-documentai/LICENSE | 202 - .../google-cloud-documentai/README.md | 167 - .../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 | 1261 - .../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 - .../cloud/documentai/v1beta3/barcode.proto | 69 - .../cloud/documentai/v1beta3/dataset.proto | 193 - .../cloud/documentai/v1beta3/document.proto | 1363 - .../documentai/v1beta3/document_io.proto | 188 - .../v1beta3/document_processor_service.proto | 1472 - .../documentai/v1beta3/document_schema.proto | 246 - .../documentai/v1beta3/document_service.proto | 456 - .../cloud/documentai/v1beta3/evaluation.proto | 202 - .../cloud/documentai/v1beta3/geometry.proto | 55 - .../v1beta3/operation_metadata.proto | 66 - .../cloud/documentai/v1beta3/processor.proto | 297 - .../documentai/v1beta3/processor_type.proto | 67 - .../protos/protos.d.ts | 49693 ------ .../google-cloud-documentai/protos/protos.js | 124847 --------------- .../protos/protos.json | 11380 -- ...ocessor_service.batch_process_documents.js | 96 - ...ment_processor_service.create_processor.js | 72 - ...ment_processor_service.delete_processor.js | 62 - ...cessor_service.delete_processor_version.js | 62 - ...cessor_service.deploy_processor_version.js | 62 - ...ent_processor_service.disable_processor.js | 62 - ...ment_processor_service.enable_processor.js | 62 - ...ssor_service.evaluate_processor_version.js | 70 - ...processor_service.fetch_processor_types.js | 62 - ...cument_processor_service.get_evaluation.js | 63 - ...ocument_processor_service.get_processor.js | 61 - ...nt_processor_service.get_processor_type.js | 61 - ...processor_service.get_processor_version.js | 61 - ...ment_processor_service.list_evaluations.js | 77 - ..._processor_service.list_processor_types.js | 74 - ...ocessor_service.list_processor_versions.js | 76 - ...ument_processor_service.list_processors.js | 75 - ...ment_processor_service.process_document.js | 110 - ...ument_processor_service.review_document.js | 80 - ...r_service.set_default_processor_version.js | 72 - ...ocessor_service.train_processor_version.js | 92 - ...ssor_service.undeploy_processor_version.js | 62 - ...t_metadata_google.cloud.documentai.v1.json | 1031 - ...ocessor_service.batch_process_documents.js | 104 - ...ment_processor_service.create_processor.js | 72 - ...ment_processor_service.delete_processor.js | 62 - ...cessor_service.delete_processor_version.js | 62 - ...cessor_service.deploy_processor_version.js | 62 - ...ent_processor_service.disable_processor.js | 62 - ...ment_processor_service.enable_processor.js | 62 - ...ssor_service.evaluate_processor_version.js | 70 - ...processor_service.fetch_processor_types.js | 62 - ...cument_processor_service.get_evaluation.js | 63 - ...ocument_processor_service.get_processor.js | 61 - ...nt_processor_service.get_processor_type.js | 61 - ...processor_service.get_processor_version.js | 61 - ...cessor_service.import_processor_version.js | 74 - ...ment_processor_service.list_evaluations.js | 77 - ..._processor_service.list_processor_types.js | 74 - ...ocessor_service.list_processor_versions.js | 76 - ...ument_processor_service.list_processors.js | 75 - ...ment_processor_service.process_document.js | 117 - ...ument_processor_service.review_document.js | 84 - ...r_service.set_default_processor_version.js | 72 - ...ocessor_service.train_processor_version.js | 92 - ...ssor_service.undeploy_processor_version.js | 62 - ...document_service.batch_delete_documents.js | 72 - .../document_service.get_dataset_schema.js | 67 - .../v1beta3/document_service.get_document.js | 78 - .../document_service.import_documents.js | 70 - .../document_service.list_documents.js | 117 - .../document_service.update_dataset.js | 67 - .../document_service.update_dataset_schema.js | 66 - ...adata_google.cloud.documentai.v1beta3.json | 1427 - .../google-cloud-documentai/src/index.ts | 28 - .../v1/document_processor_service_client.ts | 3934 - ...ument_processor_service_client_config.json | 140 - ...document_processor_service_proto_list.json | 12 - .../src/v1/gapic_metadata.json | 259 - .../google-cloud-documentai/src/v1/index.ts | 19 - .../document_processor_service_client.ts | 4176 - ...ument_processor_service_client_config.json | 144 - ...document_processor_service_proto_list.json | 14 - .../src/v1beta3/document_service_client.ts | 2032 - .../document_service_client_config.json | 54 - .../v1beta3/document_service_proto_list.json | 14 - .../src/v1beta3/gapic_metadata.json | 357 - .../src/v1beta3/index.ts | 20 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../system-test/install.ts | 49 - .../gapic_document_processor_service_v1.ts | 4453 - ...apic_document_processor_service_v1beta3.ts | 4711 - .../test/gapic_document_service_v1beta3.ts | 2040 - .../google-cloud-documentai/tsconfig.json | 22 - .../google-cloud-documentai/webpack.config.js | 64 - .../cloud/documentai/v1beta3/barcode.proto | 2 +- .../cloud/documentai/v1beta3/dataset.proto | 13 +- .../cloud/documentai/v1beta3/document.proto | 57 +- .../documentai/v1beta3/document_io.proto | 15 +- .../v1beta3/document_processor_service.proto | 18 +- .../documentai/v1beta3/document_schema.proto | 23 +- .../documentai/v1beta3/document_service.proto | 9 +- .../cloud/documentai/v1beta3/evaluation.proto | 24 +- .../cloud/documentai/v1beta3/geometry.proto | 2 +- .../v1beta3/operation_metadata.proto | 2 +- .../cloud/documentai/v1beta3/processor.proto | 6 +- .../documentai/v1beta3/processor_type.proto | 2 +- .../protos/protos.d.ts | 536 +- .../google-cloud-documentai/protos/protos.js | 1356 +- .../protos/protos.json | 121 +- .../document_processor_service_client.ts | 4 + ...apic_document_processor_service_v1beta3.ts | 12 + 132 files changed, 1803 insertions(+), 224100 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-documentai/.OwlBot.yaml delete mode 100644 owl-bot-staging/google-cloud-documentai/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-documentai/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-documentai/.gitattributes delete mode 100644 owl-bot-staging/google-cloud-documentai/.gitignore delete mode 100644 owl-bot-staging/google-cloud-documentai/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-documentai/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-documentai/.nycrc delete mode 100644 owl-bot-staging/google-cloud-documentai/.prettierignore delete mode 100644 owl-bot-staging/google-cloud-documentai/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-documentai/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/google-cloud-documentai/CONTRIBUTING.md delete mode 100644 owl-bot-staging/google-cloud-documentai/LICENSE delete mode 100644 owl-bot-staging/google-cloud-documentai/README.md delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_io.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_schema.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/evaluation.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/geometry.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/operation_metadata.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/processor.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/processor_type.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/barcode.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/evaluation.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/operation_metadata.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-documentai/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.deploy_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.disable_processor.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.enable_processor.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.evaluate_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_evaluation.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_type.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.undeploy_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_type.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.batch_delete_documents.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.get_document.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.import_documents.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.list_documents.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js delete mode 100644 owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata_google.cloud.documentai.v1beta3.json delete mode 100644 owl-bot-staging/google-cloud-documentai/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-documentai/src/v1beta3/index.ts delete mode 100644 owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-documentai/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1beta3.ts delete mode 100644 owl-bot-staging/google-cloud-documentai/test/gapic_document_service_v1beta3.ts delete mode 100644 owl-bot-staging/google-cloud-documentai/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-documentai/webpack.config.js diff --git a/owl-bot-staging/google-cloud-documentai/.OwlBot.yaml b/owl-bot-staging/google-cloud-documentai/.OwlBot.yaml deleted file mode 100644 index 091a0c24539..00000000000 --- a/owl-bot-staging/google-cloud-documentai/.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/documentai/google-cloud-documentai-nodejs - dest: /owl-bot-staging/google-cloud-documentai - -api-name: documentai \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-documentai/.eslintignore b/owl-bot-staging/google-cloud-documentai/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-documentai/.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-documentai/.eslintrc.json b/owl-bot-staging/google-cloud-documentai/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-documentai/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-documentai/.gitattributes b/owl-bot-staging/google-cloud-documentai/.gitattributes deleted file mode 100644 index 33739cb74e4..00000000000 --- a/owl-bot-staging/google-cloud-documentai/.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-documentai/.gitignore b/owl-bot-staging/google-cloud-documentai/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-documentai/.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-documentai/.jsdoc.js b/owl-bot-staging/google-cloud-documentai/.jsdoc.js deleted file mode 100644 index 314180e1555..00000000000 --- a/owl-bot-staging/google-cloud-documentai/.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/documentai', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-documentai/.mocharc.js b/owl-bot-staging/google-cloud-documentai/.mocharc.js deleted file mode 100644 index 5eb34e86c87..00000000000 --- a/owl-bot-staging/google-cloud-documentai/.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-documentai/.nycrc b/owl-bot-staging/google-cloud-documentai/.nycrc deleted file mode 100644 index 81a95fc94b0..00000000000 --- a/owl-bot-staging/google-cloud-documentai/.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-documentai/.prettierignore b/owl-bot-staging/google-cloud-documentai/.prettierignore deleted file mode 100644 index 9340ad9b86d..00000000000 --- a/owl-bot-staging/google-cloud-documentai/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/google-cloud-documentai/.prettierrc.js b/owl-bot-staging/google-cloud-documentai/.prettierrc.js deleted file mode 100644 index 7649ee3c254..00000000000 --- a/owl-bot-staging/google-cloud-documentai/.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-documentai/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-documentai/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a81..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/CONTRIBUTING.md b/owl-bot-staging/google-cloud-documentai/CONTRIBUTING.md deleted file mode 100644 index 87aed259257..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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 Documentai 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=documentai.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-documentai/LICENSE b/owl-bot-staging/google-cloud-documentai/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/README.md b/owl-bot-staging/google-cloud-documentai/README.md deleted file mode 100644 index aee7ef49588..00000000000 --- a/owl-bot-staging/google-cloud-documentai/README.md +++ /dev/null @@ -1,167 +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 - -# [Cloud Document AI 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/documentai.svg)](https://www.npmjs.org/package/@google-cloud/documentai) - -Cloud Document AI API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Cloud Document AI API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/documentai/latest) -* [Cloud Document AI API Documentation](https://cloud.google.com/document-ai/docs) - -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 Cloud Document AI 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/documentai -``` - -[//]: # "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 | -| --------------------------- | --------------------------------- | -| batch process documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js) | -| create processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js) | -| delete processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor.js) | -| delete processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor_version.js) | -| deploy processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.deploy_processor_version.js) | -| disable processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.disable_processor.js) | -| enable processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.enable_processor.js) | -| evaluate processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.evaluate_processor_version.js) | -| fetch processor types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js) | -| get evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_evaluation.js) | -| get processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor.js) | -| get processor type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_type.js) | -| get processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_version.js) | -| list evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js) | -| list processor types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js) | -| list processor versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js) | -| list processors | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js) | -| process document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js) | -| review document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js) | -| set default processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js) | -| train processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js) | -| undeploy processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/document_processor_service.undeploy_processor_version.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json) | -| batch process documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js) | -| create processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js) | -| delete processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor.js) | -| delete processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor_version.js) | -| deploy processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js) | -| disable processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js) | -| enable processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js) | -| evaluate processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js) | -| fetch processor types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js) | -| get evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js) | -| get processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor.js) | -| get processor type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_type.js) | -| get processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.js) | -| import processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js) | -| list evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js) | -| list processor types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js) | -| list processor versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js) | -| list processors | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js) | -| process document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js) | -| review document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js) | -| set default processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js) | -| train processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js) | -| undeploy processor version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js) | -| batch delete documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.batch_delete_documents.js) | -| get dataset schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js) | -| get document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.get_document.js) | -| import documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.import_documents.js) | -| list documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.list_documents.js) | -| update dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js) | -| update dataset schema | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata_google.cloud.documentai.v1beta3.json) | - - -## 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/documentai@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-documentai/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-documentai/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=documentai.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-documentai/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/barcode.proto deleted file mode 100644 index ba6672a0873..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/document.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document.proto deleted file mode 100644 index 1eaad2a3c54..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/document_io.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_io.proto deleted file mode 100644 index 65e7ed447d8..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto deleted file mode 100644 index b8a1a76e649..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_processor_service.proto +++ /dev/null @@ -1,1261 +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/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]; - } - - // 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-documentai/protos/google/cloud/documentai/v1/document_schema.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/document_schema.proto deleted file mode 100644 index ad721141a6d..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/evaluation.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/evaluation.proto deleted file mode 100644 index 3ffc570703a..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/geometry.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/geometry.proto deleted file mode 100644 index b6715431b18..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/operation_metadata.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/operation_metadata.proto deleted file mode 100644 index 0853e38ea8c..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/processor.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/processor.proto deleted file mode 100644 index 2306252d163..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1/processor_type.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1/processor_type.proto deleted file mode 100644 index 19ae44ee1f8..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/protos/google/cloud/documentai/v1beta3/barcode.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/barcode.proto deleted file mode 100644 index 02a4cd4bfac..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/barcode.proto +++ /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 -// -// 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.v1beta3; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; -option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "BarcodeProto"; -option java_package = "com.google.cloud.documentai.v1beta3"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; -option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; - -// 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-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto deleted file mode 100644 index 08321edd64c..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto +++ /dev/null @@ -1,193 +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.v1beta3; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/documentai/v1beta3/document.proto"; -import "google/cloud/documentai/v1beta3/document_io.proto"; -import "google/cloud/documentai/v1beta3/document_schema.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; -option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DatasetProto"; -option java_package = "com.google.cloud.documentai.v1beta3"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; -option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; -option (google.api.resource_definition) = { - type: "contentwarehouse.googleapis.com/Schema" - pattern: "projects/{project}/locations/{location}/schemas/{schema}" -}; - -// A singleton resource under a -// [Processor][google.cloud.documentai.v1beta3.Processor] which configures a -// collection of documents. -message Dataset { - option (google.api.resource) = { - type: "documentai.googleapis.com/Dataset" - pattern: "projects/{project}/locations/{location}/processors/{processor}/dataset" - }; - - // Configuration specific to the Cloud Storage-based implementation. - message GCSManagedConfig { - // Required. The Cloud Storage URI (a directory) where the documents - // belonging to the dataset must be stored. - GcsPrefix gcs_prefix = 1 [(google.api.field_behavior) = REQUIRED]; - } - - // Configuration specific to the Document AI Warehouse-based implementation. - message DocumentWarehouseConfig { - // Output only. The collection in Document AI Warehouse associated with the - // dataset. - string collection = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The schema in Document AI Warehouse associated with the - // dataset. - string schema = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "contentwarehouse.googleapis.com/Schema" - } - ]; - } - - // Configuration specific to an unmanaged dataset. - message UnmanagedDatasetConfig {} - - // Different states of a dataset. - enum State { - // Default unspecified enum, should not be used. - STATE_UNSPECIFIED = 0; - - // Dataset has not been initialized. - UNINITIALIZED = 1; - - // Dataset is being initialized. - INITIALIZING = 2; - - // Dataset has been initialized. - INITIALIZED = 3; - } - - oneof storage_source { - // Optional. User-managed Cloud Storage dataset configuration. Use this - // configuration if the dataset documents are stored under a user-managed - // Cloud Storage location. - GCSManagedConfig gcs_managed_config = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Deprecated. Warehouse-based dataset configuration is not - // supported. - DocumentWarehouseConfig document_warehouse_config = 5 - [deprecated = true, (google.api.field_behavior) = OPTIONAL]; - - // Optional. Unmanaged dataset configuration. Use this configuration if the - // dataset documents are managed by the document service internally (not - // user-managed). - UnmanagedDatasetConfig unmanaged_dataset_config = 6 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Dataset resource name. - // Format: - // `projects/{project}/locations/{location}/processors/{processor}/dataset` - string name = 1; - - // Required. State of the dataset. Ignored when updating dataset. - State state = 2 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzi = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Document Identifier. -message DocumentId { - // Identifies a document uniquely within the scope of a dataset in the - // user-managed Cloud Storage option. - message GCSManagedDocumentId { - // Required. The Cloud Storage URI where the actual document is stored. - string gcs_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Id of the document (indexed) managed by Content Warehouse. - string cw_doc_id = 2 [deprecated = true]; - } - - // Identifies a document uniquely within the scope of a dataset in unmanaged - // option. - message UnmanagedDocumentId { - // Required. The id of the document. - string doc_id = 1 [(google.api.field_behavior) = REQUIRED]; - } - - oneof type { - // A document id within user-managed Cloud Storage. - GCSManagedDocumentId gcs_managed_doc_id = 1; - - // A document id within unmanaged dataset. - UnmanagedDocumentId unmanaged_doc_id = 4; - } - - // Points to a specific revision of the document if set. - RevisionRef revision_ref = 3; -} - -// Dataset Schema. -message DatasetSchema { - option (google.api.resource) = { - type: "documentai.googleapis.com/DatasetSchema" - pattern: "projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema" - }; - - // Dataset schema resource name. - // Format: - // `projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema` - string name = 1; - - // Optional. Schema of the dataset. - DocumentSchema document_schema = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Reserved for future use. - bool satisfies_pzs = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzi = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Dataset documents that the batch operation will be applied to. -message BatchDatasetDocuments { - // List of individual DocumentIds. - message IndividualDocumentIds { - // Required. List of Document IDs indicating where the actual documents are - // stored. - repeated DocumentId document_ids = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - oneof criteria { - // Document identifiers. - IndividualDocumentIds individual_document_ids = 1; - - // A filter matching the documents. - // Follows the same format and restriction as - // [google.cloud.documentai.master.ListDocumentsRequest.filter]. - string filter = 2; - } -} diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto deleted file mode 100644 index c803d16bbbd..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto +++ /dev/null @@ -1,1363 +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.v1beta3; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/documentai/v1beta3/barcode.proto"; -import "google/cloud/documentai/v1beta3/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.V1Beta3"; -option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentProto"; -option java_package = "com.google.cloud.documentai.v1beta3"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; -option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; - -// 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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.text]. - TextAnchor text_anchor = 1; - - // Confidence of the current - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within - // context of the object this layout is for. For example, 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.v1beta3.Document.Page.Layout]. - BoundingPoly bounding_poly = 3; - - // Detected orientation for the - // [Layout][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for - // [Block][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for - // [Paragraph][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for - // [Line][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout] for - // [Token][google.cloud.documentai.v1beta3.Document.Page.Token]. - Layout layout = 1; - - // Detected break at the end of a - // [Token][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for - // [Symbol][google.cloud.documentai.v1beta3.Document.Page.Symbol]. - Layout layout = 1; - - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 2; - } - - // Detected non-text visual elements, for example, checkbox, signature etc. - // on the page. - message VisualElement { - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for - // [VisualElement][google.cloud.documentai.v1beta3.Document.Page.VisualElement]. - Layout layout = 1; - - // Type of the - // [VisualElement][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for - // [TableCell][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for - // [Table][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for the - // [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] - // name. For example, `Address`, `Email`, `Grand total`, `Phone number`, - // etc. - Layout field_name = 1; - - // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the - // [FormField][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout] for - // [DetectedBarcode][google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode]. - Layout layout = 1; - - // Detailed barcode information of the - // [DetectedBarcode][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page] in a parent - // [Document][google.cloud.documentai.v1beta3.Document]. Useful when a page - // is taken out of a [Document][google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.image]. - repeated Matrix transforms = 14; - - // Physical dimension of the page. - Dimension dimension = 2; - - // [Layout][google.cloud.documentai.v1beta3.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, for example, 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; - - // A signature - a graphical representation of a person's name, - // often used to sign a document. - 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.v1beta3.Document.text]. - TextAnchor text_anchor = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Entity type from a schema, for example, `Address`. - string type = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Text value of the entity, for example, `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 (for example, 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.v1beta3.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.v1beta3.Document.text]. - message TextAnchor { - // A text segment in the - // [Document.text][google.cloud.documentai.v1beta3.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.v1beta3.Document.ShardInfo.text_offset] - message TextSegment { - // [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] - // start UTF-8 char index in the - // [Document.text][google.cloud.documentai.v1beta3.Document.text]. - int64 start_index = 1; - - // [TextSegment][google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment] - // half open end UTF-8 char index in the - // [Document.text][google.cloud.documentai.v1beta3.Document.text]. - int64 end_index = 2; - } - - // The text segments from the - // [Document.text][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.blocks] - // element. - BLOCK = 1; - - // References a - // [Page.paragraphs][google.cloud.documentai.v1beta3.Document.Page.paragraphs] - // element. - PARAGRAPH = 2; - - // References a - // [Page.lines][google.cloud.documentai.v1beta3.Document.Page.lines] - // element. - LINE = 3; - - // References a - // [Page.tokens][google.cloud.documentai.v1beta3.Document.Page.tokens] - // element. - TOKEN = 4; - - // References a - // [Page.visual_elements][google.cloud.documentai.v1beta3.Document.Page.visual_elements] - // element. - VISUAL_ELEMENT = 5; - - // Refrrences a - // [Page.tables][google.cloud.documentai.v1beta3.Document.Page.tables] - // element. - TABLE = 6; - - // References a - // [Page.form_fields][google.cloud.documentai.v1beta3.Document.Page.form_fields] - // element. - FORM_FIELD = 7; - } - - // Required. Index into the - // [Document.pages][google.cloud.documentai.v1beta3.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.v1beta3.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. For example, `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.v1beta3.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 annotation of a block or a chunk. - message Annotations { - // The description of the content with this annotation. - string description = 1; - } - - // 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; - - // Annotation of the text block. - Annotations annotations = 4; - } - - // 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; - - // Annotation of the table block. - Annotations annotations = 4; - } - - // 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; - } - - // Represents an image type block. - message LayoutImageBlock { - // Source of the image. - oneof image_source { - // Optional. Asset id of the inline image. If set, find the image - // content in the blob_assets field. - string blob_asset_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Google Cloud Storage uri of the image. - string gcs_uri = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Data uri of the image. - // It is composed of four parts: a prefix (data:), a MIME type - // indicating the type of data, an optional base64 token if - // non-textual, and the data itself: - // data:[][;base64], - string data_uri = 6 [(google.api.field_behavior) = OPTIONAL]; - } - - // Mime type of the image. An IANA published [media type (MIME type)] - // (https://www.iana.org/assignments/media-types/media-types.xhtml). - string mime_type = 1; - - // Text extracted from the image using OCR or alt text describing the - // image. - string image_text = 2; - - // Annotation of the image block. - Annotations annotations = 3; - } - - 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; - - // Block consisting of image content. - LayoutImageBlock image_block = 7; - } - - // 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; - } - - // The image chunk field in the chunk. - message ImageChunkField { - // Source of the image. - oneof image_source { - // Optional. Asset id of the inline image. If set, find the image - // content in the blob_assets field. - string blob_asset_id = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Google Cloud Storage uri of the image. - string gcs_uri = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Data uri of the image. - // It is composed of four parts: a prefix (data:), a MIME type - // indicating the type of data, an optional base64 token if - // non-textual, and the data itself: - // data:[][;base64], - string data_uri = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Annotation of the image chunk field. - Annotations annotations = 4; - } - - // The table chunk field in the chunk. - message TableChunkField { - // Annotation of the table chunk field. - Annotations annotations = 1; - } - - // The chunk field in the chunk. A chunk field could be one of the various - // types (for example, image, table) supported. - message ChunkField { - // The type of the chunk field. - oneof field_type { - // The image chunk field in the chunk. - ImageChunkField image_chunk_field = 1; - - // The table chunk field in the chunk. - TableChunkField table_chunk_field = 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; - - // Chunk fields inside this chunk. - repeated ChunkField chunk_fields = 7; - } - - // List of chunks. - repeated Chunk chunks = 1; - } - - // Represents a blob asset. It's used to store the content of the inline blob - // in this document, for example, image bytes, such that it can be referenced - // by other fields in the document via asset ID. - message BlobAsset { - // Optional. The id of the blob asset. - string asset_id = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The content of the blob asset, for example, image bytes. - bytes content = 2 [(google.api.field_behavior) = OPTIONAL]; - - // The mime type of the blob asset. - // An IANA published [media type (MIME - // type)](https://www.iana.org/assignments/media-types/media-types.xhtml). - string mime_type = 3; - } - - // 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 display 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; - - // Optional. The history of this revision. - Provenance provenance = 4 [(google.api.field_behavior) = OPTIONAL]; - } - - // 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.v1beta3.Document.text]. - repeated Style text_styles = 5 [deprecated = true]; - - // Visual page layout for the - // [Document][google.cloud.documentai.v1beta3.Document]. - repeated Page pages = 6; - - // A list of entities detected on - // [Document.text][google.cloud.documentai.v1beta3.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.v1beta3.Document.entities]. - repeated EntityRelation entity_relations = 8; - - // Placeholder. A list of text corrections made to - // [Document.text][google.cloud.documentai.v1beta3.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; - - // Optional. The blob assets in this document. This is used to store the - // content of the inline blobs in this document, for example, image bytes, - // such that it can be referenced by other fields in the document via asset - // id. - repeated BlobAsset blob_assets = 19 [(google.api.field_behavior) = OPTIONAL]; - - // 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; -} - -// The revision reference specifies which revision on the document to read. -message RevisionRef { - // Some predefined revision cases. - enum RevisionCase { - // Unspecified case, fall back to read the `LATEST_HUMAN_REVIEW`. - REVISION_CASE_UNSPECIFIED = 0; - - // The latest revision made by a human. - LATEST_HUMAN_REVIEW = 1; - - // The latest revision based on timestamp. - LATEST_TIMESTAMP = 2; - - // The first (OCR) revision. - BASE_OCR_REVISION = 3; - } - - // Specifies which revision to read. - oneof source { - // Reads the revision by the predefined case. - RevisionCase revision_case = 1; - - // Reads the revision given by the id. - string revision_id = 2; - - // Reads the revision generated by the processor version. - // The format takes the full resource name of processor version. - // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - string latest_processor_version = 3; - } -} diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto deleted file mode 100644 index a80f1a95be5..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto +++ /dev/null @@ -1,188 +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.v1beta3; - -import "google/cloud/documentai/v1beta3/document.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; -option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentIoProto"; -option java_package = "com.google.cloud.documentai.v1beta3"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; -option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; - -// A set of inline documents. -message Documents { - // The list of documents. - repeated Document documents = 1; -} - -// 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.v1beta3.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; -} - -// Specifies a set of raw documents. -message RawDocuments { - // Specifies raw document content and mime type. - repeated RawDocument documents = 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.v1beta3.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-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto deleted file mode 100644 index c3e4c98e4c6..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto +++ /dev/null @@ -1,1472 +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.v1beta3; - -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/v1beta3/document.proto"; -import "google/cloud/documentai/v1beta3/document_io.proto"; -import "google/cloud/documentai/v1beta3/document_schema.proto"; -import "google/cloud/documentai/v1beta3/evaluation.proto"; -import "google/cloud/documentai/v1beta3/operation_metadata.proto"; -import "google/cloud/documentai/v1beta3/processor.proto"; -import "google/cloud/documentai/v1beta3/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.V1Beta3"; -option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentAiProcessorService"; -option java_package = "com.google.cloud.documentai.v1beta3"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; -option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; -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: "/v1beta3/{name=projects/*/locations/*/processors/*}:process" - body: "*" - additional_bindings { - post: "/v1beta3/{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: "/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess" - body: "*" - additional_bindings { - post: "/v1beta3/{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.v1beta3.DocumentProcessorService.ListProcessorTypes] - // here, because it isn't paginated. - rpc FetchProcessorTypes(FetchProcessorTypesRequest) - returns (FetchProcessorTypesResponse) { - option (google.api.http) = { - get: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{parent=projects/*/locations/*}/processors" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a processor detail. - rpc GetProcessor(GetProcessorRequest) returns (Processor) { - option (google.api.http) = { - get: "/v1beta3/{name=projects/*/locations/*/processors/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Trains a new processor version. - // Operation metadata is returned as - // [TrainProcessorVersionMetadata][google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata]. - rpc TrainProcessorVersion(TrainProcessorVersionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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.v1beta3.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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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.v1beta3.Processor] that will be used in - // [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] - // and - // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. - rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta3/{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 deprecated = true; - option (google.api.http) = { - post: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{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: "/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations" - }; - option (google.api.method_signature) = "parent"; - } - - // Imports a processor version from source processor version. - rpc ImportProcessorVersion(ImportProcessorVersionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:importProcessorVersion" - body: "*" - }; - option (google.api.method_signature) = "parent"; - option (google.longrunning.operation_info) = { - response_type: "ImportProcessorVersionResponse" - metadata_type: "ImportProcessorVersionMetadata" - }; - } -} - -// 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. The number of tokens to group together when evaluating - // semantic similarity. - // **Note:** This field is not yet used. - bool semantic_chunking_group_size = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The percentile of cosine dissimilarity that must be exceeded - // between a group of tokens and the next. The smaller this number is, the - // more chunks will be generated. - // **Note:** This field is not yet used. - int32 breakpoint_percentile_threshold = 4 - [(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 extract images in layout parser response. - bool enable_image_extraction = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether to refine PDF layout using LLM. - bool enable_llm_layout_parsing = 5 [(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]; - - // Optional. Whether to split table. - bool enable_table_split = 8 [(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.v1beta3.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.v1beta3.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.v1beta3.ProcessorVersion]. Will - // return an Invalid Argument error if this field is set when the underlying - // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] - // doesn't support schema override. - DocumentSchema schema_override = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for the -// [ProcessDocument][google.cloud.documentai.v1beta3.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.v1beta3.Processor] or - // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] - // to use for processing. If a - // [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the - // server will use its [default - // version][google.cloud.documentai.v1beta3.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: "*" } - ]; - - // The document payload, the - // [content][google.cloud.documentai.v1beta3.Document.content] and - // [mime_type][google.cloud.documentai.v1beta3.Document.mime_type] fields must - // be set. - Document document = 2 [deprecated = true]; - - // Whether human review should be skipped for this request. Default to - // `false`. - bool skip_human_review = 3 [deprecated = true]; - - // Specifies which fields to include in the - // [ProcessResponse.document][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService.ReviewDocument]. - string human_review_operation = 3; -} - -// Response message for the -// [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] -// method. -message ProcessResponse { - // The document payload, will populate fields based on the processor's - // behavior. - Document document = 1; - - // The name of the operation triggered by the processed document. If the human - // review process isn't triggered, this field is empty. It has the same - // response type and metadata as the long-running operation returned by - // [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument]. - string human_review_operation = 2 [deprecated = true]; - - // The status of human review on the processed document. - HumanReviewStatus human_review_status = 3; -} - -// Request message for -// [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]. -message BatchProcessRequest { - // The message for input config in batch process. - message BatchInputConfig { - option deprecated = true; - - // The Cloud Storage location as the source of the document. - string gcs_source = 1; - - // An IANA published [media type (MIME - // type)](https://www.iana.org/assignments/media-types/media-types.xhtml) of - // the input. If the input is a raw document, refer to [supported file - // types](https://cloud.google.com/document-ai/docs/file-types) for the list - // of media types. If the input is a - // [Document][google.cloud.documentai.v1beta3.Document], the type should be - // `application/json`. - string mime_type = 2; - } - - // The output configuration in the - // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments] - // method. - message BatchOutputConfig { - option deprecated = true; - - // The output Cloud Storage directory to put the processed documents. - string gcs_destination = 1; - } - - // Required. The resource name of - // [Processor][google.cloud.documentai.v1beta3.Processor] or - // [ProcessorVersion][google.cloud.documentai.v1beta3.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 config for each single document in the batch process. - repeated BatchInputConfig input_configs = 2 [deprecated = true]; - - // The overall output config for batch process. - BatchOutputConfig output_config = 3 [deprecated = true]; - - // The input documents for the - // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments] - // method. - BatchDocumentsInputConfig input_documents = 5; - - // The output configuration for the - // [BatchProcessDocuments][google.cloud.documentai.v1beta3.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 [deprecated = true]; - - // 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.v1beta3.DocumentProcessorService.BatchProcessDocuments]. -message BatchProcessResponse {} - -// The long-running operation metadata for -// [BatchProcessDocuments][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.DocumentOutputConfig.GcsOutputConfig.gcs_uri]) - // of the processed document if it was successful, otherwise empty. - string output_gcs_destination = 3; - - // The name of the operation triggered by the processed document. If the - // human review process isn't triggered, this field will be empty. It has - // the same response type and metadata as the long-running operation - // returned by the - // [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument] - // method. - string human_review_operation = 4 [deprecated = true]; - - // 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.v1beta3.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.v1beta3.DocumentProcessorService.FetchProcessorTypes] -// method. -message FetchProcessorTypesResponse { - // The list of processor types. - repeated ProcessorType processor_types = 1; -} - -// Request message for the -// [ListProcessorTypes][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService.DeployProcessorVersion] -// method. -message DeployProcessorVersionResponse {} - -// The long-running operation metadata for the -// [DeployProcessorVersion][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService.UndeployProcessorVersion] -// method. -message UndeployProcessorVersionResponse {} - -// The long-running operation metadata for the -// [UndeployProcessorVersion][google.cloud.documentai.v1beta3.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.v1beta3.DocumentProcessorService.CreateProcessor] -// method. Notice this request is sent to a regionalized backend service. If the -// [ProcessorType][google.cloud.documentai.v1beta3.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.v1beta3.Processor.type] and - // [Processor.display_name][google.cloud.documentai.v1beta3.Processor.display_name] - // to be set. Also, the - // [Processor.kms_key_name][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService.EnableProcessor] -// method. Intentionally empty proto for adding fields in future. -message EnableProcessorResponse {} - -// The long-running operation metadata for the -// [EnableProcessor][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService.DisableProcessor] -// method. Intentionally empty proto for adding fields in future. -message DisableProcessorResponse {} - -// The long-running operation metadata for the -// [DisableProcessor][google.cloud.documentai.v1beta3.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.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion] -// method. -message SetDefaultProcessorVersionRequest { - // Required. The resource name of the - // [Processor][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion] -// method. -message SetDefaultProcessorVersionResponse {} - -// The long-running operation metadata for the -// [SetDefaultProcessorVersion][google.cloud.documentai.v1beta3.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.v1beta3.DocumentProcessorService.TrainProcessorVersion] -// method. -message TrainProcessorVersionRequest { - // The input data used to train a new - // [ProcessorVersion][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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" - } - ]; - - // The document that needs human review. - Document document = 2 [deprecated = true]; - - // 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.v1beta3.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.v1beta3.DocumentProcessorService.ReviewDocument] -// method. -message ReviewDocumentOperationMetadata { - // State of the long-running 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; - } - - // Used only when Operation.done is false. - 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 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.v1beta3.ProcessorVersion] against -// the supplied documents. -message EvaluateProcessorVersionRequest { - // Required. The resource name of the - // [ProcessorVersion][google.cloud.documentai.v1beta3.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.v1beta3.DocumentProcessorService.EvaluateProcessorVersion] -// method. -message EvaluateProcessorVersionMetadata { - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 1; -} - -// Response of the -// [EvaluateProcessorVersion][google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.ProcessorVersion]. -message ListEvaluationsRequest { - // Required. The resource name of the - // [ProcessorVersion][google.cloud.documentai.v1beta3.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; -} - -// The request message for the -// [ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion] -// method. -// -// The Document AI [Service -// Agent](https://cloud.google.com/iam/docs/service-agents) of the destination -// project must have [Document AI Editor -// role](https://cloud.google.com/document-ai/docs/access-control/iam-roles) on -// the source project. -// -// The destination project is specified as part of the -// [parent][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.parent] -// field. The source project is specified as part of the -// [source][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.processor_version_source] -// or -// [external_processor_version_source][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.external_processor_version_source] -// field. -message ImportProcessorVersionRequest { - // The external source processor version. - message ExternalProcessorVersionSource { - // Required. The processor version name. Format: - // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - string processor_version = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The Document AI service endpoint. For example, - // 'https://us-documentai.googleapis.com' - string service_endpoint = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - oneof source { - // The source processor version to import from. The source processor version - // and destination processor need to be in the same environment and region. - string processor_version_source = 2 [(google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - }]; - - // The source processor version to import from. It can be from a different - // environment and region than the destination processor. - ExternalProcessorVersionSource external_processor_version_source = 3; - } - - // Required. The destination processor name to create the processor version - // in. 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 response message for the -// [ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion] -// method. -message ImportProcessorVersionResponse { - // The destination processor version name. - string processor_version = 1 [(google.api.resource_reference) = { - type: "documentai.googleapis.com/ProcessorVersion" - }]; -} - -// The long-running operation metadata for the -// [ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion] -// method. -message ImportProcessorVersionMetadata { - // The basic metadata for the long-running operation. - CommonOperationMetadata common_metadata = 1; -} - -// The long-running operation metadata for the -// [UpdateProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.UpdateProcessorVersion] -// method. -message UpdateProcessorVersionMetadata { - // The basic metadata for the long-running operation. - CommonOperationMetadata common_metadata = 1; -} diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto deleted file mode 100644 index 8539769f467..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto +++ /dev/null @@ -1,246 +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.v1beta3; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; -option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentAiDocumentSchema"; -option java_package = "com.google.cloud.documentai.v1beta3"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; -option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; - -// Metadata for document summarization. -message SummaryOptions { - // The Length enum. - enum Length { - // Default. - LENGTH_UNSPECIFIED = 0; - - // A brief summary of one or two sentences. - BRIEF = 1; - - // A paragraph-length summary. - MODERATE = 2; - - // The longest option available. - COMPREHENSIVE = 3; - } - - // The Format enum. - enum Format { - // Default. - FORMAT_UNSPECIFIED = 0; - - // Format the output in paragraphs. - PARAGRAPH = 1; - - // Format the output in bullets. - BULLETS = 2; - } - - // How long the summary should be. - Length length = 1; - - // The format the summary should be in. - Format format = 2; -} - -// Metadata for how this field value is extracted. -message FieldExtractionMetadata { - // Summary options config. - SummaryOptions summary_options = 2; -} - -// Metadata about a property. -message PropertyMetadata { - // Whether the property should be considered as "inactive". - bool inactive = 3; - - // Field extraction metadata on the property. - FieldExtractionMetadata field_extraction_metadata = 9; -} - -// Metadata about an entity type. -message EntityTypeMetadata { - // Whether the entity type should be considered inactive. - bool inactive = 5; -} - -// 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, it's - // expected that a bank statement contains 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; - - // The description of the property. Could be used to provide more - // information about the property for model calls. - string description = 7; - - // 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; - - // Any additional metadata about the property can be added here. - PropertyMetadata property_metadata = 5; - } - - 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 description of the entity type. Could be used to provide more - // information about the entity type for model calls. - string description = 15; - - // 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 the entity type. - EntityTypeMetadata entity_type_metadata = 11; - } - - // 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, this 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 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; - - // Optional. Document level prompt provided by the user. This custom text is - // injected into the AI model's prompt to provide extra, document-wide - // guidance for processing. - string document_prompt = 5 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto deleted file mode 100644 index 91cc4f9c80c..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto +++ /dev/null @@ -1,456 +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.v1beta3; - -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/v1beta3/dataset.proto"; -import "google/cloud/documentai/v1beta3/document.proto"; -import "google/cloud/documentai/v1beta3/document_io.proto"; -import "google/cloud/documentai/v1beta3/operation_metadata.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; -option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentAiDocumentService"; -option java_package = "com.google.cloud.documentai.v1beta3"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; -option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; - -// Service to call Cloud DocumentAI to manage document collection (dataset). -service DocumentService { - option (google.api.default_host) = "documentai.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Updates metadata associated with a dataset. - // Note that this method requires the - // `documentai.googleapis.com/datasets.update` 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 UpdateDataset(UpdateDatasetRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta3/{dataset.name=projects/*/locations/*/processors/*/dataset}" - body: "dataset" - }; - option (google.api.method_signature) = "dataset,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Dataset" - metadata_type: "UpdateDatasetOperationMetadata" - }; - } - - // Import documents into a dataset. - rpc ImportDocuments(ImportDocumentsRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:importDocuments" - body: "*" - }; - option (google.api.method_signature) = "dataset"; - option (google.longrunning.operation_info) = { - response_type: "ImportDocumentsResponse" - metadata_type: "ImportDocumentsMetadata" - }; - } - - // Returns relevant fields present in the requested document. - rpc GetDocument(GetDocumentRequest) returns (GetDocumentResponse) { - option (google.api.http) = { - get: "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:getDocument" - }; - option (google.api.method_signature) = "dataset"; - } - - // Returns a list of documents present in the dataset. - rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) { - option (google.api.http) = { - post: "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:listDocuments" - body: "*" - }; - option (google.api.method_signature) = "dataset"; - } - - // Deletes a set of documents. - rpc BatchDeleteDocuments(BatchDeleteDocumentsRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:batchDeleteDocuments" - body: "*" - }; - option (google.api.method_signature) = "dataset"; - option (google.longrunning.operation_info) = { - response_type: "BatchDeleteDocumentsResponse" - metadata_type: "BatchDeleteDocumentsMetadata" - }; - } - - // Gets the `DatasetSchema` of a `Dataset`. - rpc GetDatasetSchema(GetDatasetSchemaRequest) returns (DatasetSchema) { - option (google.api.http) = { - get: "/v1beta3/{name=projects/*/locations/*/processors/*/dataset/datasetSchema}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a `DatasetSchema`. - rpc UpdateDatasetSchema(UpdateDatasetSchemaRequest) returns (DatasetSchema) { - option (google.api.http) = { - patch: "/v1beta3/{dataset_schema.name=projects/*/locations/*/processors/*/dataset/datasetSchema}" - body: "dataset_schema" - }; - option (google.api.method_signature) = "dataset_schema,update_mask"; - } -} - -// Documents belonging to a dataset will be split into different groups -// referred to as splits: train, test. -enum DatasetSplitType { - // Default value if the enum is not set. - DATASET_SPLIT_TYPE_UNSPECIFIED = 0; - - // Identifies the train documents. - DATASET_SPLIT_TRAIN = 1; - - // Identifies the test documents. - DATASET_SPLIT_TEST = 2; - - // Identifies the unassigned documents. - DATASET_SPLIT_UNASSIGNED = 3; -} - -// Describes the labeling status of a document. -enum DocumentLabelingState { - // Default value if the enum is not set. - DOCUMENT_LABELING_STATE_UNSPECIFIED = 0; - - // Document has been labeled. - DOCUMENT_LABELED = 1; - - // Document has not been labeled. - DOCUMENT_UNLABELED = 2; - - // Document has been auto-labeled. - DOCUMENT_AUTO_LABELED = 3; -} - -message UpdateDatasetRequest { - // Required. The `name` field of the `Dataset` is used to identify the - // resource to be updated. - Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED]; - - // The update mask applies to the resource. - google.protobuf.FieldMask update_mask = 2; -} - -message UpdateDatasetOperationMetadata { - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 1; -} - -message ImportDocumentsRequest { - // Config for importing documents. - // Each batch can have its own dataset split type. - message BatchDocumentsImportConfig { - // The config for auto-split. - message AutoSplitConfig { - // Ratio of training dataset split. - float training_split_ratio = 1; - } - - oneof split_type_config { - // Target dataset split where the documents must be stored. - DatasetSplitType dataset_split = 2; - - // If set, documents will be automatically split into training and test - // split category with the specified ratio. - AutoSplitConfig auto_split_config = 3; - } - - // The common config to specify a set of documents used as input. - BatchDocumentsInputConfig batch_input_config = 1; - - // Optional. If set, determines the type of the documents to be imported in - // this batch. It can be used to auto-label the documents with a single - // entity of the provided type. This field can only be used with a - // classifier or splitter processor. Providing this field is mutually - // exclusive with `entities` and `auto_labeling_config`. - string document_type = 6 [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. The dataset resource name. - // Format: - // projects/{project}/locations/{location}/processors/{processor}/dataset - string dataset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/Dataset" - } - ]; - - // Required. The Cloud Storage uri containing raw documents that must be - // imported. - repeated BatchDocumentsImportConfig batch_documents_import_configs = 4 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response of the import document operation. -message ImportDocumentsResponse {} - -// Metadata of the import document operation. -message ImportDocumentsMetadata { - // The status of each individual document in the import process. - message IndividualImportStatus { - // The source Cloud Storage URI of the document. - string input_gcs_source = 1; - - // The status of the importing of the document. - google.rpc.Status status = 2; - - // The document id of imported document if it was successful, otherwise - // empty. - DocumentId output_document_id = 4; - } - - // The validation status of each import config. Status is set to an error if - // there are no documents to import in the `import_config`, or `OK` if the - // operation will try to proceed with at least one document. - message ImportConfigValidationResult { - // The source Cloud Storage URI specified in the import config. - string input_gcs_source = 1; - - // The validation status of import config. - google.rpc.Status status = 2; - } - - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 1; - - // The list of response details of each document. - repeated IndividualImportStatus individual_import_statuses = 2; - - // Validation statuses of the batch documents import config. - repeated ImportConfigValidationResult import_config_validation_results = 4; - - // Total number of the documents that are qualified for importing. - int32 total_document_count = 3; -} - -message GetDocumentRequest { - // Required. The resource name of the dataset that the document belongs to . - // Format: - // projects/{project}/locations/{location}/processors/{processor}/dataset - string dataset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/Dataset" - } - ]; - - // Required. Document identifier. - DocumentId document_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // If set, only fields listed here will be returned. Otherwise, all fields - // will be returned by default. - google.protobuf.FieldMask read_mask = 3; - - // List of pages for which the fields specified in the `read_mask` must - // be served. - DocumentPageRange page_range = 4; -} - -message GetDocumentResponse { - Document document = 1; -} - -message ListDocumentsRequest { - // Required. The resource name of the dataset to be listed. - // Format: - // projects/{project}/locations/{location}/processors/{processor}/dataset - string dataset = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/Dataset" - } - ]; - - // The maximum number of documents to return. The service may return - // fewer than this value. - // If unspecified, at most 20 documents will be returned. - // The maximum value is 100; values above 100 will be coerced to 100. - int32 page_size = 2; - - // A page token, received from a previous `ListDocuments` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListDocuments` - // must match the call that provided the page token. - string page_token = 3; - - // Optional. Query to filter the documents based on - // https://google.aip.dev/160. - // ## Currently support query strings are: - // - // `SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED` - // - `LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED` - // - `DisplayName=\"file_name.pdf\"` - // - `EntityType=abc/def` - // - `TagName=\"auto-labeling-running\"|\"sampled\"` - // - // Note: - // - Only `AND`, `=` and `!=` are supported. - // e.g. `DisplayName=file_name AND EntityType!=abc` IS supported. - // - Wildcard `*` is supported only in `DisplayName` filter - // - No duplicate filter keys are allowed, - // e.g. `EntityType=a AND EntityType=b` is NOT supported. - // - String match is case sensitive (for filter `DisplayName` & `EntityType`). - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Controls if the request requires a total size of matched - // documents. See - // [ListDocumentsResponse.total_size][google.cloud.documentai.v1beta3.ListDocumentsResponse.total_size]. - // - // Enabling this flag may adversely impact performance. - // - // Defaults to false. - bool return_total_size = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Number of results to skip beginning from the `page_token` if - // provided. https://google.aip.dev/158#skipping-results. It must be a - // non-negative integer. Negative values will be rejected. Note that this is - // not the number of pages to skip. If this value causes the cursor to move - // past the end of results, - // [ListDocumentsResponse.document_metadata][google.cloud.documentai.v1beta3.ListDocumentsResponse.document_metadata] - // and - // [ListDocumentsResponse.next_page_token][google.cloud.documentai.v1beta3.ListDocumentsResponse.next_page_token] - // will be empty. - int32 skip = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -message ListDocumentsResponse { - // Document metadata corresponding to the listed documents. - repeated DocumentMetadata document_metadata = 1; - - // A token, which can be sent as - // [ListDocumentsRequest.page_token][google.cloud.documentai.v1beta3.ListDocumentsRequest.page_token] - // to retrieve the next page. If this field is omitted, there are no - // subsequent pages. - string next_page_token = 2; - - // Total count of documents queried. - int32 total_size = 3; -} - -message BatchDeleteDocumentsRequest { - // Required. The dataset resource name. - // Format: - // projects/{project}/locations/{location}/processors/{processor}/dataset - string dataset = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Dataset documents input. If given `filter`, all documents - // satisfying the filter will be deleted. If given documentIds, a maximum of - // 50 documents can be deleted in a batch. The request will be rejected if - // more than 50 document_ids are provided. - BatchDatasetDocuments dataset_documents = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response of the delete documents operation. -message BatchDeleteDocumentsResponse {} - -message BatchDeleteDocumentsMetadata { - // The status of each individual document in the batch delete process. - message IndividualBatchDeleteStatus { - // The document id of the document. - DocumentId document_id = 1; - - // The status of deleting the document in storage. - google.rpc.Status status = 2; - } - - // The basic metadata of the long-running operation. - CommonOperationMetadata common_metadata = 1; - - // The list of response details of each document. - repeated IndividualBatchDeleteStatus individual_batch_delete_statuses = 2; - - // Total number of documents deleting from dataset. - int32 total_document_count = 3; - - // Total number of documents that failed to be deleted in storage. - int32 error_document_count = 4; -} - -// Request for `GetDatasetSchema`. -message GetDatasetSchemaRequest { - // Required. The dataset schema resource name. - // Format: - // projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "documentai.googleapis.com/DatasetSchema" - } - ]; - - // If set, only returns the visible fields of the schema. - bool visible_fields_only = 2; -} - -// Request for `UpdateDatasetSchema`. -message UpdateDatasetSchemaRequest { - // Required. The name field of the `DatasetSchema` is used to identify the - // resource to be updated. - DatasetSchema dataset_schema = 1 [(google.api.field_behavior) = REQUIRED]; - - // The update mask applies to the resource. - google.protobuf.FieldMask update_mask = 2; -} - -// Range of pages present in a document. -message DocumentPageRange { - // First page number (one-based index) to be returned. - int32 start = 1; - - // Last page number (one-based index) to be returned. - int32 end = 2; -} - -// Metadata about a document. -message DocumentMetadata { - // Document identifier. - DocumentId document_id = 1; - - // Number of pages in the document. - int32 page_count = 2; - - // Type of the dataset split to which the document belongs. - DatasetSplitType dataset_type = 3; - - // Labeling state of the document. - DocumentLabelingState labeling_state = 5; - - // The display name of the document. - string display_name = 6; -} diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/evaluation.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/evaluation.proto deleted file mode 100644 index 6f60de0536e..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/evaluation.proto +++ /dev/null @@ -1,202 +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.v1beta3; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; -option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentAiEvaluation"; -option java_package = "com.google.cloud.documentai.v1beta3"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; -option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; - -// 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; - } - - // A revision of the evaluation. - message EvaluationRevision { - // Output only. The revision ID of the evaluation. - string revision_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Counters for the documents used in the evaluation. - Counters document_counters = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Metrics for all the entities in aggregate. - MultiConfidenceMetrics all_entities_metrics = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Metrics across confidence levels, for different entities. - map entity_metrics = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // 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; - - // Contains all revisions of the evaluation, excluding the latest one. - repeated EvaluationRevision revisions = 9; -} diff --git a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.proto deleted file mode 100644 index 3febecc8f97..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.proto +++ /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 -// -// 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.v1beta3; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; -option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "GeometryProto"; -option java_package = "com.google.cloud.documentai.v1beta3"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; -option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; - -// 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-documentai/protos/google/cloud/documentai/v1beta3/operation_metadata.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/operation_metadata.proto deleted file mode 100644 index 1d6fa007ae1..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/operation_metadata.proto +++ /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 -// -// 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.v1beta3; - -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; -option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "OperationMetadataProto"; -option java_package = "com.google.cloud.documentai.v1beta3"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; -option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; - -// 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-documentai/protos/google/cloud/documentai/v1beta3/processor.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto deleted file mode 100644 index 36d95318cf3..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto +++ /dev/null @@ -1,297 +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.v1beta3; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/documentai/v1beta3/document_schema.proto"; -import "google/cloud/documentai/v1beta3/evaluation.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; -option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentAiProcessor"; -option java_package = "com.google.cloud.documentai.v1beta3"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; -option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; - -// 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 fine tuning is allowed for this base processor version. - bool finetuning_allowed = 1; - - // The minimum number of labeled documents in the training dataset - // required for fine tuning. - 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.v1beta3.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-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto b/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto deleted file mode 100644 index 5ca013e43e9..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto +++ /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 -// -// 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.v1beta3; - -import "google/api/launch_stage.proto"; -import "google/api/resource.proto"; - -option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; -option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; -option java_multiple_files = true; -option java_outer_classname = "DocumentAiProcessorType"; -option java_package = "com.google.cloud.documentai.v1beta3"; -option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; -option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; - -// 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-documentai/protos/protos.d.ts b/owl-bot-staging/google-cloud-documentai/protos/protos.d.ts deleted file mode 100644 index 9f1f13615f2..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/protos.d.ts +++ /dev/null @@ -1,49693 +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 documentai. */ - namespace documentai { - - /** Namespace v1. */ - namespace v1 { - - /** 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 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 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; - } - - /** Properties of a RawDocument. */ - interface IRawDocument { - - /** RawDocument content */ - content?: (Uint8Array|Buffer|string|null); - - /** RawDocument mimeType */ - mimeType?: (string|null); - - /** RawDocument displayName */ - displayName?: (string|null); - } - - /** Represents a RawDocument. */ - class RawDocument implements IRawDocument { - - /** - * Constructs a new RawDocument. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IRawDocument); - - /** RawDocument content. */ - public content: (Uint8Array|Buffer|string); - - /** RawDocument mimeType. */ - public mimeType: string; - - /** RawDocument displayName. */ - public displayName: string; - - /** - * Creates a new RawDocument instance using the specified properties. - * @param [properties] Properties to set - * @returns RawDocument instance - */ - public static create(properties?: google.cloud.documentai.v1.IRawDocument): google.cloud.documentai.v1.RawDocument; - - /** - * Encodes the specified RawDocument message. Does not implicitly {@link google.cloud.documentai.v1.RawDocument.verify|verify} messages. - * @param message RawDocument message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IRawDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RawDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.RawDocument.verify|verify} messages. - * @param message RawDocument message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IRawDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RawDocument message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RawDocument - * @throws {Error} If the payload is not a 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.RawDocument; - - /** - * Decodes a RawDocument message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RawDocument - * @throws {Error} If the payload is 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.RawDocument; - - /** - * Verifies a RawDocument message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RawDocument message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RawDocument - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.RawDocument; - - /** - * Creates a plain object from a RawDocument message. Also converts values to other types if specified. - * @param message RawDocument - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.RawDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RawDocument to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RawDocument - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GcsDocument. */ - interface IGcsDocument { - - /** GcsDocument gcsUri */ - gcsUri?: (string|null); - - /** GcsDocument mimeType */ - mimeType?: (string|null); - } - - /** Represents a GcsDocument. */ - class GcsDocument implements IGcsDocument { - - /** - * Constructs a new GcsDocument. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IGcsDocument); - - /** GcsDocument gcsUri. */ - public gcsUri: string; - - /** GcsDocument mimeType. */ - public mimeType: string; - - /** - * Creates a new GcsDocument instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsDocument instance - */ - public static create(properties?: google.cloud.documentai.v1.IGcsDocument): google.cloud.documentai.v1.GcsDocument; - - /** - * Encodes the specified GcsDocument message. Does not implicitly {@link google.cloud.documentai.v1.GcsDocument.verify|verify} messages. - * @param message GcsDocument message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IGcsDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GcsDocument.verify|verify} messages. - * @param message GcsDocument message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IGcsDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsDocument message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsDocument - * @throws {Error} If the payload is not a 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.GcsDocument; - - /** - * Decodes a GcsDocument message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsDocument - * @throws {Error} If the payload is 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.GcsDocument; - - /** - * Verifies a GcsDocument message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcsDocument message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsDocument - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GcsDocument; - - /** - * Creates a plain object from a GcsDocument message. Also converts values to other types if specified. - * @param message GcsDocument - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.GcsDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsDocument to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsDocument - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GcsDocuments. */ - interface IGcsDocuments { - - /** GcsDocuments documents */ - documents?: (google.cloud.documentai.v1.IGcsDocument[]|null); - } - - /** Represents a GcsDocuments. */ - class GcsDocuments implements IGcsDocuments { - - /** - * Constructs a new GcsDocuments. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IGcsDocuments); - - /** GcsDocuments documents. */ - public documents: google.cloud.documentai.v1.IGcsDocument[]; - - /** - * Creates a new GcsDocuments instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsDocuments instance - */ - public static create(properties?: google.cloud.documentai.v1.IGcsDocuments): google.cloud.documentai.v1.GcsDocuments; - - /** - * Encodes the specified GcsDocuments message. Does not implicitly {@link google.cloud.documentai.v1.GcsDocuments.verify|verify} messages. - * @param message GcsDocuments message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IGcsDocuments, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GcsDocuments.verify|verify} messages. - * @param message GcsDocuments message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IGcsDocuments, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsDocuments message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsDocuments - * @throws {Error} If the payload is not a 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.GcsDocuments; - - /** - * Decodes a GcsDocuments message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsDocuments - * @throws {Error} If the payload is 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.GcsDocuments; - - /** - * Verifies a GcsDocuments message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcsDocuments message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsDocuments - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GcsDocuments; - - /** - * Creates a plain object from a GcsDocuments message. Also converts values to other types if specified. - * @param message GcsDocuments - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.GcsDocuments, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsDocuments to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsDocuments - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GcsPrefix. */ - interface IGcsPrefix { - - /** GcsPrefix gcsUriPrefix */ - gcsUriPrefix?: (string|null); - } - - /** Represents a GcsPrefix. */ - class GcsPrefix implements IGcsPrefix { - - /** - * Constructs a new GcsPrefix. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IGcsPrefix); - - /** GcsPrefix gcsUriPrefix. */ - public gcsUriPrefix: string; - - /** - * Creates a new GcsPrefix instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsPrefix instance - */ - public static create(properties?: google.cloud.documentai.v1.IGcsPrefix): google.cloud.documentai.v1.GcsPrefix; - - /** - * Encodes the specified GcsPrefix message. Does not implicitly {@link google.cloud.documentai.v1.GcsPrefix.verify|verify} messages. - * @param message GcsPrefix message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IGcsPrefix, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsPrefix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GcsPrefix.verify|verify} messages. - * @param message GcsPrefix message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IGcsPrefix, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsPrefix message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsPrefix - * @throws {Error} If the payload is not a 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.GcsPrefix; - - /** - * Decodes a GcsPrefix message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsPrefix - * @throws {Error} If the payload is 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.GcsPrefix; - - /** - * Verifies a GcsPrefix message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcsPrefix message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsPrefix - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GcsPrefix; - - /** - * Creates a plain object from a GcsPrefix message. Also converts values to other types if specified. - * @param message GcsPrefix - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.GcsPrefix, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsPrefix to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsPrefix - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchDocumentsInputConfig. */ - interface IBatchDocumentsInputConfig { - - /** BatchDocumentsInputConfig gcsPrefix */ - gcsPrefix?: (google.cloud.documentai.v1.IGcsPrefix|null); - - /** BatchDocumentsInputConfig gcsDocuments */ - gcsDocuments?: (google.cloud.documentai.v1.IGcsDocuments|null); - } - - /** Represents a BatchDocumentsInputConfig. */ - class BatchDocumentsInputConfig implements IBatchDocumentsInputConfig { - - /** - * Constructs a new BatchDocumentsInputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IBatchDocumentsInputConfig); - - /** BatchDocumentsInputConfig gcsPrefix. */ - public gcsPrefix?: (google.cloud.documentai.v1.IGcsPrefix|null); - - /** BatchDocumentsInputConfig gcsDocuments. */ - public gcsDocuments?: (google.cloud.documentai.v1.IGcsDocuments|null); - - /** BatchDocumentsInputConfig source. */ - public source?: ("gcsPrefix"|"gcsDocuments"); - - /** - * Creates a new BatchDocumentsInputConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDocumentsInputConfig instance - */ - public static create(properties?: google.cloud.documentai.v1.IBatchDocumentsInputConfig): google.cloud.documentai.v1.BatchDocumentsInputConfig; - - /** - * Encodes the specified BatchDocumentsInputConfig message. Does not implicitly {@link google.cloud.documentai.v1.BatchDocumentsInputConfig.verify|verify} messages. - * @param message BatchDocumentsInputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IBatchDocumentsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchDocumentsInputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchDocumentsInputConfig.verify|verify} messages. - * @param message BatchDocumentsInputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IBatchDocumentsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDocumentsInputConfig - * @throws {Error} If the payload is not a 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.BatchDocumentsInputConfig; - - /** - * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDocumentsInputConfig - * @throws {Error} If the payload is 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.BatchDocumentsInputConfig; - - /** - * Verifies a BatchDocumentsInputConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchDocumentsInputConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDocumentsInputConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.BatchDocumentsInputConfig; - - /** - * Creates a plain object from a BatchDocumentsInputConfig message. Also converts values to other types if specified. - * @param message BatchDocumentsInputConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.BatchDocumentsInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchDocumentsInputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchDocumentsInputConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DocumentOutputConfig. */ - interface IDocumentOutputConfig { - - /** DocumentOutputConfig gcsOutputConfig */ - gcsOutputConfig?: (google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig|null); - } - - /** Represents a DocumentOutputConfig. */ - class DocumentOutputConfig implements IDocumentOutputConfig { - - /** - * Constructs a new DocumentOutputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDocumentOutputConfig); - - /** DocumentOutputConfig gcsOutputConfig. */ - public gcsOutputConfig?: (google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig|null); - - /** DocumentOutputConfig destination. */ - public destination?: "gcsOutputConfig"; - - /** - * Creates a new DocumentOutputConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentOutputConfig instance - */ - public static create(properties?: google.cloud.documentai.v1.IDocumentOutputConfig): google.cloud.documentai.v1.DocumentOutputConfig; - - /** - * Encodes the specified DocumentOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.verify|verify} messages. - * @param message DocumentOutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.verify|verify} messages. - * @param message DocumentOutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DocumentOutputConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DocumentOutputConfig - * @throws {Error} If the payload is not a 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.DocumentOutputConfig; - - /** - * Decodes a DocumentOutputConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DocumentOutputConfig - * @throws {Error} If the payload is 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.DocumentOutputConfig; - - /** - * Verifies a DocumentOutputConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DocumentOutputConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentOutputConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DocumentOutputConfig; - - /** - * Creates a plain object from a DocumentOutputConfig message. Also converts values to other types if specified. - * @param message DocumentOutputConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DocumentOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentOutputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DocumentOutputConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DocumentOutputConfig { - - /** Properties of a GcsOutputConfig. */ - interface IGcsOutputConfig { - - /** GcsOutputConfig gcsUri */ - gcsUri?: (string|null); - - /** GcsOutputConfig fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - - /** GcsOutputConfig shardingConfig */ - shardingConfig?: (google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null); - } - - /** Represents a GcsOutputConfig. */ - class GcsOutputConfig implements IGcsOutputConfig { - - /** - * Constructs a new GcsOutputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig); - - /** GcsOutputConfig gcsUri. */ - public gcsUri: string; - - /** GcsOutputConfig fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** GcsOutputConfig shardingConfig. */ - public shardingConfig?: (google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null); - - /** - * Creates a new GcsOutputConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsOutputConfig instance - */ - public static create(properties?: google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig): google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig; - - /** - * Encodes the specified GcsOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. - * @param message GcsOutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. - * @param message GcsOutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsOutputConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsOutputConfig - * @throws {Error} If the payload is not a 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.DocumentOutputConfig.GcsOutputConfig; - - /** - * Decodes a GcsOutputConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsOutputConfig - * @throws {Error} If the payload is 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.DocumentOutputConfig.GcsOutputConfig; - - /** - * Verifies a GcsOutputConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcsOutputConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsOutputConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig; - - /** - * Creates a plain object from a GcsOutputConfig message. Also converts values to other types if specified. - * @param message GcsOutputConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsOutputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsOutputConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GcsOutputConfig { - - /** Properties of a ShardingConfig. */ - interface IShardingConfig { - - /** ShardingConfig pagesPerShard */ - pagesPerShard?: (number|null); - - /** ShardingConfig pagesOverlap */ - pagesOverlap?: (number|null); - } - - /** Represents a ShardingConfig. */ - class ShardingConfig implements IShardingConfig { - - /** - * Constructs a new ShardingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig); - - /** ShardingConfig pagesPerShard. */ - public pagesPerShard: number; - - /** ShardingConfig pagesOverlap. */ - public pagesOverlap: number; - - /** - * Creates a new ShardingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ShardingConfig instance - */ - public static create(properties?: google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig): google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; - - /** - * Encodes the specified ShardingConfig message. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. - * @param message ShardingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ShardingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. - * @param message ShardingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ShardingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ShardingConfig - * @throws {Error} If the payload is not a 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.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; - - /** - * Decodes a ShardingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ShardingConfig - * @throws {Error} If the payload is 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.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; - - /** - * Verifies a ShardingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ShardingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ShardingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; - - /** - * Creates a plain object from a ShardingConfig message. Also converts values to other types if specified. - * @param message ShardingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ShardingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ShardingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of an OcrConfig. */ - interface IOcrConfig { - - /** OcrConfig hints */ - hints?: (google.cloud.documentai.v1.OcrConfig.IHints|null); - - /** OcrConfig enableNativePdfParsing */ - enableNativePdfParsing?: (boolean|null); - - /** OcrConfig enableImageQualityScores */ - enableImageQualityScores?: (boolean|null); - - /** OcrConfig advancedOcrOptions */ - advancedOcrOptions?: (string[]|null); - - /** OcrConfig enableSymbol */ - enableSymbol?: (boolean|null); - - /** OcrConfig computeStyleInfo */ - computeStyleInfo?: (boolean|null); - - /** OcrConfig disableCharacterBoxesDetection */ - disableCharacterBoxesDetection?: (boolean|null); - - /** OcrConfig premiumFeatures */ - premiumFeatures?: (google.cloud.documentai.v1.OcrConfig.IPremiumFeatures|null); - } - - /** Represents an OcrConfig. */ - class OcrConfig implements IOcrConfig { - - /** - * Constructs a new OcrConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IOcrConfig); - - /** OcrConfig hints. */ - public hints?: (google.cloud.documentai.v1.OcrConfig.IHints|null); - - /** OcrConfig enableNativePdfParsing. */ - public enableNativePdfParsing: boolean; - - /** OcrConfig enableImageQualityScores. */ - public enableImageQualityScores: boolean; - - /** OcrConfig advancedOcrOptions. */ - public advancedOcrOptions: string[]; - - /** OcrConfig enableSymbol. */ - public enableSymbol: boolean; - - /** OcrConfig computeStyleInfo. */ - public computeStyleInfo: boolean; - - /** OcrConfig disableCharacterBoxesDetection. */ - public disableCharacterBoxesDetection: boolean; - - /** OcrConfig premiumFeatures. */ - public premiumFeatures?: (google.cloud.documentai.v1.OcrConfig.IPremiumFeatures|null); - - /** - * Creates a new OcrConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns OcrConfig instance - */ - public static create(properties?: google.cloud.documentai.v1.IOcrConfig): google.cloud.documentai.v1.OcrConfig; - - /** - * Encodes the specified OcrConfig message. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.verify|verify} messages. - * @param message OcrConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IOcrConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OcrConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.verify|verify} messages. - * @param message OcrConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IOcrConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OcrConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OcrConfig - * @throws {Error} If the payload is not a 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.OcrConfig; - - /** - * Decodes an OcrConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OcrConfig - * @throws {Error} If the payload is 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.OcrConfig; - - /** - * Verifies an OcrConfig message. - * @param message Plain 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 OcrConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OcrConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.OcrConfig; - - /** - * Creates a plain object from an OcrConfig message. Also converts values to other types if specified. - * @param message OcrConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.OcrConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OcrConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OcrConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace OcrConfig { - - /** Properties of a Hints. */ - interface IHints { - - /** Hints languageHints */ - languageHints?: (string[]|null); - } - - /** Represents a Hints. */ - class Hints implements IHints { - - /** - * Constructs a new Hints. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.OcrConfig.IHints); - - /** Hints languageHints. */ - public languageHints: string[]; - - /** - * Creates a new Hints instance using the specified properties. - * @param [properties] Properties to set - * @returns Hints instance - */ - public static create(properties?: google.cloud.documentai.v1.OcrConfig.IHints): google.cloud.documentai.v1.OcrConfig.Hints; - - /** - * Encodes the specified Hints message. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.Hints.verify|verify} messages. - * @param message Hints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.OcrConfig.IHints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Hints message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.Hints.verify|verify} messages. - * @param message Hints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.OcrConfig.IHints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Hints message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Hints - * @throws {Error} If the payload is not a 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.OcrConfig.Hints; - - /** - * Decodes a Hints message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Hints - * @throws {Error} If the payload is 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.OcrConfig.Hints; - - /** - * Verifies a Hints message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Hints message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Hints - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.OcrConfig.Hints; - - /** - * Creates a plain object from a Hints message. Also converts values to other types if specified. - * @param message Hints - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.OcrConfig.Hints, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Hints to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Hints - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PremiumFeatures. */ - interface IPremiumFeatures { - - /** PremiumFeatures enableSelectionMarkDetection */ - enableSelectionMarkDetection?: (boolean|null); - - /** PremiumFeatures computeStyleInfo */ - computeStyleInfo?: (boolean|null); - - /** PremiumFeatures enableMathOcr */ - enableMathOcr?: (boolean|null); - } - - /** Represents a PremiumFeatures. */ - class PremiumFeatures implements IPremiumFeatures { - - /** - * Constructs a new PremiumFeatures. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.OcrConfig.IPremiumFeatures); - - /** PremiumFeatures enableSelectionMarkDetection. */ - public enableSelectionMarkDetection: boolean; - - /** PremiumFeatures computeStyleInfo. */ - public computeStyleInfo: boolean; - - /** PremiumFeatures enableMathOcr. */ - public enableMathOcr: boolean; - - /** - * Creates a new PremiumFeatures instance using the specified properties. - * @param [properties] Properties to set - * @returns PremiumFeatures instance - */ - public static create(properties?: google.cloud.documentai.v1.OcrConfig.IPremiumFeatures): google.cloud.documentai.v1.OcrConfig.PremiumFeatures; - - /** - * Encodes the specified PremiumFeatures message. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.PremiumFeatures.verify|verify} messages. - * @param message PremiumFeatures message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.OcrConfig.IPremiumFeatures, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PremiumFeatures message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.PremiumFeatures.verify|verify} messages. - * @param message PremiumFeatures message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.OcrConfig.IPremiumFeatures, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PremiumFeatures message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PremiumFeatures - * @throws {Error} If the payload is not a 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.OcrConfig.PremiumFeatures; - - /** - * Decodes a PremiumFeatures message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PremiumFeatures - * @throws {Error} If the payload is 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.OcrConfig.PremiumFeatures; - - /** - * Verifies a PremiumFeatures message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PremiumFeatures message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PremiumFeatures - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.OcrConfig.PremiumFeatures; - - /** - * Creates a plain object from a PremiumFeatures message. Also converts values to other types if specified. - * @param message PremiumFeatures - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.OcrConfig.PremiumFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PremiumFeatures to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PremiumFeatures - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Represents a DocumentProcessorService */ - class DocumentProcessorService extends $protobuf.rpc.Service { - - /** - * Constructs a new DocumentProcessorService 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 DocumentProcessorService 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): DocumentProcessorService; - - /** - * Calls ProcessDocument. - * @param request ProcessRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ProcessResponse - */ - public processDocument(request: google.cloud.documentai.v1.IProcessRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.ProcessDocumentCallback): void; - - /** - * Calls ProcessDocument. - * @param request ProcessRequest message or plain object - * @returns Promise - */ - public processDocument(request: google.cloud.documentai.v1.IProcessRequest): Promise; - - /** - * Calls BatchProcessDocuments. - * @param request BatchProcessRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchProcessDocuments(request: google.cloud.documentai.v1.IBatchProcessRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocumentsCallback): void; - - /** - * Calls BatchProcessDocuments. - * @param request BatchProcessRequest message or plain object - * @returns Promise - */ - public batchProcessDocuments(request: google.cloud.documentai.v1.IBatchProcessRequest): Promise; - - /** - * Calls FetchProcessorTypes. - * @param request FetchProcessorTypesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FetchProcessorTypesResponse - */ - public fetchProcessorTypes(request: google.cloud.documentai.v1.IFetchProcessorTypesRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypesCallback): void; - - /** - * Calls FetchProcessorTypes. - * @param request FetchProcessorTypesRequest message or plain object - * @returns Promise - */ - public fetchProcessorTypes(request: google.cloud.documentai.v1.IFetchProcessorTypesRequest): Promise; - - /** - * Calls ListProcessorTypes. - * @param request ListProcessorTypesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListProcessorTypesResponse - */ - public listProcessorTypes(request: google.cloud.documentai.v1.IListProcessorTypesRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypesCallback): void; - - /** - * Calls ListProcessorTypes. - * @param request ListProcessorTypesRequest message or plain object - * @returns Promise - */ - public listProcessorTypes(request: google.cloud.documentai.v1.IListProcessorTypesRequest): Promise; - - /** - * Calls GetProcessorType. - * @param request GetProcessorTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ProcessorType - */ - public getProcessorType(request: google.cloud.documentai.v1.IGetProcessorTypeRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.GetProcessorTypeCallback): void; - - /** - * Calls GetProcessorType. - * @param request GetProcessorTypeRequest message or plain object - * @returns Promise - */ - public getProcessorType(request: google.cloud.documentai.v1.IGetProcessorTypeRequest): Promise; - - /** - * Calls ListProcessors. - * @param request ListProcessorsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListProcessorsResponse - */ - public listProcessors(request: google.cloud.documentai.v1.IListProcessorsRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.ListProcessorsCallback): void; - - /** - * Calls ListProcessors. - * @param request ListProcessorsRequest message or plain object - * @returns Promise - */ - public listProcessors(request: google.cloud.documentai.v1.IListProcessorsRequest): Promise; - - /** - * Calls GetProcessor. - * @param request GetProcessorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Processor - */ - public getProcessor(request: google.cloud.documentai.v1.IGetProcessorRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.GetProcessorCallback): void; - - /** - * Calls GetProcessor. - * @param request GetProcessorRequest message or plain object - * @returns Promise - */ - public getProcessor(request: google.cloud.documentai.v1.IGetProcessorRequest): Promise; - - /** - * Calls TrainProcessorVersion. - * @param request TrainProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public trainProcessorVersion(request: google.cloud.documentai.v1.ITrainProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersionCallback): void; - - /** - * Calls TrainProcessorVersion. - * @param request TrainProcessorVersionRequest message or plain object - * @returns Promise - */ - public trainProcessorVersion(request: google.cloud.documentai.v1.ITrainProcessorVersionRequest): Promise; - - /** - * Calls GetProcessorVersion. - * @param request GetProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ProcessorVersion - */ - public getProcessorVersion(request: google.cloud.documentai.v1.IGetProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersionCallback): void; - - /** - * Calls GetProcessorVersion. - * @param request GetProcessorVersionRequest message or plain object - * @returns Promise - */ - public getProcessorVersion(request: google.cloud.documentai.v1.IGetProcessorVersionRequest): Promise; - - /** - * Calls ListProcessorVersions. - * @param request ListProcessorVersionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListProcessorVersionsResponse - */ - public listProcessorVersions(request: google.cloud.documentai.v1.IListProcessorVersionsRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersionsCallback): void; - - /** - * Calls ListProcessorVersions. - * @param request ListProcessorVersionsRequest message or plain object - * @returns Promise - */ - public listProcessorVersions(request: google.cloud.documentai.v1.IListProcessorVersionsRequest): Promise; - - /** - * Calls DeleteProcessorVersion. - * @param request DeleteProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteProcessorVersion(request: google.cloud.documentai.v1.IDeleteProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersionCallback): void; - - /** - * Calls DeleteProcessorVersion. - * @param request DeleteProcessorVersionRequest message or plain object - * @returns Promise - */ - public deleteProcessorVersion(request: google.cloud.documentai.v1.IDeleteProcessorVersionRequest): Promise; - - /** - * Calls DeployProcessorVersion. - * @param request DeployProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deployProcessorVersion(request: google.cloud.documentai.v1.IDeployProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersionCallback): void; - - /** - * Calls DeployProcessorVersion. - * @param request DeployProcessorVersionRequest message or plain object - * @returns Promise - */ - public deployProcessorVersion(request: google.cloud.documentai.v1.IDeployProcessorVersionRequest): Promise; - - /** - * Calls UndeployProcessorVersion. - * @param request UndeployProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public undeployProcessorVersion(request: google.cloud.documentai.v1.IUndeployProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersionCallback): void; - - /** - * Calls UndeployProcessorVersion. - * @param request UndeployProcessorVersionRequest message or plain object - * @returns Promise - */ - public undeployProcessorVersion(request: google.cloud.documentai.v1.IUndeployProcessorVersionRequest): Promise; - - /** - * Calls CreateProcessor. - * @param request CreateProcessorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Processor - */ - public createProcessor(request: google.cloud.documentai.v1.ICreateProcessorRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.CreateProcessorCallback): void; - - /** - * Calls CreateProcessor. - * @param request CreateProcessorRequest message or plain object - * @returns Promise - */ - public createProcessor(request: google.cloud.documentai.v1.ICreateProcessorRequest): Promise; - - /** - * Calls DeleteProcessor. - * @param request DeleteProcessorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteProcessor(request: google.cloud.documentai.v1.IDeleteProcessorRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorCallback): void; - - /** - * Calls DeleteProcessor. - * @param request DeleteProcessorRequest message or plain object - * @returns Promise - */ - public deleteProcessor(request: google.cloud.documentai.v1.IDeleteProcessorRequest): Promise; - - /** - * Calls EnableProcessor. - * @param request EnableProcessorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public enableProcessor(request: google.cloud.documentai.v1.IEnableProcessorRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.EnableProcessorCallback): void; - - /** - * Calls EnableProcessor. - * @param request EnableProcessorRequest message or plain object - * @returns Promise - */ - public enableProcessor(request: google.cloud.documentai.v1.IEnableProcessorRequest): Promise; - - /** - * Calls DisableProcessor. - * @param request DisableProcessorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public disableProcessor(request: google.cloud.documentai.v1.IDisableProcessorRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.DisableProcessorCallback): void; - - /** - * Calls DisableProcessor. - * @param request DisableProcessorRequest message or plain object - * @returns Promise - */ - public disableProcessor(request: google.cloud.documentai.v1.IDisableProcessorRequest): Promise; - - /** - * Calls SetDefaultProcessorVersion. - * @param request SetDefaultProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public setDefaultProcessorVersion(request: google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersionCallback): void; - - /** - * Calls SetDefaultProcessorVersion. - * @param request SetDefaultProcessorVersionRequest message or plain object - * @returns Promise - */ - public setDefaultProcessorVersion(request: google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest): Promise; - - /** - * Calls ReviewDocument. - * @param request ReviewDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public reviewDocument(request: google.cloud.documentai.v1.IReviewDocumentRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.ReviewDocumentCallback): void; - - /** - * Calls ReviewDocument. - * @param request ReviewDocumentRequest message or plain object - * @returns Promise - */ - public reviewDocument(request: google.cloud.documentai.v1.IReviewDocumentRequest): Promise; - - /** - * Calls EvaluateProcessorVersion. - * @param request EvaluateProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public evaluateProcessorVersion(request: google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersionCallback): void; - - /** - * Calls EvaluateProcessorVersion. - * @param request EvaluateProcessorVersionRequest message or plain object - * @returns Promise - */ - public evaluateProcessorVersion(request: google.cloud.documentai.v1.IEvaluateProcessorVersionRequest): Promise; - - /** - * Calls GetEvaluation. - * @param request GetEvaluationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Evaluation - */ - public getEvaluation(request: google.cloud.documentai.v1.IGetEvaluationRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.GetEvaluationCallback): void; - - /** - * Calls GetEvaluation. - * @param request GetEvaluationRequest message or plain object - * @returns Promise - */ - public getEvaluation(request: google.cloud.documentai.v1.IGetEvaluationRequest): Promise; - - /** - * Calls ListEvaluations. - * @param request ListEvaluationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEvaluationsResponse - */ - public listEvaluations(request: google.cloud.documentai.v1.IListEvaluationsRequest, callback: google.cloud.documentai.v1.DocumentProcessorService.ListEvaluationsCallback): void; - - /** - * Calls ListEvaluations. - * @param request ListEvaluationsRequest message or plain object - * @returns Promise - */ - public listEvaluations(request: google.cloud.documentai.v1.IListEvaluationsRequest): Promise; - } - - namespace DocumentProcessorService { - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|processDocument}. - * @param error Error, if any - * @param [response] ProcessResponse - */ - type ProcessDocumentCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ProcessResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|batchProcessDocuments}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchProcessDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|fetchProcessorTypes}. - * @param error Error, if any - * @param [response] FetchProcessorTypesResponse - */ - type FetchProcessorTypesCallback = (error: (Error|null), response?: google.cloud.documentai.v1.FetchProcessorTypesResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listProcessorTypes}. - * @param error Error, if any - * @param [response] ListProcessorTypesResponse - */ - type ListProcessorTypesCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ListProcessorTypesResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getProcessorType}. - * @param error Error, if any - * @param [response] ProcessorType - */ - type GetProcessorTypeCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ProcessorType) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listProcessors}. - * @param error Error, if any - * @param [response] ListProcessorsResponse - */ - type ListProcessorsCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ListProcessorsResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getProcessor}. - * @param error Error, if any - * @param [response] Processor - */ - type GetProcessorCallback = (error: (Error|null), response?: google.cloud.documentai.v1.Processor) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|trainProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type TrainProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getProcessorVersion}. - * @param error Error, if any - * @param [response] ProcessorVersion - */ - type GetProcessorVersionCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ProcessorVersion) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listProcessorVersions}. - * @param error Error, if any - * @param [response] ListProcessorVersionsResponse - */ - type ListProcessorVersionsCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ListProcessorVersionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|deleteProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|deployProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type DeployProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|undeployProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type UndeployProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|createProcessor}. - * @param error Error, if any - * @param [response] Processor - */ - type CreateProcessorCallback = (error: (Error|null), response?: google.cloud.documentai.v1.Processor) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|deleteProcessor}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|enableProcessor}. - * @param error Error, if any - * @param [response] Operation - */ - type EnableProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|disableProcessor}. - * @param error Error, if any - * @param [response] Operation - */ - type DisableProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|setDefaultProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type SetDefaultProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|reviewDocument}. - * @param error Error, if any - * @param [response] Operation - */ - type ReviewDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|evaluateProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type EvaluateProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getEvaluation}. - * @param error Error, if any - * @param [response] Evaluation - */ - type GetEvaluationCallback = (error: (Error|null), response?: google.cloud.documentai.v1.Evaluation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listEvaluations}. - * @param error Error, if any - * @param [response] ListEvaluationsResponse - */ - type ListEvaluationsCallback = (error: (Error|null), response?: google.cloud.documentai.v1.ListEvaluationsResponse) => void; - } - - /** Properties of a ProcessOptions. */ - interface IProcessOptions { - - /** ProcessOptions individualPageSelector */ - individualPageSelector?: (google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector|null); - - /** ProcessOptions fromStart */ - fromStart?: (number|null); - - /** ProcessOptions fromEnd */ - fromEnd?: (number|null); - - /** ProcessOptions ocrConfig */ - ocrConfig?: (google.cloud.documentai.v1.IOcrConfig|null); - - /** ProcessOptions layoutConfig */ - layoutConfig?: (google.cloud.documentai.v1.ProcessOptions.ILayoutConfig|null); - - /** ProcessOptions schemaOverride */ - schemaOverride?: (google.cloud.documentai.v1.IDocumentSchema|null); - } - - /** Represents a ProcessOptions. */ - class ProcessOptions implements IProcessOptions { - - /** - * Constructs a new ProcessOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IProcessOptions); - - /** ProcessOptions individualPageSelector. */ - public individualPageSelector?: (google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector|null); - - /** ProcessOptions fromStart. */ - public fromStart?: (number|null); - - /** ProcessOptions fromEnd. */ - public fromEnd?: (number|null); - - /** ProcessOptions ocrConfig. */ - public ocrConfig?: (google.cloud.documentai.v1.IOcrConfig|null); - - /** ProcessOptions layoutConfig. */ - public layoutConfig?: (google.cloud.documentai.v1.ProcessOptions.ILayoutConfig|null); - - /** ProcessOptions schemaOverride. */ - public schemaOverride?: (google.cloud.documentai.v1.IDocumentSchema|null); - - /** ProcessOptions pageRange. */ - public pageRange?: ("individualPageSelector"|"fromStart"|"fromEnd"); - - /** - * Creates a new ProcessOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessOptions instance - */ - public static create(properties?: google.cloud.documentai.v1.IProcessOptions): google.cloud.documentai.v1.ProcessOptions; - - /** - * Encodes the specified ProcessOptions message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.verify|verify} messages. - * @param message ProcessOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IProcessOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.verify|verify} messages. - * @param message ProcessOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IProcessOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessOptions - * @throws {Error} If the payload is not a 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.ProcessOptions; - - /** - * Decodes a ProcessOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessOptions - * @throws {Error} If the payload is 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.ProcessOptions; - - /** - * Verifies a ProcessOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProcessOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessOptions; - - /** - * Creates a plain object from a ProcessOptions message. Also converts values to other types if specified. - * @param message ProcessOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ProcessOptions { - - /** Properties of a LayoutConfig. */ - interface ILayoutConfig { - - /** LayoutConfig chunkingConfig */ - chunkingConfig?: (google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig|null); - - /** LayoutConfig returnImages */ - returnImages?: (boolean|null); - - /** LayoutConfig returnBoundingBoxes */ - returnBoundingBoxes?: (boolean|null); - } - - /** Represents a LayoutConfig. */ - class LayoutConfig implements ILayoutConfig { - - /** - * Constructs a new LayoutConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ProcessOptions.ILayoutConfig); - - /** LayoutConfig chunkingConfig. */ - public chunkingConfig?: (google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig|null); - - /** LayoutConfig returnImages. */ - public returnImages: boolean; - - /** LayoutConfig returnBoundingBoxes. */ - public returnBoundingBoxes: boolean; - - /** - * Creates a new LayoutConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns LayoutConfig instance - */ - public static create(properties?: google.cloud.documentai.v1.ProcessOptions.ILayoutConfig): google.cloud.documentai.v1.ProcessOptions.LayoutConfig; - - /** - * Encodes the specified LayoutConfig message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.verify|verify} messages. - * @param message LayoutConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ProcessOptions.ILayoutConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.verify|verify} messages. - * @param message LayoutConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ProcessOptions.ILayoutConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LayoutConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LayoutConfig - * @throws {Error} If the payload is not a 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.ProcessOptions.LayoutConfig; - - /** - * Decodes a LayoutConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LayoutConfig - * @throws {Error} If the payload is 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.ProcessOptions.LayoutConfig; - - /** - * Verifies a LayoutConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LayoutConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LayoutConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessOptions.LayoutConfig; - - /** - * Creates a plain object from a LayoutConfig message. Also converts values to other types if specified. - * @param message LayoutConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessOptions.LayoutConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LayoutConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LayoutConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LayoutConfig { - - /** Properties of a ChunkingConfig. */ - interface IChunkingConfig { - - /** ChunkingConfig chunkSize */ - chunkSize?: (number|null); - - /** ChunkingConfig includeAncestorHeadings */ - includeAncestorHeadings?: (boolean|null); - } - - /** Represents a ChunkingConfig. */ - class ChunkingConfig implements IChunkingConfig { - - /** - * Constructs a new ChunkingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig); - - /** ChunkingConfig chunkSize. */ - public chunkSize: number; - - /** ChunkingConfig includeAncestorHeadings. */ - public includeAncestorHeadings: boolean; - - /** - * Creates a new ChunkingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ChunkingConfig instance - */ - public static create(properties?: google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig): google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig; - - /** - * Encodes the specified ChunkingConfig message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. - * @param message ChunkingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChunkingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. - * @param message ChunkingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChunkingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChunkingConfig - * @throws {Error} If the payload is not a 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.ProcessOptions.LayoutConfig.ChunkingConfig; - - /** - * Decodes a ChunkingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChunkingConfig - * @throws {Error} If the payload is 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.ProcessOptions.LayoutConfig.ChunkingConfig; - - /** - * Verifies a ChunkingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChunkingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChunkingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig; - - /** - * Creates a plain object from a ChunkingConfig message. Also converts values to other types if specified. - * @param message ChunkingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChunkingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChunkingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an IndividualPageSelector. */ - interface IIndividualPageSelector { - - /** IndividualPageSelector pages */ - pages?: (number[]|null); - } - - /** Represents an IndividualPageSelector. */ - class IndividualPageSelector implements IIndividualPageSelector { - - /** - * Constructs a new IndividualPageSelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector); - - /** IndividualPageSelector pages. */ - public pages: number[]; - - /** - * Creates a new IndividualPageSelector instance using the specified properties. - * @param [properties] Properties to set - * @returns IndividualPageSelector instance - */ - public static create(properties?: google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector): google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector; - - /** - * Encodes the specified IndividualPageSelector message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.verify|verify} messages. - * @param message IndividualPageSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IndividualPageSelector message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.verify|verify} messages. - * @param message IndividualPageSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IndividualPageSelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndividualPageSelector - * @throws {Error} If the payload is not a 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.ProcessOptions.IndividualPageSelector; - - /** - * Decodes an IndividualPageSelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndividualPageSelector - * @throws {Error} If the payload is 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.ProcessOptions.IndividualPageSelector; - - /** - * Verifies an IndividualPageSelector message. - * @param message Plain 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 IndividualPageSelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndividualPageSelector - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector; - - /** - * Creates a plain object from an IndividualPageSelector message. Also converts values to other types if specified. - * @param message IndividualPageSelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndividualPageSelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IndividualPageSelector - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ProcessRequest. */ - interface IProcessRequest { - - /** ProcessRequest inlineDocument */ - inlineDocument?: (google.cloud.documentai.v1.IDocument|null); - - /** ProcessRequest rawDocument */ - rawDocument?: (google.cloud.documentai.v1.IRawDocument|null); - - /** ProcessRequest gcsDocument */ - gcsDocument?: (google.cloud.documentai.v1.IGcsDocument|null); - - /** ProcessRequest name */ - name?: (string|null); - - /** ProcessRequest skipHumanReview */ - skipHumanReview?: (boolean|null); - - /** ProcessRequest fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - - /** ProcessRequest processOptions */ - processOptions?: (google.cloud.documentai.v1.IProcessOptions|null); - - /** ProcessRequest labels */ - labels?: ({ [k: string]: string }|null); - - /** ProcessRequest imagelessMode */ - imagelessMode?: (boolean|null); - } - - /** Represents a ProcessRequest. */ - class ProcessRequest implements IProcessRequest { - - /** - * Constructs a new ProcessRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IProcessRequest); - - /** ProcessRequest inlineDocument. */ - public inlineDocument?: (google.cloud.documentai.v1.IDocument|null); - - /** ProcessRequest rawDocument. */ - public rawDocument?: (google.cloud.documentai.v1.IRawDocument|null); - - /** ProcessRequest gcsDocument. */ - public gcsDocument?: (google.cloud.documentai.v1.IGcsDocument|null); - - /** ProcessRequest name. */ - public name: string; - - /** ProcessRequest skipHumanReview. */ - public skipHumanReview: boolean; - - /** ProcessRequest fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** ProcessRequest processOptions. */ - public processOptions?: (google.cloud.documentai.v1.IProcessOptions|null); - - /** ProcessRequest labels. */ - public labels: { [k: string]: string }; - - /** ProcessRequest imagelessMode. */ - public imagelessMode: boolean; - - /** ProcessRequest source. */ - public source?: ("inlineDocument"|"rawDocument"|"gcsDocument"); - - /** - * Creates a new ProcessRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IProcessRequest): google.cloud.documentai.v1.ProcessRequest; - - /** - * Encodes the specified ProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1.ProcessRequest.verify|verify} messages. - * @param message ProcessRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessRequest.verify|verify} messages. - * @param message ProcessRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessRequest - * @throws {Error} If the payload is not a 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.ProcessRequest; - - /** - * Decodes a ProcessRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessRequest - * @throws {Error} If the payload is 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.ProcessRequest; - - /** - * Verifies a ProcessRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProcessRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessRequest; - - /** - * Creates a plain object from a ProcessRequest message. Also converts values to other types if specified. - * @param message ProcessRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HumanReviewStatus. */ - interface IHumanReviewStatus { - - /** HumanReviewStatus state */ - state?: (google.cloud.documentai.v1.HumanReviewStatus.State|keyof typeof google.cloud.documentai.v1.HumanReviewStatus.State|null); - - /** HumanReviewStatus stateMessage */ - stateMessage?: (string|null); - - /** HumanReviewStatus humanReviewOperation */ - humanReviewOperation?: (string|null); - } - - /** Represents a HumanReviewStatus. */ - class HumanReviewStatus implements IHumanReviewStatus { - - /** - * Constructs a new HumanReviewStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IHumanReviewStatus); - - /** HumanReviewStatus state. */ - public state: (google.cloud.documentai.v1.HumanReviewStatus.State|keyof typeof google.cloud.documentai.v1.HumanReviewStatus.State); - - /** HumanReviewStatus stateMessage. */ - public stateMessage: string; - - /** HumanReviewStatus humanReviewOperation. */ - public humanReviewOperation: string; - - /** - * Creates a new HumanReviewStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns HumanReviewStatus instance - */ - public static create(properties?: google.cloud.documentai.v1.IHumanReviewStatus): google.cloud.documentai.v1.HumanReviewStatus; - - /** - * Encodes the specified HumanReviewStatus message. Does not implicitly {@link google.cloud.documentai.v1.HumanReviewStatus.verify|verify} messages. - * @param message HumanReviewStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IHumanReviewStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HumanReviewStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.HumanReviewStatus.verify|verify} messages. - * @param message HumanReviewStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IHumanReviewStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HumanReviewStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HumanReviewStatus - * @throws {Error} If the payload is not a 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.HumanReviewStatus; - - /** - * Decodes a HumanReviewStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HumanReviewStatus - * @throws {Error} If the payload is 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.HumanReviewStatus; - - /** - * Verifies a HumanReviewStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HumanReviewStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HumanReviewStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.HumanReviewStatus; - - /** - * Creates a plain object from a HumanReviewStatus message. Also converts values to other types if specified. - * @param message HumanReviewStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.HumanReviewStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HumanReviewStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HumanReviewStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace HumanReviewStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - SKIPPED = 1, - VALIDATION_PASSED = 2, - IN_PROGRESS = 3, - ERROR = 4 - } - } - - /** Properties of a ProcessResponse. */ - interface IProcessResponse { - - /** ProcessResponse document */ - document?: (google.cloud.documentai.v1.IDocument|null); - - /** ProcessResponse humanReviewStatus */ - humanReviewStatus?: (google.cloud.documentai.v1.IHumanReviewStatus|null); - } - - /** Represents a ProcessResponse. */ - class ProcessResponse implements IProcessResponse { - - /** - * Constructs a new ProcessResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IProcessResponse); - - /** ProcessResponse document. */ - public document?: (google.cloud.documentai.v1.IDocument|null); - - /** ProcessResponse humanReviewStatus. */ - public humanReviewStatus?: (google.cloud.documentai.v1.IHumanReviewStatus|null); - - /** - * Creates a new ProcessResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IProcessResponse): google.cloud.documentai.v1.ProcessResponse; - - /** - * Encodes the specified ProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1.ProcessResponse.verify|verify} messages. - * @param message ProcessResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessResponse.verify|verify} messages. - * @param message ProcessResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessResponse - * @throws {Error} If the payload is not a 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.ProcessResponse; - - /** - * Decodes a ProcessResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessResponse - * @throws {Error} If the payload is 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.ProcessResponse; - - /** - * Verifies a ProcessResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProcessResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessResponse; - - /** - * Creates a plain object from a ProcessResponse message. Also converts values to other types if specified. - * @param message ProcessResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchProcessRequest. */ - interface IBatchProcessRequest { - - /** BatchProcessRequest name */ - name?: (string|null); - - /** BatchProcessRequest inputDocuments */ - inputDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); - - /** BatchProcessRequest documentOutputConfig */ - documentOutputConfig?: (google.cloud.documentai.v1.IDocumentOutputConfig|null); - - /** BatchProcessRequest skipHumanReview */ - skipHumanReview?: (boolean|null); - - /** BatchProcessRequest processOptions */ - processOptions?: (google.cloud.documentai.v1.IProcessOptions|null); - - /** BatchProcessRequest labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a BatchProcessRequest. */ - class BatchProcessRequest implements IBatchProcessRequest { - - /** - * Constructs a new BatchProcessRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IBatchProcessRequest); - - /** BatchProcessRequest name. */ - public name: string; - - /** BatchProcessRequest inputDocuments. */ - public inputDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); - - /** BatchProcessRequest documentOutputConfig. */ - public documentOutputConfig?: (google.cloud.documentai.v1.IDocumentOutputConfig|null); - - /** BatchProcessRequest skipHumanReview. */ - public skipHumanReview: boolean; - - /** BatchProcessRequest processOptions. */ - public processOptions?: (google.cloud.documentai.v1.IProcessOptions|null); - - /** BatchProcessRequest labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new BatchProcessRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchProcessRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IBatchProcessRequest): google.cloud.documentai.v1.BatchProcessRequest; - - /** - * Encodes the specified BatchProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessRequest.verify|verify} messages. - * @param message BatchProcessRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IBatchProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessRequest.verify|verify} messages. - * @param message BatchProcessRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IBatchProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchProcessRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchProcessRequest - * @throws {Error} If the payload is not a 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.BatchProcessRequest; - - /** - * Decodes a BatchProcessRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchProcessRequest - * @throws {Error} If the payload is 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.BatchProcessRequest; - - /** - * Verifies a BatchProcessRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchProcessRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchProcessRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.BatchProcessRequest; - - /** - * Creates a plain object from a BatchProcessRequest message. Also converts values to other types if specified. - * @param message BatchProcessRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.BatchProcessRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchProcessRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchProcessRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchProcessResponse. */ - interface IBatchProcessResponse { - } - - /** Represents a BatchProcessResponse. */ - class BatchProcessResponse implements IBatchProcessResponse { - - /** - * Constructs a new BatchProcessResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IBatchProcessResponse); - - /** - * Creates a new BatchProcessResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchProcessResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IBatchProcessResponse): google.cloud.documentai.v1.BatchProcessResponse; - - /** - * Encodes the specified BatchProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessResponse.verify|verify} messages. - * @param message BatchProcessResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IBatchProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessResponse.verify|verify} messages. - * @param message BatchProcessResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IBatchProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchProcessResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchProcessResponse - * @throws {Error} If the payload is not a 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.BatchProcessResponse; - - /** - * Decodes a BatchProcessResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchProcessResponse - * @throws {Error} If the payload is 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.BatchProcessResponse; - - /** - * Verifies a BatchProcessResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchProcessResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchProcessResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.BatchProcessResponse; - - /** - * Creates a plain object from a BatchProcessResponse message. Also converts values to other types if specified. - * @param message BatchProcessResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.BatchProcessResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchProcessResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchProcessResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchProcessMetadata. */ - interface IBatchProcessMetadata { - - /** BatchProcessMetadata state */ - state?: (google.cloud.documentai.v1.BatchProcessMetadata.State|keyof typeof google.cloud.documentai.v1.BatchProcessMetadata.State|null); - - /** BatchProcessMetadata stateMessage */ - stateMessage?: (string|null); - - /** BatchProcessMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** BatchProcessMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** BatchProcessMetadata individualProcessStatuses */ - individualProcessStatuses?: (google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus[]|null); - } - - /** Represents a BatchProcessMetadata. */ - class BatchProcessMetadata implements IBatchProcessMetadata { - - /** - * Constructs a new BatchProcessMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IBatchProcessMetadata); - - /** BatchProcessMetadata state. */ - public state: (google.cloud.documentai.v1.BatchProcessMetadata.State|keyof typeof google.cloud.documentai.v1.BatchProcessMetadata.State); - - /** BatchProcessMetadata stateMessage. */ - public stateMessage: string; - - /** BatchProcessMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** BatchProcessMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** BatchProcessMetadata individualProcessStatuses. */ - public individualProcessStatuses: google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus[]; - - /** - * Creates a new BatchProcessMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchProcessMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1.IBatchProcessMetadata): google.cloud.documentai.v1.BatchProcessMetadata; - - /** - * Encodes the specified BatchProcessMetadata message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.verify|verify} messages. - * @param message BatchProcessMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IBatchProcessMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchProcessMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.verify|verify} messages. - * @param message BatchProcessMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IBatchProcessMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchProcessMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchProcessMetadata - * @throws {Error} If the payload is not a 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.BatchProcessMetadata; - - /** - * Decodes a BatchProcessMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchProcessMetadata - * @throws {Error} If the payload is 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.BatchProcessMetadata; - - /** - * Verifies a BatchProcessMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchProcessMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchProcessMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.BatchProcessMetadata; - - /** - * Creates a plain object from a BatchProcessMetadata message. Also converts values to other types if specified. - * @param message BatchProcessMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.BatchProcessMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchProcessMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchProcessMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BatchProcessMetadata { - - /** Properties of an IndividualProcessStatus. */ - interface IIndividualProcessStatus { - - /** IndividualProcessStatus inputGcsSource */ - inputGcsSource?: (string|null); - - /** IndividualProcessStatus status */ - status?: (google.rpc.IStatus|null); - - /** IndividualProcessStatus outputGcsDestination */ - outputGcsDestination?: (string|null); - - /** IndividualProcessStatus humanReviewStatus */ - humanReviewStatus?: (google.cloud.documentai.v1.IHumanReviewStatus|null); - } - - /** Represents an IndividualProcessStatus. */ - class IndividualProcessStatus implements IIndividualProcessStatus { - - /** - * Constructs a new IndividualProcessStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus); - - /** IndividualProcessStatus inputGcsSource. */ - public inputGcsSource: string; - - /** IndividualProcessStatus status. */ - public status?: (google.rpc.IStatus|null); - - /** IndividualProcessStatus outputGcsDestination. */ - public outputGcsDestination: string; - - /** IndividualProcessStatus humanReviewStatus. */ - public humanReviewStatus?: (google.cloud.documentai.v1.IHumanReviewStatus|null); - - /** - * Creates a new IndividualProcessStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns IndividualProcessStatus instance - */ - public static create(properties?: google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus): google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus; - - /** - * Encodes the specified IndividualProcessStatus message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. - * @param message IndividualProcessStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IndividualProcessStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. - * @param message IndividualProcessStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IndividualProcessStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndividualProcessStatus - * @throws {Error} If the payload is not a 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.BatchProcessMetadata.IndividualProcessStatus; - - /** - * Decodes an IndividualProcessStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndividualProcessStatus - * @throws {Error} If the payload is 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.BatchProcessMetadata.IndividualProcessStatus; - - /** - * Verifies an IndividualProcessStatus message. - * @param message Plain 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 IndividualProcessStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndividualProcessStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus; - - /** - * Creates a plain object from an IndividualProcessStatus message. Also converts values to other types if specified. - * @param message IndividualProcessStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndividualProcessStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IndividualProcessStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - WAITING = 1, - RUNNING = 2, - SUCCEEDED = 3, - CANCELLING = 4, - CANCELLED = 5, - FAILED = 6 - } - } - - /** Properties of a FetchProcessorTypesRequest. */ - interface IFetchProcessorTypesRequest { - - /** FetchProcessorTypesRequest parent */ - parent?: (string|null); - } - - /** Represents a FetchProcessorTypesRequest. */ - class FetchProcessorTypesRequest implements IFetchProcessorTypesRequest { - - /** - * Constructs a new FetchProcessorTypesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IFetchProcessorTypesRequest); - - /** FetchProcessorTypesRequest parent. */ - public parent: string; - - /** - * Creates a new FetchProcessorTypesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchProcessorTypesRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IFetchProcessorTypesRequest): google.cloud.documentai.v1.FetchProcessorTypesRequest; - - /** - * Encodes the specified FetchProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesRequest.verify|verify} messages. - * @param message FetchProcessorTypesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IFetchProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesRequest.verify|verify} messages. - * @param message FetchProcessorTypesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IFetchProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchProcessorTypesRequest - * @throws {Error} If the payload is not a 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.FetchProcessorTypesRequest; - - /** - * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchProcessorTypesRequest - * @throws {Error} If the payload is 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.FetchProcessorTypesRequest; - - /** - * Verifies a FetchProcessorTypesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchProcessorTypesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.FetchProcessorTypesRequest; - - /** - * Creates a plain object from a FetchProcessorTypesRequest message. Also converts values to other types if specified. - * @param message FetchProcessorTypesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.FetchProcessorTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchProcessorTypesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchProcessorTypesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchProcessorTypesResponse. */ - interface IFetchProcessorTypesResponse { - - /** FetchProcessorTypesResponse processorTypes */ - processorTypes?: (google.cloud.documentai.v1.IProcessorType[]|null); - } - - /** Represents a FetchProcessorTypesResponse. */ - class FetchProcessorTypesResponse implements IFetchProcessorTypesResponse { - - /** - * Constructs a new FetchProcessorTypesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IFetchProcessorTypesResponse); - - /** FetchProcessorTypesResponse processorTypes. */ - public processorTypes: google.cloud.documentai.v1.IProcessorType[]; - - /** - * Creates a new FetchProcessorTypesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchProcessorTypesResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IFetchProcessorTypesResponse): google.cloud.documentai.v1.FetchProcessorTypesResponse; - - /** - * Encodes the specified FetchProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesResponse.verify|verify} messages. - * @param message FetchProcessorTypesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IFetchProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesResponse.verify|verify} messages. - * @param message FetchProcessorTypesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IFetchProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchProcessorTypesResponse - * @throws {Error} If the payload is not a 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.FetchProcessorTypesResponse; - - /** - * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchProcessorTypesResponse - * @throws {Error} If the payload is 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.FetchProcessorTypesResponse; - - /** - * Verifies a FetchProcessorTypesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchProcessorTypesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.FetchProcessorTypesResponse; - - /** - * Creates a plain object from a FetchProcessorTypesResponse message. Also converts values to other types if specified. - * @param message FetchProcessorTypesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.FetchProcessorTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchProcessorTypesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchProcessorTypesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProcessorTypesRequest. */ - interface IListProcessorTypesRequest { - - /** ListProcessorTypesRequest parent */ - parent?: (string|null); - - /** ListProcessorTypesRequest pageSize */ - pageSize?: (number|null); - - /** ListProcessorTypesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListProcessorTypesRequest. */ - class ListProcessorTypesRequest implements IListProcessorTypesRequest { - - /** - * Constructs a new ListProcessorTypesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IListProcessorTypesRequest); - - /** ListProcessorTypesRequest parent. */ - public parent: string; - - /** ListProcessorTypesRequest pageSize. */ - public pageSize: number; - - /** ListProcessorTypesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListProcessorTypesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProcessorTypesRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IListProcessorTypesRequest): google.cloud.documentai.v1.ListProcessorTypesRequest; - - /** - * Encodes the specified ListProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesRequest.verify|verify} messages. - * @param message ListProcessorTypesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IListProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesRequest.verify|verify} messages. - * @param message ListProcessorTypesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IListProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProcessorTypesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProcessorTypesRequest - * @throws {Error} If the payload is not a 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.ListProcessorTypesRequest; - - /** - * Decodes a ListProcessorTypesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProcessorTypesRequest - * @throws {Error} If the payload is 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.ListProcessorTypesRequest; - - /** - * Verifies a ListProcessorTypesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProcessorTypesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListProcessorTypesRequest; - - /** - * Creates a plain object from a ListProcessorTypesRequest message. Also converts values to other types if specified. - * @param message ListProcessorTypesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ListProcessorTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProcessorTypesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProcessorTypesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProcessorTypesResponse. */ - interface IListProcessorTypesResponse { - - /** ListProcessorTypesResponse processorTypes */ - processorTypes?: (google.cloud.documentai.v1.IProcessorType[]|null); - - /** ListProcessorTypesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListProcessorTypesResponse. */ - class ListProcessorTypesResponse implements IListProcessorTypesResponse { - - /** - * Constructs a new ListProcessorTypesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IListProcessorTypesResponse); - - /** ListProcessorTypesResponse processorTypes. */ - public processorTypes: google.cloud.documentai.v1.IProcessorType[]; - - /** ListProcessorTypesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListProcessorTypesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProcessorTypesResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IListProcessorTypesResponse): google.cloud.documentai.v1.ListProcessorTypesResponse; - - /** - * Encodes the specified ListProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesResponse.verify|verify} messages. - * @param message ListProcessorTypesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IListProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesResponse.verify|verify} messages. - * @param message ListProcessorTypesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IListProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProcessorTypesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProcessorTypesResponse - * @throws {Error} If the payload is not a 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.ListProcessorTypesResponse; - - /** - * Decodes a ListProcessorTypesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProcessorTypesResponse - * @throws {Error} If the payload is 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.ListProcessorTypesResponse; - - /** - * Verifies a ListProcessorTypesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProcessorTypesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListProcessorTypesResponse; - - /** - * Creates a plain object from a ListProcessorTypesResponse message. Also converts values to other types if specified. - * @param message ListProcessorTypesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ListProcessorTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProcessorTypesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProcessorTypesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProcessorsRequest. */ - interface IListProcessorsRequest { - - /** ListProcessorsRequest parent */ - parent?: (string|null); - - /** ListProcessorsRequest pageSize */ - pageSize?: (number|null); - - /** ListProcessorsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListProcessorsRequest. */ - class ListProcessorsRequest implements IListProcessorsRequest { - - /** - * Constructs a new ListProcessorsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IListProcessorsRequest); - - /** ListProcessorsRequest parent. */ - public parent: string; - - /** ListProcessorsRequest pageSize. */ - public pageSize: number; - - /** ListProcessorsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListProcessorsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProcessorsRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IListProcessorsRequest): google.cloud.documentai.v1.ListProcessorsRequest; - - /** - * Encodes the specified ListProcessorsRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsRequest.verify|verify} messages. - * @param message ListProcessorsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IListProcessorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProcessorsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsRequest.verify|verify} messages. - * @param message ListProcessorsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IListProcessorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProcessorsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProcessorsRequest - * @throws {Error} If the payload is not a 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.ListProcessorsRequest; - - /** - * Decodes a ListProcessorsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProcessorsRequest - * @throws {Error} If the payload is 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.ListProcessorsRequest; - - /** - * Verifies a ListProcessorsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListProcessorsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProcessorsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListProcessorsRequest; - - /** - * Creates a plain object from a ListProcessorsRequest message. Also converts values to other types if specified. - * @param message ListProcessorsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ListProcessorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProcessorsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProcessorsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProcessorsResponse. */ - interface IListProcessorsResponse { - - /** ListProcessorsResponse processors */ - processors?: (google.cloud.documentai.v1.IProcessor[]|null); - - /** ListProcessorsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListProcessorsResponse. */ - class ListProcessorsResponse implements IListProcessorsResponse { - - /** - * Constructs a new ListProcessorsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IListProcessorsResponse); - - /** ListProcessorsResponse processors. */ - public processors: google.cloud.documentai.v1.IProcessor[]; - - /** ListProcessorsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListProcessorsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProcessorsResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IListProcessorsResponse): google.cloud.documentai.v1.ListProcessorsResponse; - - /** - * Encodes the specified ListProcessorsResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsResponse.verify|verify} messages. - * @param message ListProcessorsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IListProcessorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProcessorsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsResponse.verify|verify} messages. - * @param message ListProcessorsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IListProcessorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProcessorsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProcessorsResponse - * @throws {Error} If the payload is not a 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.ListProcessorsResponse; - - /** - * Decodes a ListProcessorsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProcessorsResponse - * @throws {Error} If the payload is 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.ListProcessorsResponse; - - /** - * Verifies a ListProcessorsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListProcessorsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProcessorsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListProcessorsResponse; - - /** - * Creates a plain object from a ListProcessorsResponse message. Also converts values to other types if specified. - * @param message ListProcessorsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ListProcessorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProcessorsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProcessorsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetProcessorTypeRequest. */ - interface IGetProcessorTypeRequest { - - /** GetProcessorTypeRequest name */ - name?: (string|null); - } - - /** Represents a GetProcessorTypeRequest. */ - class GetProcessorTypeRequest implements IGetProcessorTypeRequest { - - /** - * Constructs a new GetProcessorTypeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IGetProcessorTypeRequest); - - /** GetProcessorTypeRequest name. */ - public name: string; - - /** - * Creates a new GetProcessorTypeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetProcessorTypeRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IGetProcessorTypeRequest): google.cloud.documentai.v1.GetProcessorTypeRequest; - - /** - * Encodes the specified GetProcessorTypeRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorTypeRequest.verify|verify} messages. - * @param message GetProcessorTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IGetProcessorTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetProcessorTypeRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorTypeRequest.verify|verify} messages. - * @param message GetProcessorTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IGetProcessorTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetProcessorTypeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetProcessorTypeRequest - * @throws {Error} If the payload is not a 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.GetProcessorTypeRequest; - - /** - * Decodes a GetProcessorTypeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetProcessorTypeRequest - * @throws {Error} If the payload is 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.GetProcessorTypeRequest; - - /** - * Verifies a GetProcessorTypeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetProcessorTypeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetProcessorTypeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GetProcessorTypeRequest; - - /** - * Creates a plain object from a GetProcessorTypeRequest message. Also converts values to other types if specified. - * @param message GetProcessorTypeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.GetProcessorTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetProcessorTypeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetProcessorTypeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetProcessorRequest. */ - interface IGetProcessorRequest { - - /** GetProcessorRequest name */ - name?: (string|null); - } - - /** Represents a GetProcessorRequest. */ - class GetProcessorRequest implements IGetProcessorRequest { - - /** - * Constructs a new GetProcessorRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IGetProcessorRequest); - - /** GetProcessorRequest name. */ - public name: string; - - /** - * Creates a new GetProcessorRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetProcessorRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IGetProcessorRequest): google.cloud.documentai.v1.GetProcessorRequest; - - /** - * Encodes the specified GetProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorRequest.verify|verify} messages. - * @param message GetProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IGetProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorRequest.verify|verify} messages. - * @param message GetProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IGetProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetProcessorRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetProcessorRequest - * @throws {Error} If the payload is not a 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.GetProcessorRequest; - - /** - * Decodes a GetProcessorRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetProcessorRequest - * @throws {Error} If the payload is 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.GetProcessorRequest; - - /** - * Verifies a GetProcessorRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetProcessorRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GetProcessorRequest; - - /** - * Creates a plain object from a GetProcessorRequest message. Also converts values to other types if specified. - * @param message GetProcessorRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.GetProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetProcessorRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetProcessorRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetProcessorVersionRequest. */ - interface IGetProcessorVersionRequest { - - /** GetProcessorVersionRequest name */ - name?: (string|null); - } - - /** Represents a GetProcessorVersionRequest. */ - class GetProcessorVersionRequest implements IGetProcessorVersionRequest { - - /** - * Constructs a new GetProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IGetProcessorVersionRequest); - - /** GetProcessorVersionRequest name. */ - public name: string; - - /** - * Creates a new GetProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IGetProcessorVersionRequest): google.cloud.documentai.v1.GetProcessorVersionRequest; - - /** - * Encodes the specified GetProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorVersionRequest.verify|verify} messages. - * @param message GetProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IGetProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorVersionRequest.verify|verify} messages. - * @param message GetProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IGetProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetProcessorVersionRequest - * @throws {Error} If the payload is not a 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.GetProcessorVersionRequest; - - /** - * Decodes a GetProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetProcessorVersionRequest - * @throws {Error} If the payload is 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.GetProcessorVersionRequest; - - /** - * Verifies a GetProcessorVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GetProcessorVersionRequest; - - /** - * Creates a plain object from a GetProcessorVersionRequest message. Also converts values to other types if specified. - * @param message GetProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.GetProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProcessorVersionsRequest. */ - interface IListProcessorVersionsRequest { - - /** ListProcessorVersionsRequest parent */ - parent?: (string|null); - - /** ListProcessorVersionsRequest pageSize */ - pageSize?: (number|null); - - /** ListProcessorVersionsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListProcessorVersionsRequest. */ - class ListProcessorVersionsRequest implements IListProcessorVersionsRequest { - - /** - * Constructs a new ListProcessorVersionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IListProcessorVersionsRequest); - - /** ListProcessorVersionsRequest parent. */ - public parent: string; - - /** ListProcessorVersionsRequest pageSize. */ - public pageSize: number; - - /** ListProcessorVersionsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListProcessorVersionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProcessorVersionsRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IListProcessorVersionsRequest): google.cloud.documentai.v1.ListProcessorVersionsRequest; - - /** - * Encodes the specified ListProcessorVersionsRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsRequest.verify|verify} messages. - * @param message ListProcessorVersionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IListProcessorVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProcessorVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsRequest.verify|verify} messages. - * @param message ListProcessorVersionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IListProcessorVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProcessorVersionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProcessorVersionsRequest - * @throws {Error} If the payload is not a 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.ListProcessorVersionsRequest; - - /** - * Decodes a ListProcessorVersionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProcessorVersionsRequest - * @throws {Error} If the payload is 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.ListProcessorVersionsRequest; - - /** - * Verifies a ListProcessorVersionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListProcessorVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProcessorVersionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListProcessorVersionsRequest; - - /** - * Creates a plain object from a ListProcessorVersionsRequest message. Also converts values to other types if specified. - * @param message ListProcessorVersionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ListProcessorVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProcessorVersionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProcessorVersionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProcessorVersionsResponse. */ - interface IListProcessorVersionsResponse { - - /** ListProcessorVersionsResponse processorVersions */ - processorVersions?: (google.cloud.documentai.v1.IProcessorVersion[]|null); - - /** ListProcessorVersionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListProcessorVersionsResponse. */ - class ListProcessorVersionsResponse implements IListProcessorVersionsResponse { - - /** - * Constructs a new ListProcessorVersionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IListProcessorVersionsResponse); - - /** ListProcessorVersionsResponse processorVersions. */ - public processorVersions: google.cloud.documentai.v1.IProcessorVersion[]; - - /** ListProcessorVersionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListProcessorVersionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProcessorVersionsResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IListProcessorVersionsResponse): google.cloud.documentai.v1.ListProcessorVersionsResponse; - - /** - * Encodes the specified ListProcessorVersionsResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsResponse.verify|verify} messages. - * @param message ListProcessorVersionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IListProcessorVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProcessorVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsResponse.verify|verify} messages. - * @param message ListProcessorVersionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IListProcessorVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProcessorVersionsResponse - * @throws {Error} If the payload is not a 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.ListProcessorVersionsResponse; - - /** - * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProcessorVersionsResponse - * @throws {Error} If the payload is 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.ListProcessorVersionsResponse; - - /** - * Verifies a ListProcessorVersionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListProcessorVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProcessorVersionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListProcessorVersionsResponse; - - /** - * Creates a plain object from a ListProcessorVersionsResponse message. Also converts values to other types if specified. - * @param message ListProcessorVersionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ListProcessorVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProcessorVersionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProcessorVersionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteProcessorVersionRequest. */ - interface IDeleteProcessorVersionRequest { - - /** DeleteProcessorVersionRequest name */ - name?: (string|null); - } - - /** Represents a DeleteProcessorVersionRequest. */ - class DeleteProcessorVersionRequest implements IDeleteProcessorVersionRequest { - - /** - * Constructs a new DeleteProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDeleteProcessorVersionRequest); - - /** DeleteProcessorVersionRequest name. */ - public name: string; - - /** - * Creates a new DeleteProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IDeleteProcessorVersionRequest): google.cloud.documentai.v1.DeleteProcessorVersionRequest; - - /** - * Encodes the specified DeleteProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionRequest.verify|verify} messages. - * @param message DeleteProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IDeleteProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionRequest.verify|verify} messages. - * @param message DeleteProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IDeleteProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteProcessorVersionRequest - * @throws {Error} If the payload is not a 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.DeleteProcessorVersionRequest; - - /** - * Decodes a DeleteProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteProcessorVersionRequest - * @throws {Error} If the payload is 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.DeleteProcessorVersionRequest; - - /** - * Verifies a DeleteProcessorVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeleteProcessorVersionRequest; - - /** - * Creates a plain object from a DeleteProcessorVersionRequest message. Also converts values to other types if specified. - * @param message DeleteProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DeleteProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteProcessorVersionMetadata. */ - interface IDeleteProcessorVersionMetadata { - - /** DeleteProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - } - - /** Represents a DeleteProcessorVersionMetadata. */ - class DeleteProcessorVersionMetadata implements IDeleteProcessorVersionMetadata { - - /** - * Constructs a new DeleteProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDeleteProcessorVersionMetadata); - - /** DeleteProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - - /** - * Creates a new DeleteProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1.IDeleteProcessorVersionMetadata): google.cloud.documentai.v1.DeleteProcessorVersionMetadata; - - /** - * Encodes the specified DeleteProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionMetadata.verify|verify} messages. - * @param message DeleteProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IDeleteProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionMetadata.verify|verify} messages. - * @param message DeleteProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IDeleteProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.DeleteProcessorVersionMetadata; - - /** - * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteProcessorVersionMetadata - * @throws {Error} If the payload is 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.DeleteProcessorVersionMetadata; - - /** - * Verifies a DeleteProcessorVersionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeleteProcessorVersionMetadata; - - /** - * Creates a plain object from a DeleteProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message DeleteProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DeleteProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeployProcessorVersionRequest. */ - interface IDeployProcessorVersionRequest { - - /** DeployProcessorVersionRequest name */ - name?: (string|null); - } - - /** Represents a DeployProcessorVersionRequest. */ - class DeployProcessorVersionRequest implements IDeployProcessorVersionRequest { - - /** - * Constructs a new DeployProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDeployProcessorVersionRequest); - - /** DeployProcessorVersionRequest name. */ - public name: string; - - /** - * Creates a new DeployProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeployProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IDeployProcessorVersionRequest): google.cloud.documentai.v1.DeployProcessorVersionRequest; - - /** - * Encodes the specified DeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionRequest.verify|verify} messages. - * @param message DeployProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IDeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionRequest.verify|verify} messages. - * @param message DeployProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IDeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeployProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeployProcessorVersionRequest - * @throws {Error} If the payload is not a 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.DeployProcessorVersionRequest; - - /** - * Decodes a DeployProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeployProcessorVersionRequest - * @throws {Error} If the payload is 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.DeployProcessorVersionRequest; - - /** - * Verifies a DeployProcessorVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeployProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeployProcessorVersionRequest; - - /** - * Creates a plain object from a DeployProcessorVersionRequest message. Also converts values to other types if specified. - * @param message DeployProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DeployProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeployProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeployProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeployProcessorVersionResponse. */ - interface IDeployProcessorVersionResponse { - } - - /** Represents a DeployProcessorVersionResponse. */ - class DeployProcessorVersionResponse implements IDeployProcessorVersionResponse { - - /** - * Constructs a new DeployProcessorVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDeployProcessorVersionResponse); - - /** - * Creates a new DeployProcessorVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns DeployProcessorVersionResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IDeployProcessorVersionResponse): google.cloud.documentai.v1.DeployProcessorVersionResponse; - - /** - * Encodes the specified DeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionResponse.verify|verify} messages. - * @param message DeployProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IDeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionResponse.verify|verify} messages. - * @param message DeployProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IDeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeployProcessorVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeployProcessorVersionResponse - * @throws {Error} If the payload is not a 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.DeployProcessorVersionResponse; - - /** - * Decodes a DeployProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeployProcessorVersionResponse - * @throws {Error} If the payload is 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.DeployProcessorVersionResponse; - - /** - * Verifies a DeployProcessorVersionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeployProcessorVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeployProcessorVersionResponse; - - /** - * Creates a plain object from a DeployProcessorVersionResponse message. Also converts values to other types if specified. - * @param message DeployProcessorVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DeployProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeployProcessorVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeployProcessorVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeployProcessorVersionMetadata. */ - interface IDeployProcessorVersionMetadata { - - /** DeployProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - } - - /** Represents a DeployProcessorVersionMetadata. */ - class DeployProcessorVersionMetadata implements IDeployProcessorVersionMetadata { - - /** - * Constructs a new DeployProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDeployProcessorVersionMetadata); - - /** DeployProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - - /** - * Creates a new DeployProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DeployProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1.IDeployProcessorVersionMetadata): google.cloud.documentai.v1.DeployProcessorVersionMetadata; - - /** - * Encodes the specified DeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionMetadata.verify|verify} messages. - * @param message DeployProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IDeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionMetadata.verify|verify} messages. - * @param message DeployProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IDeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeployProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.DeployProcessorVersionMetadata; - - /** - * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeployProcessorVersionMetadata - * @throws {Error} If the payload is 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.DeployProcessorVersionMetadata; - - /** - * Verifies a DeployProcessorVersionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeployProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeployProcessorVersionMetadata; - - /** - * Creates a plain object from a DeployProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message DeployProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DeployProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeployProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeployProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UndeployProcessorVersionRequest. */ - interface IUndeployProcessorVersionRequest { - - /** UndeployProcessorVersionRequest name */ - name?: (string|null); - } - - /** Represents an UndeployProcessorVersionRequest. */ - class UndeployProcessorVersionRequest implements IUndeployProcessorVersionRequest { - - /** - * Constructs a new UndeployProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IUndeployProcessorVersionRequest); - - /** UndeployProcessorVersionRequest name. */ - public name: string; - - /** - * Creates a new UndeployProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UndeployProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IUndeployProcessorVersionRequest): google.cloud.documentai.v1.UndeployProcessorVersionRequest; - - /** - * Encodes the specified UndeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionRequest.verify|verify} messages. - * @param message UndeployProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IUndeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UndeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionRequest.verify|verify} messages. - * @param message UndeployProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IUndeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UndeployProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UndeployProcessorVersionRequest - * @throws {Error} If the payload is not a 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.UndeployProcessorVersionRequest; - - /** - * Decodes an UndeployProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UndeployProcessorVersionRequest - * @throws {Error} If the payload is 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.UndeployProcessorVersionRequest; - - /** - * Verifies an UndeployProcessorVersionRequest message. - * @param message Plain 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 UndeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UndeployProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.UndeployProcessorVersionRequest; - - /** - * Creates a plain object from an UndeployProcessorVersionRequest message. Also converts values to other types if specified. - * @param message UndeployProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.UndeployProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UndeployProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UndeployProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UndeployProcessorVersionResponse. */ - interface IUndeployProcessorVersionResponse { - } - - /** Represents an UndeployProcessorVersionResponse. */ - class UndeployProcessorVersionResponse implements IUndeployProcessorVersionResponse { - - /** - * Constructs a new UndeployProcessorVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IUndeployProcessorVersionResponse); - - /** - * Creates a new UndeployProcessorVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns UndeployProcessorVersionResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IUndeployProcessorVersionResponse): google.cloud.documentai.v1.UndeployProcessorVersionResponse; - - /** - * Encodes the specified UndeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionResponse.verify|verify} messages. - * @param message UndeployProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IUndeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UndeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionResponse.verify|verify} messages. - * @param message UndeployProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IUndeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UndeployProcessorVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UndeployProcessorVersionResponse - * @throws {Error} If the payload is not a 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.UndeployProcessorVersionResponse; - - /** - * Decodes an UndeployProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UndeployProcessorVersionResponse - * @throws {Error} If the payload is 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.UndeployProcessorVersionResponse; - - /** - * Verifies an UndeployProcessorVersionResponse message. - * @param message Plain 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 UndeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UndeployProcessorVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.UndeployProcessorVersionResponse; - - /** - * Creates a plain object from an UndeployProcessorVersionResponse message. Also converts values to other types if specified. - * @param message UndeployProcessorVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.UndeployProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UndeployProcessorVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UndeployProcessorVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UndeployProcessorVersionMetadata. */ - interface IUndeployProcessorVersionMetadata { - - /** UndeployProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - } - - /** Represents an UndeployProcessorVersionMetadata. */ - class UndeployProcessorVersionMetadata implements IUndeployProcessorVersionMetadata { - - /** - * Constructs a new UndeployProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IUndeployProcessorVersionMetadata); - - /** UndeployProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - - /** - * Creates a new UndeployProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UndeployProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1.IUndeployProcessorVersionMetadata): google.cloud.documentai.v1.UndeployProcessorVersionMetadata; - - /** - * Encodes the specified UndeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionMetadata.verify|verify} messages. - * @param message UndeployProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IUndeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UndeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionMetadata.verify|verify} messages. - * @param message UndeployProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IUndeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UndeployProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.UndeployProcessorVersionMetadata; - - /** - * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UndeployProcessorVersionMetadata - * @throws {Error} If the payload is 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.UndeployProcessorVersionMetadata; - - /** - * Verifies an UndeployProcessorVersionMetadata message. - * @param message Plain 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 UndeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UndeployProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.UndeployProcessorVersionMetadata; - - /** - * Creates a plain object from an UndeployProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message UndeployProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.UndeployProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UndeployProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UndeployProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateProcessorRequest. */ - interface ICreateProcessorRequest { - - /** CreateProcessorRequest parent */ - parent?: (string|null); - - /** CreateProcessorRequest processor */ - processor?: (google.cloud.documentai.v1.IProcessor|null); - } - - /** Represents a CreateProcessorRequest. */ - class CreateProcessorRequest implements ICreateProcessorRequest { - - /** - * Constructs a new CreateProcessorRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ICreateProcessorRequest); - - /** CreateProcessorRequest parent. */ - public parent: string; - - /** CreateProcessorRequest processor. */ - public processor?: (google.cloud.documentai.v1.IProcessor|null); - - /** - * Creates a new CreateProcessorRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateProcessorRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.ICreateProcessorRequest): google.cloud.documentai.v1.CreateProcessorRequest; - - /** - * Encodes the specified CreateProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.CreateProcessorRequest.verify|verify} messages. - * @param message CreateProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ICreateProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.CreateProcessorRequest.verify|verify} messages. - * @param message CreateProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ICreateProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateProcessorRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateProcessorRequest - * @throws {Error} If the payload is not a 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.CreateProcessorRequest; - - /** - * Decodes a CreateProcessorRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateProcessorRequest - * @throws {Error} If the payload is 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.CreateProcessorRequest; - - /** - * Verifies a CreateProcessorRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateProcessorRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.CreateProcessorRequest; - - /** - * Creates a plain object from a CreateProcessorRequest message. Also converts values to other types if specified. - * @param message CreateProcessorRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.CreateProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateProcessorRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateProcessorRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteProcessorRequest. */ - interface IDeleteProcessorRequest { - - /** DeleteProcessorRequest name */ - name?: (string|null); - } - - /** Represents a DeleteProcessorRequest. */ - class DeleteProcessorRequest implements IDeleteProcessorRequest { - - /** - * Constructs a new DeleteProcessorRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDeleteProcessorRequest); - - /** DeleteProcessorRequest name. */ - public name: string; - - /** - * Creates a new DeleteProcessorRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteProcessorRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IDeleteProcessorRequest): google.cloud.documentai.v1.DeleteProcessorRequest; - - /** - * Encodes the specified DeleteProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorRequest.verify|verify} messages. - * @param message DeleteProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IDeleteProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorRequest.verify|verify} messages. - * @param message DeleteProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IDeleteProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteProcessorRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteProcessorRequest - * @throws {Error} If the payload is not a 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.DeleteProcessorRequest; - - /** - * Decodes a DeleteProcessorRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteProcessorRequest - * @throws {Error} If the payload is 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.DeleteProcessorRequest; - - /** - * Verifies a DeleteProcessorRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteProcessorRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeleteProcessorRequest; - - /** - * Creates a plain object from a DeleteProcessorRequest message. Also converts values to other types if specified. - * @param message DeleteProcessorRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DeleteProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteProcessorRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteProcessorRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteProcessorMetadata. */ - interface IDeleteProcessorMetadata { - - /** DeleteProcessorMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - } - - /** Represents a DeleteProcessorMetadata. */ - class DeleteProcessorMetadata implements IDeleteProcessorMetadata { - - /** - * Constructs a new DeleteProcessorMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDeleteProcessorMetadata); - - /** DeleteProcessorMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - - /** - * Creates a new DeleteProcessorMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteProcessorMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1.IDeleteProcessorMetadata): google.cloud.documentai.v1.DeleteProcessorMetadata; - - /** - * Encodes the specified DeleteProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorMetadata.verify|verify} messages. - * @param message DeleteProcessorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IDeleteProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorMetadata.verify|verify} messages. - * @param message DeleteProcessorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IDeleteProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteProcessorMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteProcessorMetadata - * @throws {Error} If the payload is not a 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.DeleteProcessorMetadata; - - /** - * Decodes a DeleteProcessorMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteProcessorMetadata - * @throws {Error} If the payload is 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.DeleteProcessorMetadata; - - /** - * Verifies a DeleteProcessorMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteProcessorMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteProcessorMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DeleteProcessorMetadata; - - /** - * Creates a plain object from a DeleteProcessorMetadata message. Also converts values to other types if specified. - * @param message DeleteProcessorMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DeleteProcessorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteProcessorMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteProcessorMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnableProcessorRequest. */ - interface IEnableProcessorRequest { - - /** EnableProcessorRequest name */ - name?: (string|null); - } - - /** Represents an EnableProcessorRequest. */ - class EnableProcessorRequest implements IEnableProcessorRequest { - - /** - * Constructs a new EnableProcessorRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IEnableProcessorRequest); - - /** EnableProcessorRequest name. */ - public name: string; - - /** - * Creates a new EnableProcessorRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns EnableProcessorRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IEnableProcessorRequest): google.cloud.documentai.v1.EnableProcessorRequest; - - /** - * Encodes the specified EnableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorRequest.verify|verify} messages. - * @param message EnableProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IEnableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorRequest.verify|verify} messages. - * @param message EnableProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IEnableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnableProcessorRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnableProcessorRequest - * @throws {Error} If the payload is not a 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.EnableProcessorRequest; - - /** - * Decodes an EnableProcessorRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnableProcessorRequest - * @throws {Error} If the payload is 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.EnableProcessorRequest; - - /** - * Verifies an EnableProcessorRequest message. - * @param message Plain 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 EnableProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnableProcessorRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EnableProcessorRequest; - - /** - * Creates a plain object from an EnableProcessorRequest message. Also converts values to other types if specified. - * @param message EnableProcessorRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.EnableProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnableProcessorRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnableProcessorRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnableProcessorResponse. */ - interface IEnableProcessorResponse { - } - - /** Represents an EnableProcessorResponse. */ - class EnableProcessorResponse implements IEnableProcessorResponse { - - /** - * Constructs a new EnableProcessorResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IEnableProcessorResponse); - - /** - * Creates a new EnableProcessorResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns EnableProcessorResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IEnableProcessorResponse): google.cloud.documentai.v1.EnableProcessorResponse; - - /** - * Encodes the specified EnableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorResponse.verify|verify} messages. - * @param message EnableProcessorResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IEnableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorResponse.verify|verify} messages. - * @param message EnableProcessorResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IEnableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnableProcessorResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnableProcessorResponse - * @throws {Error} If the payload is not a 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.EnableProcessorResponse; - - /** - * Decodes an EnableProcessorResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnableProcessorResponse - * @throws {Error} If the payload is 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.EnableProcessorResponse; - - /** - * Verifies an EnableProcessorResponse message. - * @param message Plain 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 EnableProcessorResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnableProcessorResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EnableProcessorResponse; - - /** - * Creates a plain object from an EnableProcessorResponse message. Also converts values to other types if specified. - * @param message EnableProcessorResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.EnableProcessorResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnableProcessorResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnableProcessorResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnableProcessorMetadata. */ - interface IEnableProcessorMetadata { - - /** EnableProcessorMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - } - - /** Represents an EnableProcessorMetadata. */ - class EnableProcessorMetadata implements IEnableProcessorMetadata { - - /** - * Constructs a new EnableProcessorMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IEnableProcessorMetadata); - - /** EnableProcessorMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - - /** - * Creates a new EnableProcessorMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns EnableProcessorMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1.IEnableProcessorMetadata): google.cloud.documentai.v1.EnableProcessorMetadata; - - /** - * Encodes the specified EnableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorMetadata.verify|verify} messages. - * @param message EnableProcessorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IEnableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorMetadata.verify|verify} messages. - * @param message EnableProcessorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IEnableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnableProcessorMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnableProcessorMetadata - * @throws {Error} If the payload is not a 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.EnableProcessorMetadata; - - /** - * Decodes an EnableProcessorMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnableProcessorMetadata - * @throws {Error} If the payload is 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.EnableProcessorMetadata; - - /** - * Verifies an EnableProcessorMetadata message. - * @param message Plain 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 EnableProcessorMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnableProcessorMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EnableProcessorMetadata; - - /** - * Creates a plain object from an EnableProcessorMetadata message. Also converts values to other types if specified. - * @param message EnableProcessorMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.EnableProcessorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnableProcessorMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnableProcessorMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DisableProcessorRequest. */ - interface IDisableProcessorRequest { - - /** DisableProcessorRequest name */ - name?: (string|null); - } - - /** Represents a DisableProcessorRequest. */ - class DisableProcessorRequest implements IDisableProcessorRequest { - - /** - * Constructs a new DisableProcessorRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDisableProcessorRequest); - - /** DisableProcessorRequest name. */ - public name: string; - - /** - * Creates a new DisableProcessorRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DisableProcessorRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IDisableProcessorRequest): google.cloud.documentai.v1.DisableProcessorRequest; - - /** - * Encodes the specified DisableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorRequest.verify|verify} messages. - * @param message DisableProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IDisableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorRequest.verify|verify} messages. - * @param message DisableProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IDisableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisableProcessorRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisableProcessorRequest - * @throws {Error} If the payload is not a 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.DisableProcessorRequest; - - /** - * Decodes a DisableProcessorRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisableProcessorRequest - * @throws {Error} If the payload is 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.DisableProcessorRequest; - - /** - * Verifies a DisableProcessorRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DisableProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisableProcessorRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DisableProcessorRequest; - - /** - * Creates a plain object from a DisableProcessorRequest message. Also converts values to other types if specified. - * @param message DisableProcessorRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DisableProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisableProcessorRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisableProcessorRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DisableProcessorResponse. */ - interface IDisableProcessorResponse { - } - - /** Represents a DisableProcessorResponse. */ - class DisableProcessorResponse implements IDisableProcessorResponse { - - /** - * Constructs a new DisableProcessorResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDisableProcessorResponse); - - /** - * Creates a new DisableProcessorResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns DisableProcessorResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IDisableProcessorResponse): google.cloud.documentai.v1.DisableProcessorResponse; - - /** - * Encodes the specified DisableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorResponse.verify|verify} messages. - * @param message DisableProcessorResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IDisableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorResponse.verify|verify} messages. - * @param message DisableProcessorResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IDisableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisableProcessorResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisableProcessorResponse - * @throws {Error} If the payload is not a 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.DisableProcessorResponse; - - /** - * Decodes a DisableProcessorResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisableProcessorResponse - * @throws {Error} If the payload is 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.DisableProcessorResponse; - - /** - * Verifies a DisableProcessorResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DisableProcessorResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisableProcessorResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DisableProcessorResponse; - - /** - * Creates a plain object from a DisableProcessorResponse message. Also converts values to other types if specified. - * @param message DisableProcessorResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DisableProcessorResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisableProcessorResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisableProcessorResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DisableProcessorMetadata. */ - interface IDisableProcessorMetadata { - - /** DisableProcessorMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - } - - /** Represents a DisableProcessorMetadata. */ - class DisableProcessorMetadata implements IDisableProcessorMetadata { - - /** - * Constructs a new DisableProcessorMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDisableProcessorMetadata); - - /** DisableProcessorMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - - /** - * Creates a new DisableProcessorMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DisableProcessorMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1.IDisableProcessorMetadata): google.cloud.documentai.v1.DisableProcessorMetadata; - - /** - * Encodes the specified DisableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorMetadata.verify|verify} messages. - * @param message DisableProcessorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IDisableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorMetadata.verify|verify} messages. - * @param message DisableProcessorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IDisableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisableProcessorMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisableProcessorMetadata - * @throws {Error} If the payload is not a 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.DisableProcessorMetadata; - - /** - * Decodes a DisableProcessorMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisableProcessorMetadata - * @throws {Error} If the payload is 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.DisableProcessorMetadata; - - /** - * Verifies a DisableProcessorMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DisableProcessorMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisableProcessorMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DisableProcessorMetadata; - - /** - * Creates a plain object from a DisableProcessorMetadata message. Also converts values to other types if specified. - * @param message DisableProcessorMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DisableProcessorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisableProcessorMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisableProcessorMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SetDefaultProcessorVersionRequest. */ - interface ISetDefaultProcessorVersionRequest { - - /** SetDefaultProcessorVersionRequest processor */ - processor?: (string|null); - - /** SetDefaultProcessorVersionRequest defaultProcessorVersion */ - defaultProcessorVersion?: (string|null); - } - - /** Represents a SetDefaultProcessorVersionRequest. */ - class SetDefaultProcessorVersionRequest implements ISetDefaultProcessorVersionRequest { - - /** - * Constructs a new SetDefaultProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest); - - /** SetDefaultProcessorVersionRequest processor. */ - public processor: string; - - /** SetDefaultProcessorVersionRequest defaultProcessorVersion. */ - public defaultProcessorVersion: string; - - /** - * Creates a new SetDefaultProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetDefaultProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest): google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; - - /** - * Encodes the specified SetDefaultProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.verify|verify} messages. - * @param message SetDefaultProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetDefaultProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.verify|verify} messages. - * @param message SetDefaultProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetDefaultProcessorVersionRequest - * @throws {Error} If the payload is not a 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.SetDefaultProcessorVersionRequest; - - /** - * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetDefaultProcessorVersionRequest - * @throws {Error} If the payload is 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.SetDefaultProcessorVersionRequest; - - /** - * Verifies a SetDefaultProcessorVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetDefaultProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetDefaultProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.SetDefaultProcessorVersionRequest; - - /** - * Creates a plain object from a SetDefaultProcessorVersionRequest message. Also converts values to other types if specified. - * @param message SetDefaultProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.SetDefaultProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetDefaultProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetDefaultProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SetDefaultProcessorVersionResponse. */ - interface ISetDefaultProcessorVersionResponse { - } - - /** Represents a SetDefaultProcessorVersionResponse. */ - class SetDefaultProcessorVersionResponse implements ISetDefaultProcessorVersionResponse { - - /** - * Constructs a new SetDefaultProcessorVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse); - - /** - * Creates a new SetDefaultProcessorVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SetDefaultProcessorVersionResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse): google.cloud.documentai.v1.SetDefaultProcessorVersionResponse; - - /** - * Encodes the specified SetDefaultProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.verify|verify} messages. - * @param message SetDefaultProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetDefaultProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.verify|verify} messages. - * @param message SetDefaultProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetDefaultProcessorVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetDefaultProcessorVersionResponse - * @throws {Error} If the payload is not a 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.SetDefaultProcessorVersionResponse; - - /** - * Decodes a SetDefaultProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetDefaultProcessorVersionResponse - * @throws {Error} If the payload is 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.SetDefaultProcessorVersionResponse; - - /** - * Verifies a SetDefaultProcessorVersionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetDefaultProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetDefaultProcessorVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.SetDefaultProcessorVersionResponse; - - /** - * Creates a plain object from a SetDefaultProcessorVersionResponse message. Also converts values to other types if specified. - * @param message SetDefaultProcessorVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.SetDefaultProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetDefaultProcessorVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetDefaultProcessorVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SetDefaultProcessorVersionMetadata. */ - interface ISetDefaultProcessorVersionMetadata { - - /** SetDefaultProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - } - - /** Represents a SetDefaultProcessorVersionMetadata. */ - class SetDefaultProcessorVersionMetadata implements ISetDefaultProcessorVersionMetadata { - - /** - * Constructs a new SetDefaultProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata); - - /** SetDefaultProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - - /** - * Creates a new SetDefaultProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns SetDefaultProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata): google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata; - - /** - * Encodes the specified SetDefaultProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.verify|verify} messages. - * @param message SetDefaultProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetDefaultProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.verify|verify} messages. - * @param message SetDefaultProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetDefaultProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.SetDefaultProcessorVersionMetadata; - - /** - * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetDefaultProcessorVersionMetadata - * @throws {Error} If the payload is 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.SetDefaultProcessorVersionMetadata; - - /** - * Verifies a SetDefaultProcessorVersionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetDefaultProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetDefaultProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata; - - /** - * Creates a plain object from a SetDefaultProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message SetDefaultProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetDefaultProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetDefaultProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TrainProcessorVersionRequest. */ - interface ITrainProcessorVersionRequest { - - /** TrainProcessorVersionRequest customDocumentExtractionOptions */ - customDocumentExtractionOptions?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null); - - /** TrainProcessorVersionRequest foundationModelTuningOptions */ - foundationModelTuningOptions?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null); - - /** TrainProcessorVersionRequest parent */ - parent?: (string|null); - - /** TrainProcessorVersionRequest processorVersion */ - processorVersion?: (google.cloud.documentai.v1.IProcessorVersion|null); - - /** TrainProcessorVersionRequest documentSchema */ - documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); - - /** TrainProcessorVersionRequest inputData */ - inputData?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData|null); - - /** TrainProcessorVersionRequest baseProcessorVersion */ - baseProcessorVersion?: (string|null); - } - - /** Represents a TrainProcessorVersionRequest. */ - class TrainProcessorVersionRequest implements ITrainProcessorVersionRequest { - - /** - * Constructs a new TrainProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ITrainProcessorVersionRequest); - - /** TrainProcessorVersionRequest customDocumentExtractionOptions. */ - public customDocumentExtractionOptions?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null); - - /** TrainProcessorVersionRequest foundationModelTuningOptions. */ - public foundationModelTuningOptions?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null); - - /** TrainProcessorVersionRequest parent. */ - public parent: string; - - /** TrainProcessorVersionRequest processorVersion. */ - public processorVersion?: (google.cloud.documentai.v1.IProcessorVersion|null); - - /** TrainProcessorVersionRequest documentSchema. */ - public documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); - - /** TrainProcessorVersionRequest inputData. */ - public inputData?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData|null); - - /** TrainProcessorVersionRequest baseProcessorVersion. */ - public baseProcessorVersion: string; - - /** TrainProcessorVersionRequest processorFlags. */ - public processorFlags?: ("customDocumentExtractionOptions"|"foundationModelTuningOptions"); - - /** - * Creates a new TrainProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TrainProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.ITrainProcessorVersionRequest): google.cloud.documentai.v1.TrainProcessorVersionRequest; - - /** - * Encodes the specified TrainProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.verify|verify} messages. - * @param message TrainProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ITrainProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrainProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.verify|verify} messages. - * @param message TrainProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ITrainProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrainProcessorVersionRequest - * @throws {Error} If the payload is not a 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.TrainProcessorVersionRequest; - - /** - * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrainProcessorVersionRequest - * @throws {Error} If the payload is 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.TrainProcessorVersionRequest; - - /** - * Verifies a TrainProcessorVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrainProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrainProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionRequest; - - /** - * Creates a plain object from a TrainProcessorVersionRequest message. Also converts values to other types if specified. - * @param message TrainProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrainProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrainProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TrainProcessorVersionRequest { - - /** Properties of an InputData. */ - interface IInputData { - - /** InputData trainingDocuments */ - trainingDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); - - /** InputData testDocuments */ - testDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); - } - - /** Represents an InputData. */ - class InputData implements IInputData { - - /** - * Constructs a new InputData. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData); - - /** InputData trainingDocuments. */ - public trainingDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); - - /** InputData testDocuments. */ - public testDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); - - /** - * Creates a new InputData instance using the specified properties. - * @param [properties] Properties to set - * @returns InputData instance - */ - public static create(properties?: google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData): google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData; - - /** - * Encodes the specified InputData message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.verify|verify} messages. - * @param message InputData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InputData message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.verify|verify} messages. - * @param message InputData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InputData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InputData - * @throws {Error} If the payload is not a 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.TrainProcessorVersionRequest.InputData; - - /** - * Decodes an InputData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InputData - * @throws {Error} If the payload is 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.TrainProcessorVersionRequest.InputData; - - /** - * Verifies an InputData message. - * @param message Plain 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 InputData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InputData - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData; - - /** - * Creates a plain object from an InputData message. Also converts values to other types if specified. - * @param message InputData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InputData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InputData - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomDocumentExtractionOptions. */ - interface ICustomDocumentExtractionOptions { - - /** CustomDocumentExtractionOptions trainingMethod */ - trainingMethod?: (google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|keyof typeof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|null); - } - - /** Represents a CustomDocumentExtractionOptions. */ - class CustomDocumentExtractionOptions implements ICustomDocumentExtractionOptions { - - /** - * Constructs a new CustomDocumentExtractionOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions); - - /** CustomDocumentExtractionOptions trainingMethod. */ - public trainingMethod: (google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|keyof typeof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod); - - /** - * Creates a new CustomDocumentExtractionOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomDocumentExtractionOptions instance - */ - public static create(properties?: google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions): google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; - - /** - * Encodes the specified CustomDocumentExtractionOptions message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. - * @param message CustomDocumentExtractionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomDocumentExtractionOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. - * @param message CustomDocumentExtractionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomDocumentExtractionOptions - * @throws {Error} If the payload is not a 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.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; - - /** - * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomDocumentExtractionOptions - * @throws {Error} If the payload is 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.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; - - /** - * Verifies a CustomDocumentExtractionOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomDocumentExtractionOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomDocumentExtractionOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; - - /** - * Creates a plain object from a CustomDocumentExtractionOptions message. Also converts values to other types if specified. - * @param message CustomDocumentExtractionOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomDocumentExtractionOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomDocumentExtractionOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CustomDocumentExtractionOptions { - - /** TrainingMethod enum. */ - enum TrainingMethod { - TRAINING_METHOD_UNSPECIFIED = 0, - MODEL_BASED = 1, - TEMPLATE_BASED = 2 - } - } - - /** Properties of a FoundationModelTuningOptions. */ - interface IFoundationModelTuningOptions { - - /** FoundationModelTuningOptions trainSteps */ - trainSteps?: (number|null); - - /** FoundationModelTuningOptions learningRateMultiplier */ - learningRateMultiplier?: (number|null); - } - - /** Represents a FoundationModelTuningOptions. */ - class FoundationModelTuningOptions implements IFoundationModelTuningOptions { - - /** - * Constructs a new FoundationModelTuningOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions); - - /** FoundationModelTuningOptions trainSteps. */ - public trainSteps: number; - - /** FoundationModelTuningOptions learningRateMultiplier. */ - public learningRateMultiplier: number; - - /** - * Creates a new FoundationModelTuningOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FoundationModelTuningOptions instance - */ - public static create(properties?: google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions): google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions; - - /** - * Encodes the specified FoundationModelTuningOptions message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. - * @param message FoundationModelTuningOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FoundationModelTuningOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. - * @param message FoundationModelTuningOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FoundationModelTuningOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FoundationModelTuningOptions - * @throws {Error} If the payload is not a 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.TrainProcessorVersionRequest.FoundationModelTuningOptions; - - /** - * Decodes a FoundationModelTuningOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FoundationModelTuningOptions - * @throws {Error} If the payload is 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.TrainProcessorVersionRequest.FoundationModelTuningOptions; - - /** - * Verifies a FoundationModelTuningOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FoundationModelTuningOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FoundationModelTuningOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions; - - /** - * Creates a plain object from a FoundationModelTuningOptions message. Also converts values to other types if specified. - * @param message FoundationModelTuningOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FoundationModelTuningOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FoundationModelTuningOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TrainProcessorVersionResponse. */ - interface ITrainProcessorVersionResponse { - - /** TrainProcessorVersionResponse processorVersion */ - processorVersion?: (string|null); - } - - /** Represents a TrainProcessorVersionResponse. */ - class TrainProcessorVersionResponse implements ITrainProcessorVersionResponse { - - /** - * Constructs a new TrainProcessorVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ITrainProcessorVersionResponse); - - /** TrainProcessorVersionResponse processorVersion. */ - public processorVersion: string; - - /** - * Creates a new TrainProcessorVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TrainProcessorVersionResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.ITrainProcessorVersionResponse): google.cloud.documentai.v1.TrainProcessorVersionResponse; - - /** - * Encodes the specified TrainProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionResponse.verify|verify} messages. - * @param message TrainProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ITrainProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrainProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionResponse.verify|verify} messages. - * @param message TrainProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ITrainProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrainProcessorVersionResponse - * @throws {Error} If the payload is not a 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.TrainProcessorVersionResponse; - - /** - * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrainProcessorVersionResponse - * @throws {Error} If the payload is 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.TrainProcessorVersionResponse; - - /** - * Verifies a TrainProcessorVersionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrainProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrainProcessorVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionResponse; - - /** - * Creates a plain object from a TrainProcessorVersionResponse message. Also converts values to other types if specified. - * @param message TrainProcessorVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrainProcessorVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrainProcessorVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TrainProcessorVersionMetadata. */ - interface ITrainProcessorVersionMetadata { - - /** TrainProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - - /** TrainProcessorVersionMetadata trainingDatasetValidation */ - trainingDatasetValidation?: (google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null); - - /** TrainProcessorVersionMetadata testDatasetValidation */ - testDatasetValidation?: (google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null); - } - - /** Represents a TrainProcessorVersionMetadata. */ - class TrainProcessorVersionMetadata implements ITrainProcessorVersionMetadata { - - /** - * Constructs a new TrainProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ITrainProcessorVersionMetadata); - - /** TrainProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - - /** TrainProcessorVersionMetadata trainingDatasetValidation. */ - public trainingDatasetValidation?: (google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null); - - /** TrainProcessorVersionMetadata testDatasetValidation. */ - public testDatasetValidation?: (google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null); - - /** - * Creates a new TrainProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns TrainProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1.ITrainProcessorVersionMetadata): google.cloud.documentai.v1.TrainProcessorVersionMetadata; - - /** - * Encodes the specified TrainProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.verify|verify} messages. - * @param message TrainProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ITrainProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrainProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.verify|verify} messages. - * @param message TrainProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ITrainProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrainProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.TrainProcessorVersionMetadata; - - /** - * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrainProcessorVersionMetadata - * @throws {Error} If the payload is 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.TrainProcessorVersionMetadata; - - /** - * Verifies a TrainProcessorVersionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrainProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrainProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionMetadata; - - /** - * Creates a plain object from a TrainProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message TrainProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrainProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrainProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TrainProcessorVersionMetadata { - - /** Properties of a DatasetValidation. */ - interface IDatasetValidation { - - /** DatasetValidation documentErrorCount */ - documentErrorCount?: (number|null); - - /** DatasetValidation datasetErrorCount */ - datasetErrorCount?: (number|null); - - /** DatasetValidation documentErrors */ - documentErrors?: (google.rpc.IStatus[]|null); - - /** DatasetValidation datasetErrors */ - datasetErrors?: (google.rpc.IStatus[]|null); - } - - /** Represents a DatasetValidation. */ - class DatasetValidation implements IDatasetValidation { - - /** - * Constructs a new DatasetValidation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation); - - /** DatasetValidation documentErrorCount. */ - public documentErrorCount: number; - - /** DatasetValidation datasetErrorCount. */ - public datasetErrorCount: number; - - /** DatasetValidation documentErrors. */ - public documentErrors: google.rpc.IStatus[]; - - /** DatasetValidation datasetErrors. */ - public datasetErrors: google.rpc.IStatus[]; - - /** - * Creates a new DatasetValidation instance using the specified properties. - * @param [properties] Properties to set - * @returns DatasetValidation instance - */ - public static create(properties?: google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation): google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation; - - /** - * Encodes the specified DatasetValidation message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. - * @param message DatasetValidation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DatasetValidation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. - * @param message DatasetValidation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DatasetValidation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DatasetValidation - * @throws {Error} If the payload is not a 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.TrainProcessorVersionMetadata.DatasetValidation; - - /** - * Decodes a DatasetValidation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DatasetValidation - * @throws {Error} If the payload is 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.TrainProcessorVersionMetadata.DatasetValidation; - - /** - * Verifies a DatasetValidation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DatasetValidation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DatasetValidation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation; - - /** - * Creates a plain object from a DatasetValidation message. Also converts values to other types if specified. - * @param message DatasetValidation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DatasetValidation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DatasetValidation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ReviewDocumentRequest. */ - interface IReviewDocumentRequest { - - /** ReviewDocumentRequest inlineDocument */ - inlineDocument?: (google.cloud.documentai.v1.IDocument|null); - - /** ReviewDocumentRequest humanReviewConfig */ - humanReviewConfig?: (string|null); - - /** ReviewDocumentRequest enableSchemaValidation */ - enableSchemaValidation?: (boolean|null); - - /** ReviewDocumentRequest priority */ - priority?: (google.cloud.documentai.v1.ReviewDocumentRequest.Priority|keyof typeof google.cloud.documentai.v1.ReviewDocumentRequest.Priority|null); - - /** ReviewDocumentRequest documentSchema */ - documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); - } - - /** Represents a ReviewDocumentRequest. */ - class ReviewDocumentRequest implements IReviewDocumentRequest { - - /** - * Constructs a new ReviewDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IReviewDocumentRequest); - - /** ReviewDocumentRequest inlineDocument. */ - public inlineDocument?: (google.cloud.documentai.v1.IDocument|null); - - /** ReviewDocumentRequest humanReviewConfig. */ - public humanReviewConfig: string; - - /** ReviewDocumentRequest enableSchemaValidation. */ - public enableSchemaValidation: boolean; - - /** ReviewDocumentRequest priority. */ - public priority: (google.cloud.documentai.v1.ReviewDocumentRequest.Priority|keyof typeof google.cloud.documentai.v1.ReviewDocumentRequest.Priority); - - /** ReviewDocumentRequest documentSchema. */ - public documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); - - /** ReviewDocumentRequest source. */ - public source?: "inlineDocument"; - - /** - * Creates a new ReviewDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ReviewDocumentRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IReviewDocumentRequest): google.cloud.documentai.v1.ReviewDocumentRequest; - - /** - * Encodes the specified ReviewDocumentRequest message. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentRequest.verify|verify} messages. - * @param message ReviewDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IReviewDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReviewDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentRequest.verify|verify} messages. - * @param message ReviewDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IReviewDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReviewDocumentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReviewDocumentRequest - * @throws {Error} If the payload is not a 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.ReviewDocumentRequest; - - /** - * Decodes a ReviewDocumentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReviewDocumentRequest - * @throws {Error} If the payload is 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.ReviewDocumentRequest; - - /** - * Verifies a ReviewDocumentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReviewDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReviewDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ReviewDocumentRequest; - - /** - * Creates a plain object from a ReviewDocumentRequest message. Also converts values to other types if specified. - * @param message ReviewDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ReviewDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReviewDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReviewDocumentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReviewDocumentRequest { - - /** Priority enum. */ - enum Priority { - DEFAULT = 0, - URGENT = 1 - } - } - - /** Properties of a ReviewDocumentResponse. */ - interface IReviewDocumentResponse { - - /** ReviewDocumentResponse gcsDestination */ - gcsDestination?: (string|null); - - /** ReviewDocumentResponse state */ - state?: (google.cloud.documentai.v1.ReviewDocumentResponse.State|keyof typeof google.cloud.documentai.v1.ReviewDocumentResponse.State|null); - - /** ReviewDocumentResponse rejectionReason */ - rejectionReason?: (string|null); - } - - /** Represents a ReviewDocumentResponse. */ - class ReviewDocumentResponse implements IReviewDocumentResponse { - - /** - * Constructs a new ReviewDocumentResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IReviewDocumentResponse); - - /** ReviewDocumentResponse gcsDestination. */ - public gcsDestination: string; - - /** ReviewDocumentResponse state. */ - public state: (google.cloud.documentai.v1.ReviewDocumentResponse.State|keyof typeof google.cloud.documentai.v1.ReviewDocumentResponse.State); - - /** ReviewDocumentResponse rejectionReason. */ - public rejectionReason: string; - - /** - * Creates a new ReviewDocumentResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ReviewDocumentResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IReviewDocumentResponse): google.cloud.documentai.v1.ReviewDocumentResponse; - - /** - * Encodes the specified ReviewDocumentResponse message. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentResponse.verify|verify} messages. - * @param message ReviewDocumentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IReviewDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReviewDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentResponse.verify|verify} messages. - * @param message ReviewDocumentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IReviewDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReviewDocumentResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReviewDocumentResponse - * @throws {Error} If the payload is not a 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.ReviewDocumentResponse; - - /** - * Decodes a ReviewDocumentResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReviewDocumentResponse - * @throws {Error} If the payload is 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.ReviewDocumentResponse; - - /** - * Verifies a ReviewDocumentResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReviewDocumentResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReviewDocumentResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ReviewDocumentResponse; - - /** - * Creates a plain object from a ReviewDocumentResponse message. Also converts values to other types if specified. - * @param message ReviewDocumentResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ReviewDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReviewDocumentResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReviewDocumentResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReviewDocumentResponse { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - REJECTED = 1, - SUCCEEDED = 2 - } - } - - /** Properties of a ReviewDocumentOperationMetadata. */ - interface IReviewDocumentOperationMetadata { - - /** ReviewDocumentOperationMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - - /** ReviewDocumentOperationMetadata questionId */ - questionId?: (string|null); - } - - /** Represents a ReviewDocumentOperationMetadata. */ - class ReviewDocumentOperationMetadata implements IReviewDocumentOperationMetadata { - - /** - * Constructs a new ReviewDocumentOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IReviewDocumentOperationMetadata); - - /** ReviewDocumentOperationMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - - /** ReviewDocumentOperationMetadata questionId. */ - public questionId: string; - - /** - * Creates a new ReviewDocumentOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ReviewDocumentOperationMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1.IReviewDocumentOperationMetadata): google.cloud.documentai.v1.ReviewDocumentOperationMetadata; - - /** - * Encodes the specified ReviewDocumentOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentOperationMetadata.verify|verify} messages. - * @param message ReviewDocumentOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IReviewDocumentOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReviewDocumentOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentOperationMetadata.verify|verify} messages. - * @param message ReviewDocumentOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IReviewDocumentOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReviewDocumentOperationMetadata - * @throws {Error} If the payload is not a 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.ReviewDocumentOperationMetadata; - - /** - * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReviewDocumentOperationMetadata - * @throws {Error} If the payload is 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.ReviewDocumentOperationMetadata; - - /** - * Verifies a ReviewDocumentOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReviewDocumentOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReviewDocumentOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ReviewDocumentOperationMetadata; - - /** - * Creates a plain object from a ReviewDocumentOperationMetadata message. Also converts values to other types if specified. - * @param message ReviewDocumentOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ReviewDocumentOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReviewDocumentOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReviewDocumentOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EvaluateProcessorVersionRequest. */ - interface IEvaluateProcessorVersionRequest { - - /** EvaluateProcessorVersionRequest processorVersion */ - processorVersion?: (string|null); - - /** EvaluateProcessorVersionRequest evaluationDocuments */ - evaluationDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); - } - - /** Represents an EvaluateProcessorVersionRequest. */ - class EvaluateProcessorVersionRequest implements IEvaluateProcessorVersionRequest { - - /** - * Constructs a new EvaluateProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IEvaluateProcessorVersionRequest); - - /** EvaluateProcessorVersionRequest processorVersion. */ - public processorVersion: string; - - /** EvaluateProcessorVersionRequest evaluationDocuments. */ - public evaluationDocuments?: (google.cloud.documentai.v1.IBatchDocumentsInputConfig|null); - - /** - * Creates a new EvaluateProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluateProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IEvaluateProcessorVersionRequest): google.cloud.documentai.v1.EvaluateProcessorVersionRequest; - - /** - * Encodes the specified EvaluateProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionRequest.verify|verify} messages. - * @param message EvaluateProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluateProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionRequest.verify|verify} messages. - * @param message EvaluateProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluateProcessorVersionRequest - * @throws {Error} If the payload is not a 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.EvaluateProcessorVersionRequest; - - /** - * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluateProcessorVersionRequest - * @throws {Error} If the payload is 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.EvaluateProcessorVersionRequest; - - /** - * Verifies an EvaluateProcessorVersionRequest message. - * @param message Plain 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 EvaluateProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluateProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EvaluateProcessorVersionRequest; - - /** - * Creates a plain object from an EvaluateProcessorVersionRequest message. Also converts values to other types if specified. - * @param message EvaluateProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.EvaluateProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluateProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluateProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EvaluateProcessorVersionMetadata. */ - interface IEvaluateProcessorVersionMetadata { - - /** EvaluateProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - } - - /** Represents an EvaluateProcessorVersionMetadata. */ - class EvaluateProcessorVersionMetadata implements IEvaluateProcessorVersionMetadata { - - /** - * Constructs a new EvaluateProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata); - - /** EvaluateProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1.ICommonOperationMetadata|null); - - /** - * Creates a new EvaluateProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluateProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata): google.cloud.documentai.v1.EvaluateProcessorVersionMetadata; - - /** - * Encodes the specified EvaluateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.verify|verify} messages. - * @param message EvaluateProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.verify|verify} messages. - * @param message EvaluateProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluateProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.EvaluateProcessorVersionMetadata; - - /** - * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluateProcessorVersionMetadata - * @throws {Error} If the payload is 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.EvaluateProcessorVersionMetadata; - - /** - * Verifies an EvaluateProcessorVersionMetadata message. - * @param message Plain 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 EvaluateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluateProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EvaluateProcessorVersionMetadata; - - /** - * Creates a plain object from an EvaluateProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message EvaluateProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.EvaluateProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluateProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluateProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EvaluateProcessorVersionResponse. */ - interface IEvaluateProcessorVersionResponse { - - /** EvaluateProcessorVersionResponse evaluation */ - evaluation?: (string|null); - } - - /** Represents an EvaluateProcessorVersionResponse. */ - class EvaluateProcessorVersionResponse implements IEvaluateProcessorVersionResponse { - - /** - * Constructs a new EvaluateProcessorVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IEvaluateProcessorVersionResponse); - - /** EvaluateProcessorVersionResponse evaluation. */ - public evaluation: string; - - /** - * Creates a new EvaluateProcessorVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluateProcessorVersionResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IEvaluateProcessorVersionResponse): google.cloud.documentai.v1.EvaluateProcessorVersionResponse; - - /** - * Encodes the specified EvaluateProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionResponse.verify|verify} messages. - * @param message EvaluateProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IEvaluateProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluateProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionResponse.verify|verify} messages. - * @param message EvaluateProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IEvaluateProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluateProcessorVersionResponse - * @throws {Error} If the payload is not a 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.EvaluateProcessorVersionResponse; - - /** - * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluateProcessorVersionResponse - * @throws {Error} If the payload is 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.EvaluateProcessorVersionResponse; - - /** - * Verifies an EvaluateProcessorVersionResponse message. - * @param message Plain 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 EvaluateProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluateProcessorVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EvaluateProcessorVersionResponse; - - /** - * Creates a plain object from an EvaluateProcessorVersionResponse message. Also converts values to other types if specified. - * @param message EvaluateProcessorVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.EvaluateProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluateProcessorVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluateProcessorVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetEvaluationRequest. */ - interface IGetEvaluationRequest { - - /** GetEvaluationRequest name */ - name?: (string|null); - } - - /** Represents a GetEvaluationRequest. */ - class GetEvaluationRequest implements IGetEvaluationRequest { - - /** - * Constructs a new GetEvaluationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IGetEvaluationRequest); - - /** GetEvaluationRequest name. */ - public name: string; - - /** - * Creates a new GetEvaluationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetEvaluationRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IGetEvaluationRequest): google.cloud.documentai.v1.GetEvaluationRequest; - - /** - * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetEvaluationRequest.verify|verify} messages. - * @param message GetEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetEvaluationRequest.verify|verify} messages. - * @param message GetEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetEvaluationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetEvaluationRequest - * @throws {Error} If the payload is not a 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.GetEvaluationRequest; - - /** - * Decodes a GetEvaluationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetEvaluationRequest - * @throws {Error} If the payload is 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.GetEvaluationRequest; - - /** - * Verifies a GetEvaluationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetEvaluationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.GetEvaluationRequest; - - /** - * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. - * @param message GetEvaluationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.GetEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetEvaluationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetEvaluationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationsRequest. */ - interface IListEvaluationsRequest { - - /** ListEvaluationsRequest parent */ - parent?: (string|null); - - /** ListEvaluationsRequest pageSize */ - pageSize?: (number|null); - - /** ListEvaluationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListEvaluationsRequest. */ - class ListEvaluationsRequest implements IListEvaluationsRequest { - - /** - * Constructs a new ListEvaluationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IListEvaluationsRequest); - - /** ListEvaluationsRequest parent. */ - public parent: string; - - /** ListEvaluationsRequest pageSize. */ - public pageSize: number; - - /** ListEvaluationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListEvaluationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationsRequest instance - */ - public static create(properties?: google.cloud.documentai.v1.IListEvaluationsRequest): google.cloud.documentai.v1.ListEvaluationsRequest; - - /** - * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsRequest.verify|verify} messages. - * @param message ListEvaluationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsRequest.verify|verify} messages. - * @param message ListEvaluationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationsRequest - * @throws {Error} If the payload is not a 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.ListEvaluationsRequest; - - /** - * Decodes a ListEvaluationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationsRequest - * @throws {Error} If the payload is 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.ListEvaluationsRequest; - - /** - * Verifies a ListEvaluationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListEvaluationsRequest; - - /** - * Creates a plain object from a ListEvaluationsRequest message. Also converts values to other types if specified. - * @param message ListEvaluationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ListEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationsResponse. */ - interface IListEvaluationsResponse { - - /** ListEvaluationsResponse evaluations */ - evaluations?: (google.cloud.documentai.v1.IEvaluation[]|null); - - /** ListEvaluationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListEvaluationsResponse. */ - class ListEvaluationsResponse implements IListEvaluationsResponse { - - /** - * Constructs a new ListEvaluationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IListEvaluationsResponse); - - /** ListEvaluationsResponse evaluations. */ - public evaluations: google.cloud.documentai.v1.IEvaluation[]; - - /** ListEvaluationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListEvaluationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationsResponse instance - */ - public static create(properties?: google.cloud.documentai.v1.IListEvaluationsResponse): google.cloud.documentai.v1.ListEvaluationsResponse; - - /** - * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsResponse.verify|verify} messages. - * @param message ListEvaluationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsResponse.verify|verify} messages. - * @param message ListEvaluationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationsResponse - * @throws {Error} If the payload is not a 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.ListEvaluationsResponse; - - /** - * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationsResponse - * @throws {Error} If the payload is 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.ListEvaluationsResponse; - - /** - * Verifies a ListEvaluationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ListEvaluationsResponse; - - /** - * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. - * @param message ListEvaluationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ListEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationsResponse - * @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 displayName */ - displayName?: (string|null); - - /** DocumentSchema description */ - description?: (string|null); - - /** DocumentSchema entityTypes */ - entityTypes?: (google.cloud.documentai.v1.DocumentSchema.IEntityType[]|null); - - /** DocumentSchema metadata */ - metadata?: (google.cloud.documentai.v1.DocumentSchema.IMetadata|null); - } - - /** Represents a DocumentSchema. */ - class DocumentSchema implements IDocumentSchema { - - /** - * Constructs a new DocumentSchema. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IDocumentSchema); - - /** DocumentSchema displayName. */ - public displayName: string; - - /** DocumentSchema description. */ - public description: string; - - /** DocumentSchema entityTypes. */ - public entityTypes: google.cloud.documentai.v1.DocumentSchema.IEntityType[]; - - /** DocumentSchema metadata. */ - public metadata?: (google.cloud.documentai.v1.DocumentSchema.IMetadata|null); - - /** - * Creates a new DocumentSchema instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentSchema instance - */ - public static create(properties?: google.cloud.documentai.v1.IDocumentSchema): google.cloud.documentai.v1.DocumentSchema; - - /** - * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.documentai.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.documentai.v1.IDocumentSchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.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.documentai.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.documentai.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.documentai.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.documentai.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.documentai.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; - } - - namespace DocumentSchema { - - /** Properties of an EntityType. */ - interface IEntityType { - - /** EntityType enumValues */ - enumValues?: (google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues|null); - - /** EntityType displayName */ - displayName?: (string|null); - - /** EntityType name */ - name?: (string|null); - - /** EntityType baseTypes */ - baseTypes?: (string[]|null); - - /** EntityType properties */ - properties?: (google.cloud.documentai.v1.DocumentSchema.EntityType.IProperty[]|null); - } - - /** Represents an EntityType. */ - class EntityType implements IEntityType { - - /** - * Constructs a new EntityType. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.DocumentSchema.IEntityType); - - /** EntityType enumValues. */ - public enumValues?: (google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues|null); - - /** EntityType displayName. */ - public displayName: string; - - /** EntityType name. */ - public name: string; - - /** EntityType baseTypes. */ - public baseTypes: string[]; - - /** EntityType properties. */ - public properties: google.cloud.documentai.v1.DocumentSchema.EntityType.IProperty[]; - - /** EntityType valueSource. */ - public valueSource?: "enumValues"; - - /** - * Creates a new EntityType instance using the specified properties. - * @param [properties] Properties to set - * @returns EntityType instance - */ - public static create(properties?: google.cloud.documentai.v1.DocumentSchema.IEntityType): google.cloud.documentai.v1.DocumentSchema.EntityType; - - /** - * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.verify|verify} messages. - * @param message EntityType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.DocumentSchema.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.verify|verify} messages. - * @param message EntityType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.DocumentSchema.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EntityType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EntityType - * @throws {Error} If the payload is not a 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.DocumentSchema.EntityType; - - /** - * Decodes an EntityType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EntityType - * @throws {Error} If the payload is 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.DocumentSchema.EntityType; - - /** - * Verifies an EntityType message. - * @param message Plain 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 EntityType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EntityType - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DocumentSchema.EntityType; - - /** - * Creates a plain object from an EntityType message. Also converts values to other types if specified. - * @param message EntityType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DocumentSchema.EntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EntityType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EntityType - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EntityType { - - /** Properties of an EnumValues. */ - interface IEnumValues { - - /** EnumValues values */ - values?: (string[]|null); - } - - /** Represents an EnumValues. */ - class EnumValues implements IEnumValues { - - /** - * Constructs a new EnumValues. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues); - - /** EnumValues values. */ - public values: string[]; - - /** - * Creates a new EnumValues instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValues instance - */ - public static create(properties?: google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues): google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues; - - /** - * Encodes the specified EnumValues message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.verify|verify} messages. - * @param message EnumValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValues message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.verify|verify} messages. - * @param message EnumValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValues message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValues - * @throws {Error} If the payload is not a 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.DocumentSchema.EntityType.EnumValues; - - /** - * Decodes an EnumValues message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValues - * @throws {Error} If the payload is 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.DocumentSchema.EntityType.EnumValues; - - /** - * Verifies an EnumValues message. - * @param message Plain 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 EnumValues message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValues - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues; - - /** - * Creates a plain object from an EnumValues message. Also converts values to other types if specified. - * @param message EnumValues - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValues to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValues - * @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 displayName */ - displayName?: (string|null); - - /** Property valueType */ - valueType?: (string|null); - - /** Property occurrenceType */ - occurrenceType?: (google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType|keyof typeof google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType|null); - - /** Property method */ - method?: (google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method|keyof typeof google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method|null); - } - - /** Represents a Property. */ - class Property implements IProperty { - - /** - * Constructs a new Property. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.DocumentSchema.EntityType.IProperty); - - /** Property name. */ - public name: string; - - /** Property displayName. */ - public displayName: string; - - /** Property valueType. */ - public valueType: string; - - /** Property occurrenceType. */ - public occurrenceType: (google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType|keyof typeof google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType); - - /** Property method. */ - public method: (google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method|keyof typeof google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method); - - /** - * Creates a new Property instance using the specified properties. - * @param [properties] Properties to set - * @returns Property instance - */ - public static create(properties?: google.cloud.documentai.v1.DocumentSchema.EntityType.IProperty): google.cloud.documentai.v1.DocumentSchema.EntityType.Property; - - /** - * Encodes the specified Property message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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; - } - - namespace Property { - - /** OccurrenceType enum. */ - enum OccurrenceType { - OCCURRENCE_TYPE_UNSPECIFIED = 0, - OPTIONAL_ONCE = 1, - OPTIONAL_MULTIPLE = 2, - REQUIRED_ONCE = 3, - REQUIRED_MULTIPLE = 4 - } - - /** Method enum. */ - enum Method { - METHOD_UNSPECIFIED = 0, - EXTRACT = 1, - DERIVE = 2 - } - } - } - - /** Properties of a Metadata. */ - interface IMetadata { - - /** Metadata documentSplitter */ - documentSplitter?: (boolean|null); - - /** Metadata documentAllowMultipleLabels */ - documentAllowMultipleLabels?: (boolean|null); - - /** Metadata prefixedNamingOnProperties */ - prefixedNamingOnProperties?: (boolean|null); - - /** Metadata skipNamingValidation */ - skipNamingValidation?: (boolean|null); - } - - /** Represents a Metadata. */ - class Metadata implements IMetadata { - - /** - * Constructs a new Metadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.DocumentSchema.IMetadata); - - /** Metadata documentSplitter. */ - public documentSplitter: boolean; - - /** Metadata documentAllowMultipleLabels. */ - public documentAllowMultipleLabels: boolean; - - /** Metadata prefixedNamingOnProperties. */ - public prefixedNamingOnProperties: boolean; - - /** Metadata skipNamingValidation. */ - public skipNamingValidation: boolean; - - /** - * Creates a new Metadata instance using the specified properties. - * @param [properties] Properties to set - * @returns Metadata instance - */ - public static create(properties?: google.cloud.documentai.v1.DocumentSchema.IMetadata): google.cloud.documentai.v1.DocumentSchema.Metadata; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.Metadata.verify|verify} messages. - * @param message Metadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.DocumentSchema.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.Metadata.verify|verify} messages. - * @param message Metadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.DocumentSchema.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Metadata - * @throws {Error} If the payload is not a 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.DocumentSchema.Metadata; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Metadata - * @throws {Error} If the payload is 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.DocumentSchema.Metadata; - - /** - * Verifies a Metadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Metadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.DocumentSchema.Metadata; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @param message Metadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.DocumentSchema.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Metadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Metadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EvaluationReference. */ - interface IEvaluationReference { - - /** EvaluationReference operation */ - operation?: (string|null); - - /** EvaluationReference evaluation */ - evaluation?: (string|null); - - /** EvaluationReference aggregateMetrics */ - aggregateMetrics?: (google.cloud.documentai.v1.Evaluation.IMetrics|null); - - /** EvaluationReference aggregateMetricsExact */ - aggregateMetricsExact?: (google.cloud.documentai.v1.Evaluation.IMetrics|null); - } - - /** Represents an EvaluationReference. */ - class EvaluationReference implements IEvaluationReference { - - /** - * Constructs a new EvaluationReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IEvaluationReference); - - /** EvaluationReference operation. */ - public operation: string; - - /** EvaluationReference evaluation. */ - public evaluation: string; - - /** EvaluationReference aggregateMetrics. */ - public aggregateMetrics?: (google.cloud.documentai.v1.Evaluation.IMetrics|null); - - /** EvaluationReference aggregateMetricsExact. */ - public aggregateMetricsExact?: (google.cloud.documentai.v1.Evaluation.IMetrics|null); - - /** - * Creates a new EvaluationReference instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationReference instance - */ - public static create(properties?: google.cloud.documentai.v1.IEvaluationReference): google.cloud.documentai.v1.EvaluationReference; - - /** - * Encodes the specified EvaluationReference message. Does not implicitly {@link google.cloud.documentai.v1.EvaluationReference.verify|verify} messages. - * @param message EvaluationReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IEvaluationReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationReference message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluationReference.verify|verify} messages. - * @param message EvaluationReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IEvaluationReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationReference - * @throws {Error} If the payload is not a 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.EvaluationReference; - - /** - * Decodes an EvaluationReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationReference - * @throws {Error} If the payload is 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.EvaluationReference; - - /** - * Verifies an EvaluationReference message. - * @param message Plain 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 EvaluationReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationReference - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.EvaluationReference; - - /** - * Creates a plain object from an EvaluationReference message. Also converts values to other types if specified. - * @param message EvaluationReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.EvaluationReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Evaluation. */ - interface IEvaluation { - - /** Evaluation name */ - name?: (string|null); - - /** Evaluation createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Evaluation documentCounters */ - documentCounters?: (google.cloud.documentai.v1.Evaluation.ICounters|null); - - /** Evaluation allEntitiesMetrics */ - allEntitiesMetrics?: (google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics|null); - - /** Evaluation entityMetrics */ - entityMetrics?: ({ [k: string]: google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics }|null); - - /** Evaluation kmsKeyName */ - kmsKeyName?: (string|null); - - /** Evaluation kmsKeyVersionName */ - kmsKeyVersionName?: (string|null); - } - - /** Represents an Evaluation. */ - class Evaluation implements IEvaluation { - - /** - * Constructs a new Evaluation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IEvaluation); - - /** Evaluation name. */ - public name: string; - - /** Evaluation createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Evaluation documentCounters. */ - public documentCounters?: (google.cloud.documentai.v1.Evaluation.ICounters|null); - - /** Evaluation allEntitiesMetrics. */ - public allEntitiesMetrics?: (google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics|null); - - /** Evaluation entityMetrics. */ - public entityMetrics: { [k: string]: google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics }; - - /** Evaluation kmsKeyName. */ - public kmsKeyName: string; - - /** Evaluation kmsKeyVersionName. */ - public kmsKeyVersionName: string; - - /** - * Creates a new Evaluation instance using the specified properties. - * @param [properties] Properties to set - * @returns Evaluation instance - */ - public static create(properties?: google.cloud.documentai.v1.IEvaluation): google.cloud.documentai.v1.Evaluation; - - /** - * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.verify|verify} messages. - * @param message Evaluation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.verify|verify} messages. - * @param message Evaluation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Evaluation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Evaluation - * @throws {Error} If the payload is not a 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.Evaluation; - - /** - * Decodes an Evaluation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Evaluation - * @throws {Error} If the payload is 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.Evaluation; - - /** - * Verifies an Evaluation message. - * @param message Plain 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 Evaluation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Evaluation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Evaluation; - - /** - * Creates a plain object from an Evaluation message. Also converts values to other types if specified. - * @param message Evaluation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Evaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Evaluation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Evaluation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Evaluation { - - /** Properties of a Counters. */ - interface ICounters { - - /** Counters inputDocumentsCount */ - inputDocumentsCount?: (number|null); - - /** Counters invalidDocumentsCount */ - invalidDocumentsCount?: (number|null); - - /** Counters failedDocumentsCount */ - failedDocumentsCount?: (number|null); - - /** Counters evaluatedDocumentsCount */ - evaluatedDocumentsCount?: (number|null); - } - - /** Represents a Counters. */ - class Counters implements ICounters { - - /** - * Constructs a new Counters. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Evaluation.ICounters); - - /** Counters inputDocumentsCount. */ - public inputDocumentsCount: number; - - /** Counters invalidDocumentsCount. */ - public invalidDocumentsCount: number; - - /** Counters failedDocumentsCount. */ - public failedDocumentsCount: number; - - /** Counters evaluatedDocumentsCount. */ - public evaluatedDocumentsCount: number; - - /** - * Creates a new Counters instance using the specified properties. - * @param [properties] Properties to set - * @returns Counters instance - */ - public static create(properties?: google.cloud.documentai.v1.Evaluation.ICounters): google.cloud.documentai.v1.Evaluation.Counters; - - /** - * Encodes the specified Counters message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Counters.verify|verify} messages. - * @param message Counters message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Evaluation.ICounters, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Counters message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Counters.verify|verify} messages. - * @param message Counters message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Evaluation.ICounters, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Counters message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Counters - * @throws {Error} If the payload is not a 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.Evaluation.Counters; - - /** - * Decodes a Counters message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Counters - * @throws {Error} If the payload is 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.Evaluation.Counters; - - /** - * Verifies a Counters message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Counters message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Counters - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Evaluation.Counters; - - /** - * Creates a plain object from a Counters message. Also converts values to other types if specified. - * @param message Counters - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Evaluation.Counters, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Counters to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Counters - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Metrics. */ - interface IMetrics { - - /** Metrics precision */ - precision?: (number|null); - - /** Metrics recall */ - recall?: (number|null); - - /** Metrics f1Score */ - f1Score?: (number|null); - - /** Metrics predictedOccurrencesCount */ - predictedOccurrencesCount?: (number|null); - - /** Metrics groundTruthOccurrencesCount */ - groundTruthOccurrencesCount?: (number|null); - - /** Metrics predictedDocumentCount */ - predictedDocumentCount?: (number|null); - - /** Metrics groundTruthDocumentCount */ - groundTruthDocumentCount?: (number|null); - - /** Metrics truePositivesCount */ - truePositivesCount?: (number|null); - - /** Metrics falsePositivesCount */ - falsePositivesCount?: (number|null); - - /** Metrics falseNegativesCount */ - falseNegativesCount?: (number|null); - - /** Metrics totalDocumentsCount */ - totalDocumentsCount?: (number|null); - } - - /** Represents a Metrics. */ - class Metrics implements IMetrics { - - /** - * Constructs a new Metrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Evaluation.IMetrics); - - /** Metrics precision. */ - public precision: number; - - /** Metrics recall. */ - public recall: number; - - /** Metrics f1Score. */ - public f1Score: number; - - /** Metrics predictedOccurrencesCount. */ - public predictedOccurrencesCount: number; - - /** Metrics groundTruthOccurrencesCount. */ - public groundTruthOccurrencesCount: number; - - /** Metrics predictedDocumentCount. */ - public predictedDocumentCount: number; - - /** Metrics groundTruthDocumentCount. */ - public groundTruthDocumentCount: number; - - /** Metrics truePositivesCount. */ - public truePositivesCount: number; - - /** Metrics falsePositivesCount. */ - public falsePositivesCount: number; - - /** Metrics falseNegativesCount. */ - public falseNegativesCount: number; - - /** Metrics totalDocumentsCount. */ - public totalDocumentsCount: number; - - /** - * Creates a new Metrics instance using the specified properties. - * @param [properties] Properties to set - * @returns Metrics instance - */ - public static create(properties?: google.cloud.documentai.v1.Evaluation.IMetrics): google.cloud.documentai.v1.Evaluation.Metrics; - - /** - * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Metrics.verify|verify} messages. - * @param message Metrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Evaluation.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Metrics.verify|verify} messages. - * @param message Metrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Evaluation.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Metrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Metrics - * @throws {Error} If the payload is not a 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.Evaluation.Metrics; - - /** - * Decodes a Metrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Metrics - * @throws {Error} If the payload is 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.Evaluation.Metrics; - - /** - * Verifies a Metrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Metrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Metrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Evaluation.Metrics; - - /** - * Creates a plain object from a Metrics message. Also converts values to other types if specified. - * @param message Metrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Evaluation.Metrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Metrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Metrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ConfidenceLevelMetrics. */ - interface IConfidenceLevelMetrics { - - /** ConfidenceLevelMetrics confidenceLevel */ - confidenceLevel?: (number|null); - - /** ConfidenceLevelMetrics metrics */ - metrics?: (google.cloud.documentai.v1.Evaluation.IMetrics|null); - } - - /** Represents a ConfidenceLevelMetrics. */ - class ConfidenceLevelMetrics implements IConfidenceLevelMetrics { - - /** - * Constructs a new ConfidenceLevelMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics); - - /** ConfidenceLevelMetrics confidenceLevel. */ - public confidenceLevel: number; - - /** ConfidenceLevelMetrics metrics. */ - public metrics?: (google.cloud.documentai.v1.Evaluation.IMetrics|null); - - /** - * Creates a new ConfidenceLevelMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns ConfidenceLevelMetrics instance - */ - public static create(properties?: google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics): google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics; - - /** - * Encodes the specified ConfidenceLevelMetrics message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. - * @param message ConfidenceLevelMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConfidenceLevelMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. - * @param message ConfidenceLevelMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConfidenceLevelMetrics - * @throws {Error} If the payload is not a 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.Evaluation.ConfidenceLevelMetrics; - - /** - * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConfidenceLevelMetrics - * @throws {Error} If the payload is 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.Evaluation.ConfidenceLevelMetrics; - - /** - * Verifies a ConfidenceLevelMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConfidenceLevelMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConfidenceLevelMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics; - - /** - * Creates a plain object from a ConfidenceLevelMetrics message. Also converts values to other types if specified. - * @param message ConfidenceLevelMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConfidenceLevelMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConfidenceLevelMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MultiConfidenceMetrics. */ - interface IMultiConfidenceMetrics { - - /** MultiConfidenceMetrics confidenceLevelMetrics */ - confidenceLevelMetrics?: (google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics[]|null); - - /** MultiConfidenceMetrics confidenceLevelMetricsExact */ - confidenceLevelMetricsExact?: (google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics[]|null); - - /** MultiConfidenceMetrics auprc */ - auprc?: (number|null); - - /** MultiConfidenceMetrics estimatedCalibrationError */ - estimatedCalibrationError?: (number|null); - - /** MultiConfidenceMetrics auprcExact */ - auprcExact?: (number|null); - - /** MultiConfidenceMetrics estimatedCalibrationErrorExact */ - estimatedCalibrationErrorExact?: (number|null); - - /** MultiConfidenceMetrics metricsType */ - metricsType?: (google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType|keyof typeof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType|null); - } - - /** Represents a MultiConfidenceMetrics. */ - class MultiConfidenceMetrics implements IMultiConfidenceMetrics { - - /** - * Constructs a new MultiConfidenceMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics); - - /** MultiConfidenceMetrics confidenceLevelMetrics. */ - public confidenceLevelMetrics: google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics[]; - - /** MultiConfidenceMetrics confidenceLevelMetricsExact. */ - public confidenceLevelMetricsExact: google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics[]; - - /** MultiConfidenceMetrics auprc. */ - public auprc: number; - - /** MultiConfidenceMetrics estimatedCalibrationError. */ - public estimatedCalibrationError: number; - - /** MultiConfidenceMetrics auprcExact. */ - public auprcExact: number; - - /** MultiConfidenceMetrics estimatedCalibrationErrorExact. */ - public estimatedCalibrationErrorExact: number; - - /** MultiConfidenceMetrics metricsType. */ - public metricsType: (google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType|keyof typeof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType); - - /** - * Creates a new MultiConfidenceMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns MultiConfidenceMetrics instance - */ - public static create(properties?: google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics): google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics; - - /** - * Encodes the specified MultiConfidenceMetrics message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.verify|verify} messages. - * @param message MultiConfidenceMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MultiConfidenceMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.verify|verify} messages. - * @param message MultiConfidenceMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MultiConfidenceMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MultiConfidenceMetrics - * @throws {Error} If the payload is not a 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.Evaluation.MultiConfidenceMetrics; - - /** - * Decodes a MultiConfidenceMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MultiConfidenceMetrics - * @throws {Error} If the payload is 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.Evaluation.MultiConfidenceMetrics; - - /** - * Verifies a MultiConfidenceMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MultiConfidenceMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MultiConfidenceMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics; - - /** - * Creates a plain object from a MultiConfidenceMetrics message. Also converts values to other types if specified. - * @param message MultiConfidenceMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MultiConfidenceMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MultiConfidenceMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MultiConfidenceMetrics { - - /** MetricsType enum. */ - enum MetricsType { - METRICS_TYPE_UNSPECIFIED = 0, - AGGREGATE = 1 - } - } - } - - /** Properties of a CommonOperationMetadata. */ - interface ICommonOperationMetadata { - - /** CommonOperationMetadata state */ - state?: (google.cloud.documentai.v1.CommonOperationMetadata.State|keyof typeof google.cloud.documentai.v1.CommonOperationMetadata.State|null); - - /** CommonOperationMetadata stateMessage */ - stateMessage?: (string|null); - - /** CommonOperationMetadata resource */ - resource?: (string|null); - - /** CommonOperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** CommonOperationMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CommonOperationMetadata. */ - class CommonOperationMetadata implements ICommonOperationMetadata { - - /** - * Constructs a new CommonOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ICommonOperationMetadata); - - /** CommonOperationMetadata state. */ - public state: (google.cloud.documentai.v1.CommonOperationMetadata.State|keyof typeof google.cloud.documentai.v1.CommonOperationMetadata.State); - - /** CommonOperationMetadata stateMessage. */ - public stateMessage: string; - - /** CommonOperationMetadata resource. */ - public resource: string; - - /** CommonOperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** CommonOperationMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CommonOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonOperationMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1.ICommonOperationMetadata): google.cloud.documentai.v1.CommonOperationMetadata; - - /** - * Encodes the specified CommonOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1.CommonOperationMetadata.verify|verify} messages. - * @param message CommonOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ICommonOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.CommonOperationMetadata.verify|verify} messages. - * @param message CommonOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ICommonOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonOperationMetadata - * @throws {Error} If the payload is not a 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.CommonOperationMetadata; - - /** - * Decodes a CommonOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonOperationMetadata - * @throws {Error} If the payload is 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.CommonOperationMetadata; - - /** - * Verifies a CommonOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.CommonOperationMetadata; - - /** - * Creates a plain object from a CommonOperationMetadata message. Also converts values to other types if specified. - * @param message CommonOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.CommonOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CommonOperationMetadata { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - RUNNING = 1, - CANCELLING = 2, - SUCCEEDED = 3, - FAILED = 4, - CANCELLED = 5 - } - } - - /** Properties of a ProcessorVersion. */ - interface IProcessorVersion { - - /** ProcessorVersion name */ - name?: (string|null); - - /** ProcessorVersion displayName */ - displayName?: (string|null); - - /** ProcessorVersion documentSchema */ - documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); - - /** ProcessorVersion state */ - state?: (google.cloud.documentai.v1.ProcessorVersion.State|keyof typeof google.cloud.documentai.v1.ProcessorVersion.State|null); - - /** ProcessorVersion createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ProcessorVersion latestEvaluation */ - latestEvaluation?: (google.cloud.documentai.v1.IEvaluationReference|null); - - /** ProcessorVersion kmsKeyName */ - kmsKeyName?: (string|null); - - /** ProcessorVersion kmsKeyVersionName */ - kmsKeyVersionName?: (string|null); - - /** ProcessorVersion googleManaged */ - googleManaged?: (boolean|null); - - /** ProcessorVersion deprecationInfo */ - deprecationInfo?: (google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo|null); - - /** ProcessorVersion modelType */ - modelType?: (google.cloud.documentai.v1.ProcessorVersion.ModelType|keyof typeof google.cloud.documentai.v1.ProcessorVersion.ModelType|null); - - /** ProcessorVersion satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** ProcessorVersion satisfiesPzi */ - satisfiesPzi?: (boolean|null); - - /** ProcessorVersion genAiModelInfo */ - genAiModelInfo?: (google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo|null); - } - - /** Represents a ProcessorVersion. */ - class ProcessorVersion implements IProcessorVersion { - - /** - * Constructs a new ProcessorVersion. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IProcessorVersion); - - /** ProcessorVersion name. */ - public name: string; - - /** ProcessorVersion displayName. */ - public displayName: string; - - /** ProcessorVersion documentSchema. */ - public documentSchema?: (google.cloud.documentai.v1.IDocumentSchema|null); - - /** ProcessorVersion state. */ - public state: (google.cloud.documentai.v1.ProcessorVersion.State|keyof typeof google.cloud.documentai.v1.ProcessorVersion.State); - - /** ProcessorVersion createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ProcessorVersion latestEvaluation. */ - public latestEvaluation?: (google.cloud.documentai.v1.IEvaluationReference|null); - - /** ProcessorVersion kmsKeyName. */ - public kmsKeyName: string; - - /** ProcessorVersion kmsKeyVersionName. */ - public kmsKeyVersionName: string; - - /** ProcessorVersion googleManaged. */ - public googleManaged: boolean; - - /** ProcessorVersion deprecationInfo. */ - public deprecationInfo?: (google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo|null); - - /** ProcessorVersion modelType. */ - public modelType: (google.cloud.documentai.v1.ProcessorVersion.ModelType|keyof typeof google.cloud.documentai.v1.ProcessorVersion.ModelType); - - /** ProcessorVersion satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** ProcessorVersion satisfiesPzi. */ - public satisfiesPzi: boolean; - - /** ProcessorVersion genAiModelInfo. */ - public genAiModelInfo?: (google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo|null); - - /** - * Creates a new ProcessorVersion instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessorVersion instance - */ - public static create(properties?: google.cloud.documentai.v1.IProcessorVersion): google.cloud.documentai.v1.ProcessorVersion; - - /** - * Encodes the specified ProcessorVersion message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.verify|verify} messages. - * @param message ProcessorVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IProcessorVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessorVersion message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.verify|verify} messages. - * @param message ProcessorVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IProcessorVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessorVersion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessorVersion - * @throws {Error} If the payload is not a 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.ProcessorVersion; - - /** - * Decodes a ProcessorVersion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessorVersion - * @throws {Error} If the payload is 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.ProcessorVersion; - - /** - * Verifies a ProcessorVersion message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProcessorVersion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessorVersion - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersion; - - /** - * Creates a plain object from a ProcessorVersion message. Also converts values to other types if specified. - * @param message ProcessorVersion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessorVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessorVersion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessorVersion - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ProcessorVersion { - - /** Properties of a DeprecationInfo. */ - interface IDeprecationInfo { - - /** DeprecationInfo deprecationTime */ - deprecationTime?: (google.protobuf.ITimestamp|null); - - /** DeprecationInfo replacementProcessorVersion */ - replacementProcessorVersion?: (string|null); - } - - /** Represents a DeprecationInfo. */ - class DeprecationInfo implements IDeprecationInfo { - - /** - * Constructs a new DeprecationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo); - - /** DeprecationInfo deprecationTime. */ - public deprecationTime?: (google.protobuf.ITimestamp|null); - - /** DeprecationInfo replacementProcessorVersion. */ - public replacementProcessorVersion: string; - - /** - * Creates a new DeprecationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns DeprecationInfo instance - */ - public static create(properties?: google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo): google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo; - - /** - * Encodes the specified DeprecationInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.verify|verify} messages. - * @param message DeprecationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeprecationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.verify|verify} messages. - * @param message DeprecationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeprecationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeprecationInfo - * @throws {Error} If the payload is not a 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.ProcessorVersion.DeprecationInfo; - - /** - * Decodes a DeprecationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeprecationInfo - * @throws {Error} If the payload is 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.ProcessorVersion.DeprecationInfo; - - /** - * Verifies a DeprecationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeprecationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeprecationInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo; - - /** - * Creates a plain object from a DeprecationInfo message. Also converts values to other types if specified. - * @param message DeprecationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeprecationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeprecationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenAiModelInfo. */ - interface IGenAiModelInfo { - - /** GenAiModelInfo foundationGenAiModelInfo */ - foundationGenAiModelInfo?: (google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null); - - /** GenAiModelInfo customGenAiModelInfo */ - customGenAiModelInfo?: (google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null); - } - - /** Represents a GenAiModelInfo. */ - class GenAiModelInfo implements IGenAiModelInfo { - - /** - * Constructs a new GenAiModelInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo); - - /** GenAiModelInfo foundationGenAiModelInfo. */ - public foundationGenAiModelInfo?: (google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null); - - /** GenAiModelInfo customGenAiModelInfo. */ - public customGenAiModelInfo?: (google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null); - - /** GenAiModelInfo modelInfo. */ - public modelInfo?: ("foundationGenAiModelInfo"|"customGenAiModelInfo"); - - /** - * Creates a new GenAiModelInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GenAiModelInfo instance - */ - public static create(properties?: google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo): google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo; - - /** - * Encodes the specified GenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.verify|verify} messages. - * @param message GenAiModelInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.verify|verify} messages. - * @param message GenAiModelInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenAiModelInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenAiModelInfo - * @throws {Error} If the payload is not a 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.ProcessorVersion.GenAiModelInfo; - - /** - * Decodes a GenAiModelInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenAiModelInfo - * @throws {Error} If the payload is 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.ProcessorVersion.GenAiModelInfo; - - /** - * Verifies a GenAiModelInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenAiModelInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenAiModelInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo; - - /** - * Creates a plain object from a GenAiModelInfo message. Also converts values to other types if specified. - * @param message GenAiModelInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenAiModelInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenAiModelInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GenAiModelInfo { - - /** Properties of a FoundationGenAiModelInfo. */ - interface IFoundationGenAiModelInfo { - - /** FoundationGenAiModelInfo finetuningAllowed */ - finetuningAllowed?: (boolean|null); - - /** FoundationGenAiModelInfo minTrainLabeledDocuments */ - minTrainLabeledDocuments?: (number|null); - } - - /** Represents a FoundationGenAiModelInfo. */ - class FoundationGenAiModelInfo implements IFoundationGenAiModelInfo { - - /** - * Constructs a new FoundationGenAiModelInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo); - - /** FoundationGenAiModelInfo finetuningAllowed. */ - public finetuningAllowed: boolean; - - /** FoundationGenAiModelInfo minTrainLabeledDocuments. */ - public minTrainLabeledDocuments: number; - - /** - * Creates a new FoundationGenAiModelInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FoundationGenAiModelInfo instance - */ - public static create(properties?: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo): google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; - - /** - * Encodes the specified FoundationGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. - * @param message FoundationGenAiModelInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FoundationGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. - * @param message FoundationGenAiModelInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FoundationGenAiModelInfo - * @throws {Error} If the payload is not a 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.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; - - /** - * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FoundationGenAiModelInfo - * @throws {Error} If the payload is 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.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; - - /** - * Verifies a FoundationGenAiModelInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FoundationGenAiModelInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FoundationGenAiModelInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; - - /** - * Creates a plain object from a FoundationGenAiModelInfo message. Also converts values to other types if specified. - * @param message FoundationGenAiModelInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FoundationGenAiModelInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FoundationGenAiModelInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomGenAiModelInfo. */ - interface ICustomGenAiModelInfo { - - /** CustomGenAiModelInfo customModelType */ - customModelType?: (google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|keyof typeof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|null); - - /** CustomGenAiModelInfo baseProcessorVersionId */ - baseProcessorVersionId?: (string|null); - } - - /** Represents a CustomGenAiModelInfo. */ - class CustomGenAiModelInfo implements ICustomGenAiModelInfo { - - /** - * Constructs a new CustomGenAiModelInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo); - - /** CustomGenAiModelInfo customModelType. */ - public customModelType: (google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|keyof typeof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType); - - /** CustomGenAiModelInfo baseProcessorVersionId. */ - public baseProcessorVersionId: string; - - /** - * Creates a new CustomGenAiModelInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomGenAiModelInfo instance - */ - public static create(properties?: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo): google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; - - /** - * Encodes the specified CustomGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. - * @param message CustomGenAiModelInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. - * @param message CustomGenAiModelInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomGenAiModelInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomGenAiModelInfo - * @throws {Error} If the payload is not a 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.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; - - /** - * Decodes a CustomGenAiModelInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomGenAiModelInfo - * @throws {Error} If the payload is 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.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; - - /** - * Verifies a CustomGenAiModelInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomGenAiModelInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomGenAiModelInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; - - /** - * Creates a plain object from a CustomGenAiModelInfo message. Also converts values to other types if specified. - * @param message CustomGenAiModelInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomGenAiModelInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomGenAiModelInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CustomGenAiModelInfo { - - /** CustomModelType enum. */ - enum CustomModelType { - CUSTOM_MODEL_TYPE_UNSPECIFIED = 0, - VERSIONED_FOUNDATION = 1, - FINE_TUNED = 2 - } - } - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - DEPLOYED = 1, - DEPLOYING = 2, - UNDEPLOYED = 3, - UNDEPLOYING = 4, - CREATING = 5, - DELETING = 6, - FAILED = 7, - IMPORTING = 8 - } - - /** ModelType enum. */ - enum ModelType { - MODEL_TYPE_UNSPECIFIED = 0, - MODEL_TYPE_GENERATIVE = 1, - MODEL_TYPE_CUSTOM = 2 - } - } - - /** Properties of a ProcessorVersionAlias. */ - interface IProcessorVersionAlias { - - /** ProcessorVersionAlias alias */ - alias?: (string|null); - - /** ProcessorVersionAlias processorVersion */ - processorVersion?: (string|null); - } - - /** Represents a ProcessorVersionAlias. */ - class ProcessorVersionAlias implements IProcessorVersionAlias { - - /** - * Constructs a new ProcessorVersionAlias. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IProcessorVersionAlias); - - /** ProcessorVersionAlias alias. */ - public alias: string; - - /** ProcessorVersionAlias processorVersion. */ - public processorVersion: string; - - /** - * Creates a new ProcessorVersionAlias instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessorVersionAlias instance - */ - public static create(properties?: google.cloud.documentai.v1.IProcessorVersionAlias): google.cloud.documentai.v1.ProcessorVersionAlias; - - /** - * Encodes the specified ProcessorVersionAlias message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersionAlias.verify|verify} messages. - * @param message ProcessorVersionAlias message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IProcessorVersionAlias, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessorVersionAlias message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersionAlias.verify|verify} messages. - * @param message ProcessorVersionAlias message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IProcessorVersionAlias, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessorVersionAlias message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessorVersionAlias - * @throws {Error} If the payload is not a 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.ProcessorVersionAlias; - - /** - * Decodes a ProcessorVersionAlias message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessorVersionAlias - * @throws {Error} If the payload is 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.ProcessorVersionAlias; - - /** - * Verifies a ProcessorVersionAlias message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProcessorVersionAlias message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessorVersionAlias - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorVersionAlias; - - /** - * Creates a plain object from a ProcessorVersionAlias message. Also converts values to other types if specified. - * @param message ProcessorVersionAlias - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessorVersionAlias, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessorVersionAlias to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessorVersionAlias - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Processor. */ - interface IProcessor { - - /** Processor name */ - name?: (string|null); - - /** Processor type */ - type?: (string|null); - - /** Processor displayName */ - displayName?: (string|null); - - /** Processor state */ - state?: (google.cloud.documentai.v1.Processor.State|keyof typeof google.cloud.documentai.v1.Processor.State|null); - - /** Processor defaultProcessorVersion */ - defaultProcessorVersion?: (string|null); - - /** Processor processorVersionAliases */ - processorVersionAliases?: (google.cloud.documentai.v1.IProcessorVersionAlias[]|null); - - /** Processor processEndpoint */ - processEndpoint?: (string|null); - - /** Processor createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Processor kmsKeyName */ - kmsKeyName?: (string|null); - - /** Processor satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Processor satisfiesPzi */ - satisfiesPzi?: (boolean|null); - } - - /** Represents a Processor. */ - class Processor implements IProcessor { - - /** - * Constructs a new Processor. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IProcessor); - - /** Processor name. */ - public name: string; - - /** Processor type. */ - public type: string; - - /** Processor displayName. */ - public displayName: string; - - /** Processor state. */ - public state: (google.cloud.documentai.v1.Processor.State|keyof typeof google.cloud.documentai.v1.Processor.State); - - /** Processor defaultProcessorVersion. */ - public defaultProcessorVersion: string; - - /** Processor processorVersionAliases. */ - public processorVersionAliases: google.cloud.documentai.v1.IProcessorVersionAlias[]; - - /** Processor processEndpoint. */ - public processEndpoint: string; - - /** Processor createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Processor kmsKeyName. */ - public kmsKeyName: string; - - /** Processor satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Processor satisfiesPzi. */ - public satisfiesPzi: boolean; - - /** - * Creates a new Processor instance using the specified properties. - * @param [properties] Properties to set - * @returns Processor instance - */ - public static create(properties?: google.cloud.documentai.v1.IProcessor): google.cloud.documentai.v1.Processor; - - /** - * Encodes the specified Processor message. Does not implicitly {@link google.cloud.documentai.v1.Processor.verify|verify} messages. - * @param message Processor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IProcessor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Processor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Processor.verify|verify} messages. - * @param message Processor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IProcessor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Processor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Processor - * @throws {Error} If the payload is not a 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.Processor; - - /** - * Decodes a Processor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Processor - * @throws {Error} If the payload is 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.Processor; - - /** - * Verifies a Processor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Processor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Processor - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.Processor; - - /** - * Creates a plain object from a Processor message. Also converts values to other types if specified. - * @param message Processor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.Processor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Processor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Processor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Processor { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ENABLED = 1, - DISABLED = 2, - ENABLING = 3, - DISABLING = 4, - CREATING = 5, - FAILED = 6, - DELETING = 7 - } - } - - /** Properties of a ProcessorType. */ - interface IProcessorType { - - /** ProcessorType name */ - name?: (string|null); - - /** ProcessorType type */ - type?: (string|null); - - /** ProcessorType category */ - category?: (string|null); - - /** ProcessorType availableLocations */ - availableLocations?: (google.cloud.documentai.v1.ProcessorType.ILocationInfo[]|null); - - /** ProcessorType allowCreation */ - allowCreation?: (boolean|null); - - /** ProcessorType launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ProcessorType sampleDocumentUris */ - sampleDocumentUris?: (string[]|null); - } - - /** Represents a ProcessorType. */ - class ProcessorType implements IProcessorType { - - /** - * Constructs a new ProcessorType. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.IProcessorType); - - /** ProcessorType name. */ - public name: string; - - /** ProcessorType type. */ - public type: string; - - /** ProcessorType category. */ - public category: string; - - /** ProcessorType availableLocations. */ - public availableLocations: google.cloud.documentai.v1.ProcessorType.ILocationInfo[]; - - /** ProcessorType allowCreation. */ - public allowCreation: boolean; - - /** ProcessorType launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ProcessorType sampleDocumentUris. */ - public sampleDocumentUris: string[]; - - /** - * Creates a new ProcessorType instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessorType instance - */ - public static create(properties?: google.cloud.documentai.v1.IProcessorType): google.cloud.documentai.v1.ProcessorType; - - /** - * Encodes the specified ProcessorType message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.verify|verify} messages. - * @param message ProcessorType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.IProcessorType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessorType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.verify|verify} messages. - * @param message ProcessorType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.IProcessorType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessorType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessorType - * @throws {Error} If the payload is not a 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.ProcessorType; - - /** - * Decodes a ProcessorType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessorType - * @throws {Error} If the payload is 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.ProcessorType; - - /** - * Verifies a ProcessorType message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProcessorType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessorType - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorType; - - /** - * Creates a plain object from a ProcessorType message. Also converts values to other types if specified. - * @param message ProcessorType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessorType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessorType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessorType - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ProcessorType { - - /** Properties of a LocationInfo. */ - interface ILocationInfo { - - /** LocationInfo locationId */ - locationId?: (string|null); - } - - /** Represents a LocationInfo. */ - class LocationInfo implements ILocationInfo { - - /** - * Constructs a new LocationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1.ProcessorType.ILocationInfo); - - /** LocationInfo locationId. */ - public locationId: string; - - /** - * Creates a new LocationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns LocationInfo instance - */ - public static create(properties?: google.cloud.documentai.v1.ProcessorType.ILocationInfo): google.cloud.documentai.v1.ProcessorType.LocationInfo; - - /** - * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.LocationInfo.verify|verify} messages. - * @param message LocationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1.ProcessorType.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.LocationInfo.verify|verify} messages. - * @param message LocationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1.ProcessorType.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LocationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LocationInfo - * @throws {Error} If the payload is not a 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.ProcessorType.LocationInfo; - - /** - * Decodes a LocationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LocationInfo - * @throws {Error} If the payload is 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.ProcessorType.LocationInfo; - - /** - * Verifies a LocationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocationInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1.ProcessorType.LocationInfo; - - /** - * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. - * @param message LocationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1.ProcessorType.LocationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LocationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LocationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Namespace v1beta3. */ - namespace v1beta3 { - - /** 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.v1beta3.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.v1beta3.IBarcode): google.cloud.documentai.v1beta3.Barcode; - - /** - * Encodes the specified Barcode message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.IBarcode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Barcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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 Dataset. */ - interface IDataset { - - /** Dataset gcsManagedConfig */ - gcsManagedConfig?: (google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig|null); - - /** Dataset documentWarehouseConfig */ - documentWarehouseConfig?: (google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig|null); - - /** Dataset unmanagedDatasetConfig */ - unmanagedDatasetConfig?: (google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null); - - /** Dataset name */ - name?: (string|null); - - /** Dataset state */ - state?: (google.cloud.documentai.v1beta3.Dataset.State|keyof typeof google.cloud.documentai.v1beta3.Dataset.State|null); - - /** Dataset satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Dataset satisfiesPzi */ - satisfiesPzi?: (boolean|null); - } - - /** Represents a Dataset. */ - class Dataset implements IDataset { - - /** - * Constructs a new Dataset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDataset); - - /** Dataset gcsManagedConfig. */ - public gcsManagedConfig?: (google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig|null); - - /** Dataset documentWarehouseConfig. */ - public documentWarehouseConfig?: (google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig|null); - - /** Dataset unmanagedDatasetConfig. */ - public unmanagedDatasetConfig?: (google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null); - - /** Dataset name. */ - public name: string; - - /** Dataset state. */ - public state: (google.cloud.documentai.v1beta3.Dataset.State|keyof typeof google.cloud.documentai.v1beta3.Dataset.State); - - /** Dataset satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Dataset satisfiesPzi. */ - public satisfiesPzi: boolean; - - /** Dataset storageSource. */ - public storageSource?: ("gcsManagedConfig"|"documentWarehouseConfig"|"unmanagedDatasetConfig"); - - /** - * Creates a new Dataset instance using the specified properties. - * @param [properties] Properties to set - * @returns Dataset instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDataset): google.cloud.documentai.v1beta3.Dataset; - - /** - * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.verify|verify} messages. - * @param message Dataset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.verify|verify} messages. - * @param message Dataset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Dataset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Dataset - * @throws {Error} If the payload is not a 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.v1beta3.Dataset; - - /** - * Decodes a Dataset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Dataset - * @throws {Error} If the payload is 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.v1beta3.Dataset; - - /** - * Verifies a Dataset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Dataset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Dataset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Dataset; - - /** - * Creates a plain object from a Dataset message. Also converts values to other types if specified. - * @param message Dataset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Dataset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Dataset - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Dataset { - - /** Properties of a GCSManagedConfig. */ - interface IGCSManagedConfig { - - /** GCSManagedConfig gcsPrefix */ - gcsPrefix?: (google.cloud.documentai.v1beta3.IGcsPrefix|null); - } - - /** Represents a GCSManagedConfig. */ - class GCSManagedConfig implements IGCSManagedConfig { - - /** - * Constructs a new GCSManagedConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig); - - /** GCSManagedConfig gcsPrefix. */ - public gcsPrefix?: (google.cloud.documentai.v1beta3.IGcsPrefix|null); - - /** - * Creates a new GCSManagedConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GCSManagedConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig): google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig; - - /** - * Encodes the specified GCSManagedConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.verify|verify} messages. - * @param message GCSManagedConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GCSManagedConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.verify|verify} messages. - * @param message GCSManagedConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GCSManagedConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GCSManagedConfig - * @throws {Error} If the payload is not a 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.v1beta3.Dataset.GCSManagedConfig; - - /** - * Decodes a GCSManagedConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GCSManagedConfig - * @throws {Error} If the payload is 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.v1beta3.Dataset.GCSManagedConfig; - - /** - * Verifies a GCSManagedConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GCSManagedConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GCSManagedConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig; - - /** - * Creates a plain object from a GCSManagedConfig message. Also converts values to other types if specified. - * @param message GCSManagedConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GCSManagedConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GCSManagedConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DocumentWarehouseConfig. */ - interface IDocumentWarehouseConfig { - - /** DocumentWarehouseConfig collection */ - collection?: (string|null); - - /** DocumentWarehouseConfig schema */ - schema?: (string|null); - } - - /** Represents a DocumentWarehouseConfig. */ - class DocumentWarehouseConfig implements IDocumentWarehouseConfig { - - /** - * Constructs a new DocumentWarehouseConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig); - - /** DocumentWarehouseConfig collection. */ - public collection: string; - - /** DocumentWarehouseConfig schema. */ - public schema: string; - - /** - * Creates a new DocumentWarehouseConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentWarehouseConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig): google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig; - - /** - * Encodes the specified DocumentWarehouseConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.verify|verify} messages. - * @param message DocumentWarehouseConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentWarehouseConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.verify|verify} messages. - * @param message DocumentWarehouseConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DocumentWarehouseConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DocumentWarehouseConfig - * @throws {Error} If the payload is not a 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.v1beta3.Dataset.DocumentWarehouseConfig; - - /** - * Decodes a DocumentWarehouseConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DocumentWarehouseConfig - * @throws {Error} If the payload is 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.v1beta3.Dataset.DocumentWarehouseConfig; - - /** - * Verifies a DocumentWarehouseConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DocumentWarehouseConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentWarehouseConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig; - - /** - * Creates a plain object from a DocumentWarehouseConfig message. Also converts values to other types if specified. - * @param message DocumentWarehouseConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentWarehouseConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DocumentWarehouseConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UnmanagedDatasetConfig. */ - interface IUnmanagedDatasetConfig { - } - - /** Represents an UnmanagedDatasetConfig. */ - class UnmanagedDatasetConfig implements IUnmanagedDatasetConfig { - - /** - * Constructs a new UnmanagedDatasetConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig); - - /** - * Creates a new UnmanagedDatasetConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns UnmanagedDatasetConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig): google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig; - - /** - * Encodes the specified UnmanagedDatasetConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.verify|verify} messages. - * @param message UnmanagedDatasetConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UnmanagedDatasetConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.verify|verify} messages. - * @param message UnmanagedDatasetConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UnmanagedDatasetConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UnmanagedDatasetConfig - * @throws {Error} If the payload is not a 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.v1beta3.Dataset.UnmanagedDatasetConfig; - - /** - * Decodes an UnmanagedDatasetConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UnmanagedDatasetConfig - * @throws {Error} If the payload is 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.v1beta3.Dataset.UnmanagedDatasetConfig; - - /** - * Verifies an UnmanagedDatasetConfig message. - * @param message Plain 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 UnmanagedDatasetConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UnmanagedDatasetConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig; - - /** - * Creates a plain object from an UnmanagedDatasetConfig message. Also converts values to other types if specified. - * @param message UnmanagedDatasetConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UnmanagedDatasetConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UnmanagedDatasetConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - UNINITIALIZED = 1, - INITIALIZING = 2, - INITIALIZED = 3 - } - } - - /** Properties of a DocumentId. */ - interface IDocumentId { - - /** DocumentId gcsManagedDocId */ - gcsManagedDocId?: (google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId|null); - - /** DocumentId unmanagedDocId */ - unmanagedDocId?: (google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId|null); - - /** DocumentId revisionRef */ - revisionRef?: (google.cloud.documentai.v1beta3.IRevisionRef|null); - } - - /** Represents a DocumentId. */ - class DocumentId implements IDocumentId { - - /** - * Constructs a new DocumentId. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDocumentId); - - /** DocumentId gcsManagedDocId. */ - public gcsManagedDocId?: (google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId|null); - - /** DocumentId unmanagedDocId. */ - public unmanagedDocId?: (google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId|null); - - /** DocumentId revisionRef. */ - public revisionRef?: (google.cloud.documentai.v1beta3.IRevisionRef|null); - - /** DocumentId type. */ - public type?: ("gcsManagedDocId"|"unmanagedDocId"); - - /** - * Creates a new DocumentId instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentId instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDocumentId): google.cloud.documentai.v1beta3.DocumentId; - - /** - * Encodes the specified DocumentId message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.verify|verify} messages. - * @param message DocumentId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDocumentId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentId message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.verify|verify} messages. - * @param message DocumentId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDocumentId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DocumentId message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DocumentId - * @throws {Error} If the payload is not a 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.v1beta3.DocumentId; - - /** - * Decodes a DocumentId message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DocumentId - * @throws {Error} If the payload is 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.v1beta3.DocumentId; - - /** - * Verifies a DocumentId message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DocumentId message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentId - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentId; - - /** - * Creates a plain object from a DocumentId message. Also converts values to other types if specified. - * @param message DocumentId - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DocumentId, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentId to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DocumentId - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DocumentId { - - /** Properties of a GCSManagedDocumentId. */ - interface IGCSManagedDocumentId { - - /** GCSManagedDocumentId gcsUri */ - gcsUri?: (string|null); - - /** GCSManagedDocumentId cwDocId */ - cwDocId?: (string|null); - } - - /** Represents a GCSManagedDocumentId. */ - class GCSManagedDocumentId implements IGCSManagedDocumentId { - - /** - * Constructs a new GCSManagedDocumentId. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId); - - /** GCSManagedDocumentId gcsUri. */ - public gcsUri: string; - - /** GCSManagedDocumentId cwDocId. */ - public cwDocId: string; - - /** - * Creates a new GCSManagedDocumentId instance using the specified properties. - * @param [properties] Properties to set - * @returns GCSManagedDocumentId instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId): google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId; - - /** - * Encodes the specified GCSManagedDocumentId message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.verify|verify} messages. - * @param message GCSManagedDocumentId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GCSManagedDocumentId message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.verify|verify} messages. - * @param message GCSManagedDocumentId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GCSManagedDocumentId message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GCSManagedDocumentId - * @throws {Error} If the payload is not a 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.v1beta3.DocumentId.GCSManagedDocumentId; - - /** - * Decodes a GCSManagedDocumentId message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GCSManagedDocumentId - * @throws {Error} If the payload is 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.v1beta3.DocumentId.GCSManagedDocumentId; - - /** - * Verifies a GCSManagedDocumentId message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GCSManagedDocumentId message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GCSManagedDocumentId - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId; - - /** - * Creates a plain object from a GCSManagedDocumentId message. Also converts values to other types if specified. - * @param message GCSManagedDocumentId - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GCSManagedDocumentId to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GCSManagedDocumentId - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UnmanagedDocumentId. */ - interface IUnmanagedDocumentId { - - /** UnmanagedDocumentId docId */ - docId?: (string|null); - } - - /** Represents an UnmanagedDocumentId. */ - class UnmanagedDocumentId implements IUnmanagedDocumentId { - - /** - * Constructs a new UnmanagedDocumentId. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId); - - /** UnmanagedDocumentId docId. */ - public docId: string; - - /** - * Creates a new UnmanagedDocumentId instance using the specified properties. - * @param [properties] Properties to set - * @returns UnmanagedDocumentId instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId): google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId; - - /** - * Encodes the specified UnmanagedDocumentId message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.verify|verify} messages. - * @param message UnmanagedDocumentId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UnmanagedDocumentId message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.verify|verify} messages. - * @param message UnmanagedDocumentId message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UnmanagedDocumentId message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UnmanagedDocumentId - * @throws {Error} If the payload is not a 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.v1beta3.DocumentId.UnmanagedDocumentId; - - /** - * Decodes an UnmanagedDocumentId message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UnmanagedDocumentId - * @throws {Error} If the payload is 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.v1beta3.DocumentId.UnmanagedDocumentId; - - /** - * Verifies an UnmanagedDocumentId message. - * @param message Plain 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 UnmanagedDocumentId message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UnmanagedDocumentId - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId; - - /** - * Creates a plain object from an UnmanagedDocumentId message. Also converts values to other types if specified. - * @param message UnmanagedDocumentId - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UnmanagedDocumentId to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UnmanagedDocumentId - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a DatasetSchema. */ - interface IDatasetSchema { - - /** DatasetSchema name */ - name?: (string|null); - - /** DatasetSchema documentSchema */ - documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); - - /** DatasetSchema satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** DatasetSchema satisfiesPzi */ - satisfiesPzi?: (boolean|null); - } - - /** Represents a DatasetSchema. */ - class DatasetSchema implements IDatasetSchema { - - /** - * Constructs a new DatasetSchema. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDatasetSchema); - - /** DatasetSchema name. */ - public name: string; - - /** DatasetSchema documentSchema. */ - public documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); - - /** DatasetSchema satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** DatasetSchema satisfiesPzi. */ - public satisfiesPzi: boolean; - - /** - * Creates a new DatasetSchema instance using the specified properties. - * @param [properties] Properties to set - * @returns DatasetSchema instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDatasetSchema): google.cloud.documentai.v1beta3.DatasetSchema; - - /** - * Encodes the specified DatasetSchema message. Does not implicitly {@link google.cloud.documentai.v1beta3.DatasetSchema.verify|verify} messages. - * @param message DatasetSchema message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDatasetSchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DatasetSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DatasetSchema.verify|verify} messages. - * @param message DatasetSchema message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDatasetSchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DatasetSchema message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DatasetSchema - * @throws {Error} If the payload is not a 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.v1beta3.DatasetSchema; - - /** - * Decodes a DatasetSchema message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DatasetSchema - * @throws {Error} If the payload is 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.v1beta3.DatasetSchema; - - /** - * Verifies a DatasetSchema message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DatasetSchema message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DatasetSchema - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DatasetSchema; - - /** - * Creates a plain object from a DatasetSchema message. Also converts values to other types if specified. - * @param message DatasetSchema - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DatasetSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DatasetSchema to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DatasetSchema - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchDatasetDocuments. */ - interface IBatchDatasetDocuments { - - /** BatchDatasetDocuments individualDocumentIds */ - individualDocumentIds?: (google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds|null); - - /** BatchDatasetDocuments filter */ - filter?: (string|null); - } - - /** Represents a BatchDatasetDocuments. */ - class BatchDatasetDocuments implements IBatchDatasetDocuments { - - /** - * Constructs a new BatchDatasetDocuments. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IBatchDatasetDocuments); - - /** BatchDatasetDocuments individualDocumentIds. */ - public individualDocumentIds?: (google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds|null); - - /** BatchDatasetDocuments filter. */ - public filter?: (string|null); - - /** BatchDatasetDocuments criteria. */ - public criteria?: ("individualDocumentIds"|"filter"); - - /** - * Creates a new BatchDatasetDocuments instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDatasetDocuments instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IBatchDatasetDocuments): google.cloud.documentai.v1beta3.BatchDatasetDocuments; - - /** - * Encodes the specified BatchDatasetDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.verify|verify} messages. - * @param message BatchDatasetDocuments message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IBatchDatasetDocuments, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchDatasetDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.verify|verify} messages. - * @param message BatchDatasetDocuments message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchDatasetDocuments, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchDatasetDocuments message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDatasetDocuments - * @throws {Error} If the payload is not a 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.v1beta3.BatchDatasetDocuments; - - /** - * Decodes a BatchDatasetDocuments message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDatasetDocuments - * @throws {Error} If the payload is 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.v1beta3.BatchDatasetDocuments; - - /** - * Verifies a BatchDatasetDocuments message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchDatasetDocuments message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDatasetDocuments - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDatasetDocuments; - - /** - * Creates a plain object from a BatchDatasetDocuments message. Also converts values to other types if specified. - * @param message BatchDatasetDocuments - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchDatasetDocuments, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchDatasetDocuments to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchDatasetDocuments - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BatchDatasetDocuments { - - /** Properties of an IndividualDocumentIds. */ - interface IIndividualDocumentIds { - - /** IndividualDocumentIds documentIds */ - documentIds?: (google.cloud.documentai.v1beta3.IDocumentId[]|null); - } - - /** Represents an IndividualDocumentIds. */ - class IndividualDocumentIds implements IIndividualDocumentIds { - - /** - * Constructs a new IndividualDocumentIds. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds); - - /** IndividualDocumentIds documentIds. */ - public documentIds: google.cloud.documentai.v1beta3.IDocumentId[]; - - /** - * Creates a new IndividualDocumentIds instance using the specified properties. - * @param [properties] Properties to set - * @returns IndividualDocumentIds instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds): google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds; - - /** - * Encodes the specified IndividualDocumentIds message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.verify|verify} messages. - * @param message IndividualDocumentIds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IndividualDocumentIds message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.verify|verify} messages. - * @param message IndividualDocumentIds message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IndividualDocumentIds message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndividualDocumentIds - * @throws {Error} If the payload is not a 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.v1beta3.BatchDatasetDocuments.IndividualDocumentIds; - - /** - * Decodes an IndividualDocumentIds message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndividualDocumentIds - * @throws {Error} If the payload is 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.v1beta3.BatchDatasetDocuments.IndividualDocumentIds; - - /** - * Verifies an IndividualDocumentIds message. - * @param message Plain 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 IndividualDocumentIds message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndividualDocumentIds - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds; - - /** - * Creates a plain object from an IndividualDocumentIds message. Also converts values to other types if specified. - * @param message IndividualDocumentIds - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndividualDocumentIds to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IndividualDocumentIds - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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.v1beta3.Document.IStyle[]|null); - - /** Document pages */ - pages?: (google.cloud.documentai.v1beta3.Document.IPage[]|null); - - /** Document entities */ - entities?: (google.cloud.documentai.v1beta3.Document.IEntity[]|null); - - /** Document entityRelations */ - entityRelations?: (google.cloud.documentai.v1beta3.Document.IEntityRelation[]|null); - - /** Document textChanges */ - textChanges?: (google.cloud.documentai.v1beta3.Document.ITextChange[]|null); - - /** Document shardInfo */ - shardInfo?: (google.cloud.documentai.v1beta3.Document.IShardInfo|null); - - /** Document error */ - error?: (google.rpc.IStatus|null); - - /** Document revisions */ - revisions?: (google.cloud.documentai.v1beta3.Document.IRevision[]|null); - - /** Document documentLayout */ - documentLayout?: (google.cloud.documentai.v1beta3.Document.IDocumentLayout|null); - - /** Document chunkedDocument */ - chunkedDocument?: (google.cloud.documentai.v1beta3.Document.IChunkedDocument|null); - - /** Document blobAssets */ - blobAssets?: (google.cloud.documentai.v1beta3.Document.IBlobAsset[]|null); - - /** Document entityValidationOutput */ - entityValidationOutput?: (google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null); - - /** Document entitiesRevisions */ - entitiesRevisions?: (google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.IStyle[]; - - /** Document pages. */ - public pages: google.cloud.documentai.v1beta3.Document.IPage[]; - - /** Document entities. */ - public entities: google.cloud.documentai.v1beta3.Document.IEntity[]; - - /** Document entityRelations. */ - public entityRelations: google.cloud.documentai.v1beta3.Document.IEntityRelation[]; - - /** Document textChanges. */ - public textChanges: google.cloud.documentai.v1beta3.Document.ITextChange[]; - - /** Document shardInfo. */ - public shardInfo?: (google.cloud.documentai.v1beta3.Document.IShardInfo|null); - - /** Document error. */ - public error?: (google.rpc.IStatus|null); - - /** Document revisions. */ - public revisions: google.cloud.documentai.v1beta3.Document.IRevision[]; - - /** Document documentLayout. */ - public documentLayout?: (google.cloud.documentai.v1beta3.Document.IDocumentLayout|null); - - /** Document chunkedDocument. */ - public chunkedDocument?: (google.cloud.documentai.v1beta3.Document.IChunkedDocument|null); - - /** Document blobAssets. */ - public blobAssets: google.cloud.documentai.v1beta3.Document.IBlobAsset[]; - - /** Document entityValidationOutput. */ - public entityValidationOutput?: (google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null); - - /** Document entitiesRevisions. */ - public entitiesRevisions: google.cloud.documentai.v1beta3.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.v1beta3.IDocument): google.cloud.documentai.v1beta3.Document; - - /** - * Encodes the specified Document message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IShardInfo): google.cloud.documentai.v1beta3.Document.ShardInfo; - - /** - * Encodes the specified ShardInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IShardInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ShardInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IStyle); - - /** Style textAnchor. */ - public textAnchor?: (google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.IStyle): google.cloud.documentai.v1beta3.Document.Style; - - /** - * Encodes the specified Style message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IStyle, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Style message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style.IFontSize): google.cloud.documentai.v1beta3.Document.Style.FontSize; - - /** - * Encodes the specified FontSize message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.IFontSize, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FontSize message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IImage|null); - - /** Page transforms */ - transforms?: (google.cloud.documentai.v1beta3.Document.Page.IMatrix[]|null); - - /** Page dimension */ - dimension?: (google.cloud.documentai.v1beta3.Document.Page.IDimension|null); - - /** Page layout */ - layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** Page detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - - /** Page blocks */ - blocks?: (google.cloud.documentai.v1beta3.Document.Page.IBlock[]|null); - - /** Page paragraphs */ - paragraphs?: (google.cloud.documentai.v1beta3.Document.Page.IParagraph[]|null); - - /** Page lines */ - lines?: (google.cloud.documentai.v1beta3.Document.Page.ILine[]|null); - - /** Page tokens */ - tokens?: (google.cloud.documentai.v1beta3.Document.Page.IToken[]|null); - - /** Page visualElements */ - visualElements?: (google.cloud.documentai.v1beta3.Document.Page.IVisualElement[]|null); - - /** Page tables */ - tables?: (google.cloud.documentai.v1beta3.Document.Page.ITable[]|null); - - /** Page formFields */ - formFields?: (google.cloud.documentai.v1beta3.Document.Page.IFormField[]|null); - - /** Page symbols */ - symbols?: (google.cloud.documentai.v1beta3.Document.Page.ISymbol[]|null); - - /** Page detectedBarcodes */ - detectedBarcodes?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode[]|null); - - /** Page imageQualityScores */ - imageQualityScores?: (google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores|null); - - /** Page provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - } - - /** Represents a Page. */ - class Page implements IPage { - - /** - * Constructs a new Page. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.IPage); - - /** Page pageNumber. */ - public pageNumber: number; - - /** Page image. */ - public image?: (google.cloud.documentai.v1beta3.Document.Page.IImage|null); - - /** Page transforms. */ - public transforms: google.cloud.documentai.v1beta3.Document.Page.IMatrix[]; - - /** Page dimension. */ - public dimension?: (google.cloud.documentai.v1beta3.Document.Page.IDimension|null); - - /** Page layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** Page detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - - /** Page blocks. */ - public blocks: google.cloud.documentai.v1beta3.Document.Page.IBlock[]; - - /** Page paragraphs. */ - public paragraphs: google.cloud.documentai.v1beta3.Document.Page.IParagraph[]; - - /** Page lines. */ - public lines: google.cloud.documentai.v1beta3.Document.Page.ILine[]; - - /** Page tokens. */ - public tokens: google.cloud.documentai.v1beta3.Document.Page.IToken[]; - - /** Page visualElements. */ - public visualElements: google.cloud.documentai.v1beta3.Document.Page.IVisualElement[]; - - /** Page tables. */ - public tables: google.cloud.documentai.v1beta3.Document.Page.ITable[]; - - /** Page formFields. */ - public formFields: google.cloud.documentai.v1beta3.Document.Page.IFormField[]; - - /** Page symbols. */ - public symbols: google.cloud.documentai.v1beta3.Document.Page.ISymbol[]; - - /** Page detectedBarcodes. */ - public detectedBarcodes: google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode[]; - - /** Page imageQualityScores. */ - public imageQualityScores?: (google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores|null); - - /** Page provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.IPage): google.cloud.documentai.v1beta3.Document.Page; - - /** - * Encodes the specified Page message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IPage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Page message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IDimension): google.cloud.documentai.v1beta3.Document.Page.Dimension; - - /** - * Encodes the specified Dimension message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IDimension, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Dimension message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IImage): google.cloud.documentai.v1beta3.Document.Page.Image; - - /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IImage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IMatrix): google.cloud.documentai.v1beta3.Document.Page.Matrix; - - /** - * Encodes the specified Matrix message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IMatrix, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Matrix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ITextAnchor|null); - - /** Layout confidence */ - confidence?: (number|null); - - /** Layout boundingPoly */ - boundingPoly?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); - - /** Layout orientation */ - orientation?: (google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout); - - /** Layout textAnchor. */ - public textAnchor?: (google.cloud.documentai.v1beta3.Document.ITextAnchor|null); - - /** Layout confidence. */ - public confidence: number; - - /** Layout boundingPoly. */ - public boundingPoly?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); - - /** Layout orientation. */ - public orientation: (google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout): google.cloud.documentai.v1beta3.Document.Page.Layout; - - /** - * Encodes the specified Layout message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Layout message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); - - /** Block detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - - /** Block provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - } - - /** Represents a Block. */ - class Block implements IBlock { - - /** - * Constructs a new Block. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IBlock); - - /** Block layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** Block detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - - /** Block provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IBlock): google.cloud.documentai.v1beta3.Document.Page.Block; - - /** - * Encodes the specified Block message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Block message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); - - /** Paragraph detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - - /** Paragraph provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - } - - /** Represents a Paragraph. */ - class Paragraph implements IParagraph { - - /** - * Constructs a new Paragraph. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IParagraph); - - /** Paragraph layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** Paragraph detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - - /** Paragraph provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IParagraph): google.cloud.documentai.v1beta3.Document.Page.Paragraph; - - /** - * Encodes the specified Paragraph message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IParagraph, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Paragraph message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); - - /** Line detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - - /** Line provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - } - - /** Represents a Line. */ - class Line implements ILine { - - /** - * Constructs a new Line. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.ILine); - - /** Line layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** Line detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - - /** Line provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILine): google.cloud.documentai.v1beta3.Document.Page.Line; - - /** - * Encodes the specified Line message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILine, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Line message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); - - /** Token detectedBreak */ - detectedBreak?: (google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak|null); - - /** Token detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - - /** Token provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - - /** Token styleInfo */ - styleInfo?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IToken); - - /** Token layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** Token detectedBreak. */ - public detectedBreak?: (google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak|null); - - /** Token detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - - /** Token provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - - /** Token styleInfo. */ - public styleInfo?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IToken): google.cloud.documentai.v1beta3.Document.Page.Token; - - /** - * Encodes the specified Token message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Token message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak.Type|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.IDetectedBreak); - - /** DetectedBreak type. */ - public type: (google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.IDetectedBreak): google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak; - - /** - * Encodes the specified DetectedBreak message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.IDetectedBreak, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DetectedBreak message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.IStyleInfo): google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo; - - /** - * Encodes the specified StyleInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.IStyleInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StyleInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); - - /** Symbol detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ISymbol); - - /** Symbol layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** Symbol detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ISymbol): google.cloud.documentai.v1beta3.Document.Page.Symbol; - - /** - * Encodes the specified Symbol message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ISymbol, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Symbol message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); - - /** VisualElement type */ - type?: (string|null); - - /** VisualElement detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IVisualElement); - - /** VisualElement layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** VisualElement type. */ - public type: string; - - /** VisualElement detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IVisualElement): google.cloud.documentai.v1beta3.Document.Page.VisualElement; - - /** - * Encodes the specified VisualElement message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IVisualElement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VisualElement message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); - - /** Table headerRows */ - headerRows?: (google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow[]|null); - - /** Table bodyRows */ - bodyRows?: (google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow[]|null); - - /** Table detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - - /** Table provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - } - - /** Represents a Table. */ - class Table implements ITable { - - /** - * Constructs a new Table. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.ITable); - - /** Table layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** Table headerRows. */ - public headerRows: google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow[]; - - /** Table bodyRows. */ - public bodyRows: google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow[]; - - /** Table detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - - /** Table provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ITable): google.cloud.documentai.v1beta3.Document.Page.Table; - - /** - * Encodes the specified Table message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ITable, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Table message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.ITableRow); - - /** TableRow cells. */ - public cells: google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.ITableRow): google.cloud.documentai.v1beta3.Document.Page.Table.TableRow; - - /** - * Encodes the specified TableRow message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.ITableRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TableRow message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); - - /** TableCell rowSpan */ - rowSpan?: (number|null); - - /** TableCell colSpan */ - colSpan?: (number|null); - - /** TableCell detectedLanguages */ - detectedLanguages?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.ITableCell); - - /** TableCell layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** TableCell rowSpan. */ - public rowSpan: number; - - /** TableCell colSpan. */ - public colSpan: number; - - /** TableCell detectedLanguages. */ - public detectedLanguages: google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.ITableCell): google.cloud.documentai.v1beta3.Document.Page.Table.TableCell; - - /** - * Encodes the specified TableCell message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.ITableCell, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TableCell message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); - - /** FormField fieldValue */ - fieldValue?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** FormField nameDetectedLanguages */ - nameDetectedLanguages?: (google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]|null); - - /** FormField valueDetectedLanguages */ - valueDetectedLanguages?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.IProvenance|null); - } - - /** Represents a FormField. */ - class FormField implements IFormField { - - /** - * Constructs a new FormField. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IFormField); - - /** FormField fieldName. */ - public fieldName?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** FormField fieldValue. */ - public fieldValue?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** FormField nameDetectedLanguages. */ - public nameDetectedLanguages: google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage[]; - - /** FormField valueDetectedLanguages. */ - public valueDetectedLanguages: google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IFormField): google.cloud.documentai.v1beta3.Document.Page.FormField; - - /** - * Encodes the specified FormField message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IFormField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FormField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ILayout|null); - - /** DetectedBarcode barcode */ - barcode?: (google.cloud.documentai.v1beta3.IBarcode|null); - } - - /** Represents a DetectedBarcode. */ - class DetectedBarcode implements IDetectedBarcode { - - /** - * Constructs a new DetectedBarcode. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode); - - /** DetectedBarcode layout. */ - public layout?: (google.cloud.documentai.v1beta3.Document.Page.ILayout|null); - - /** DetectedBarcode barcode. */ - public barcode?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IDetectedBarcode): google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode; - - /** - * Encodes the specified DetectedBarcode message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IDetectedBarcode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DetectedBarcode message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IDetectedLanguage): google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage; - - /** - * Encodes the specified DetectedLanguage message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IDetectedLanguage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DetectedLanguage message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.IImageQualityScores); - - /** ImageQualityScores qualityScore. */ - public qualityScore: number; - - /** ImageQualityScores detectedDefects. */ - public detectedDefects: google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IImageQualityScores): google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores; - - /** - * Encodes the specified ImageQualityScores message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IImageQualityScores, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImageQualityScores message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.IDetectedDefect): google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect; - - /** - * Encodes the specified DetectedDefect message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.IDetectedDefect, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DetectedDefect message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IPageAnchor|null); - - /** Entity id */ - id?: (string|null); - - /** Entity normalizedValue */ - normalizedValue?: (google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue|null); - - /** Entity properties */ - properties?: (google.cloud.documentai.v1beta3.Document.IEntity[]|null); - - /** Entity provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - - /** Entity redacted */ - redacted?: (boolean|null); - - /** Entity method */ - method?: (google.cloud.documentai.v1beta3.Document.Entity.Method|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntity); - - /** Entity textAnchor. */ - public textAnchor?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.IPageAnchor|null); - - /** Entity id. */ - public id: string; - - /** Entity normalizedValue. */ - public normalizedValue?: (google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue|null); - - /** Entity properties. */ - public properties: google.cloud.documentai.v1beta3.Document.IEntity[]; - - /** Entity provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - - /** Entity redacted. */ - public redacted: boolean; - - /** Entity method. */ - public method: (google.cloud.documentai.v1beta3.Document.Entity.Method|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntity): google.cloud.documentai.v1beta3.Document.Entity; - - /** - * Encodes the specified Entity message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.INormalizedValue): google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue; - - /** - * Encodes the specified NormalizedValue message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.INormalizedValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NormalizedValue message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IEntityRelation): google.cloud.documentai.v1beta3.Document.EntityRelation; - - /** - * Encodes the specified EntityRelation message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntityRelation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EntityRelation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ITextAnchor); - - /** TextAnchor textSegments. */ - public textSegments: google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextAnchor): google.cloud.documentai.v1beta3.Document.TextAnchor; - - /** - * Encodes the specified TextAnchor message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextAnchor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.ITextSegment): google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment; - - /** - * Encodes the specified TextSegment message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor.ITextSegment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextSegment message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IPageAnchor); - - /** PageAnchor pageRefs. */ - public pageRefs: google.cloud.documentai.v1beta3.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.v1beta3.Document.IPageAnchor): google.cloud.documentai.v1beta3.Document.PageAnchor; - - /** - * Encodes the specified PageAnchor message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IPageAnchor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PageAnchor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.PageRef.LayoutType|keyof typeof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType|null); - - /** PageRef layoutId */ - layoutId?: (string|null); - - /** PageRef boundingPoly */ - boundingPoly?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.IPageRef); - - /** PageRef page. */ - public page: (number|Long|string); - - /** PageRef layoutType. */ - public layoutType: (google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType|keyof typeof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType); - - /** PageRef layoutId. */ - public layoutId: string; - - /** PageRef boundingPoly. */ - public boundingPoly?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.IPageRef): google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef; - - /** - * Encodes the specified PageRef message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.IPageRef, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PageRef message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.IParent[]|null); - - /** Provenance type */ - type?: (google.cloud.documentai.v1beta3.Document.Provenance.OperationType|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.IProvenance); - - /** Provenance revision. */ - public revision: number; - - /** Provenance id. */ - public id: number; - - /** Provenance parents. */ - public parents: google.cloud.documentai.v1beta3.Document.Provenance.IParent[]; - - /** Provenance type. */ - public type: (google.cloud.documentai.v1beta3.Document.Provenance.OperationType|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.IProvenance): google.cloud.documentai.v1beta3.Document.Provenance; - - /** - * Encodes the specified Provenance message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IProvenance, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Provenance message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.IParent): google.cloud.documentai.v1beta3.Document.Provenance.Parent; - - /** - * Encodes the specified Parent message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.IParent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Parent message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IRevision): google.cloud.documentai.v1beta3.Document.Revision; - - /** - * Encodes the specified Revision message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Revision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.IHumanReview): google.cloud.documentai.v1beta3.Document.Revision.HumanReview; - - /** - * Encodes the specified HumanReview message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.IHumanReview, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HumanReview message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ITextAnchor|null); - - /** TextChange changedText */ - changedText?: (string|null); - - /** TextChange provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance[]|null); - } - - /** Represents a TextChange. */ - class TextChange implements ITextChange { - - /** - * Constructs a new TextChange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.ITextChange); - - /** TextChange textAnchor. */ - public textAnchor?: (google.cloud.documentai.v1beta3.Document.ITextAnchor|null); - - /** TextChange changedText. */ - public changedText: string; - - /** TextChange provenance. */ - public provenance: google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextChange): google.cloud.documentai.v1beta3.Document.TextChange; - - /** - * Encodes the specified TextChange message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextChange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextChange message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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 an Annotations. */ - interface IAnnotations { - - /** Annotations description */ - description?: (string|null); - } - - /** Represents an Annotations. */ - class Annotations implements IAnnotations { - - /** - * Constructs a new Annotations. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.IAnnotations); - - /** Annotations description. */ - public description: string; - - /** - * Creates a new Annotations instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotations instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.IAnnotations): google.cloud.documentai.v1beta3.Document.Annotations; - - /** - * Encodes the specified Annotations message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Annotations.verify|verify} messages. - * @param message Annotations message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Document.IAnnotations, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotations message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Annotations.verify|verify} messages. - * @param message Annotations message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.IAnnotations, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotations message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotations - * @throws {Error} If the payload is not a 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.v1beta3.Document.Annotations; - - /** - * Decodes an Annotations message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotations - * @throws {Error} If the payload is 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.v1beta3.Document.Annotations; - - /** - * Verifies an Annotations message. - * @param message Plain 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 Annotations message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotations - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.Annotations; - - /** - * Creates a plain object from an Annotations message. Also converts values to other types if specified. - * @param message Annotations - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Document.Annotations, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotations to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotations - * @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.v1beta3.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.v1beta3.Document.IDocumentLayout); - - /** DocumentLayout blocks. */ - public blocks: google.cloud.documentai.v1beta3.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.v1beta3.Document.IDocumentLayout): google.cloud.documentai.v1beta3.Document.DocumentLayout; - - /** - * Encodes the specified DocumentLayout message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IDocumentLayout, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentLayout message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null); - - /** DocumentLayoutBlock tableBlock */ - tableBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null); - - /** DocumentLayoutBlock listBlock */ - listBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null); - - /** DocumentLayoutBlock imageBlock */ - imageBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock|null); - - /** DocumentLayoutBlock blockId */ - blockId?: (string|null); - - /** DocumentLayoutBlock pageSpan */ - pageSpan?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null); - - /** DocumentLayoutBlock boundingBox */ - boundingBox?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); - } - - /** Represents a DocumentLayoutBlock. */ - class DocumentLayoutBlock implements IDocumentLayoutBlock { - - /** - * Constructs a new DocumentLayoutBlock. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.IDocumentLayoutBlock); - - /** DocumentLayoutBlock textBlock. */ - public textBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null); - - /** DocumentLayoutBlock tableBlock. */ - public tableBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null); - - /** DocumentLayoutBlock listBlock. */ - public listBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null); - - /** DocumentLayoutBlock imageBlock. */ - public imageBlock?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock|null); - - /** DocumentLayoutBlock blockId. */ - public blockId: string; - - /** DocumentLayoutBlock pageSpan. */ - public pageSpan?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null); - - /** DocumentLayoutBlock boundingBox. */ - public boundingBox?: (google.cloud.documentai.v1beta3.IBoundingPoly|null); - - /** DocumentLayoutBlock block. */ - public block?: ("textBlock"|"tableBlock"|"listBlock"|"imageBlock"); - - /** - * Creates a new DocumentLayoutBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentLayoutBlock instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.IDocumentLayoutBlock): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock; - - /** - * Encodes the specified DocumentLayoutBlock message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.IDocumentLayoutBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentLayoutBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan; - - /** - * Encodes the specified LayoutPageSpan message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutPageSpan message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.IDocumentLayoutBlock[]|null); - - /** LayoutTextBlock annotations */ - annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); - } - - /** Represents a LayoutTextBlock. */ - class LayoutTextBlock implements ILayoutTextBlock { - - /** - * Constructs a new LayoutTextBlock. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock); - - /** LayoutTextBlock text. */ - public text: string; - - /** LayoutTextBlock type. */ - public type: string; - - /** LayoutTextBlock blocks. */ - public blocks: google.cloud.documentai.v1beta3.Document.DocumentLayout.IDocumentLayoutBlock[]; - - /** LayoutTextBlock annotations. */ - public annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); - - /** - * Creates a new LayoutTextBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns LayoutTextBlock instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock; - - /** - * Encodes the specified LayoutTextBlock message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutTextBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]|null); - - /** LayoutTableBlock bodyRows */ - bodyRows?: (google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]|null); - - /** LayoutTableBlock caption */ - caption?: (string|null); - - /** LayoutTableBlock annotations */ - annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); - } - - /** Represents a LayoutTableBlock. */ - class LayoutTableBlock implements ILayoutTableBlock { - - /** - * Constructs a new LayoutTableBlock. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock); - - /** LayoutTableBlock headerRows. */ - public headerRows: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]; - - /** LayoutTableBlock bodyRows. */ - public bodyRows: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow[]; - - /** LayoutTableBlock caption. */ - public caption: string; - - /** LayoutTableBlock annotations. */ - public annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); - - /** - * Creates a new LayoutTableBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns LayoutTableBlock instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock; - - /** - * Encodes the specified LayoutTableBlock message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutTableBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow); - - /** LayoutTableRow cells. */ - public cells: google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow; - - /** - * Encodes the specified LayoutTableRow message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutTableRow message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell); - - /** LayoutTableCell blocks. */ - public blocks: google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell; - - /** - * Encodes the specified LayoutTableCell message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutTableCell message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock); - - /** LayoutListBlock listEntries. */ - public listEntries: google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock; - - /** - * Encodes the specified LayoutListBlock message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutListBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry); - - /** LayoutListEntry blocks. */ - public blocks: google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry; - - /** - * Encodes the specified LayoutListEntry message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutListEntry message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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 LayoutImageBlock. */ - interface ILayoutImageBlock { - - /** LayoutImageBlock blobAssetId */ - blobAssetId?: (string|null); - - /** LayoutImageBlock gcsUri */ - gcsUri?: (string|null); - - /** LayoutImageBlock dataUri */ - dataUri?: (string|null); - - /** LayoutImageBlock mimeType */ - mimeType?: (string|null); - - /** LayoutImageBlock imageText */ - imageText?: (string|null); - - /** LayoutImageBlock annotations */ - annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); - } - - /** Represents a LayoutImageBlock. */ - class LayoutImageBlock implements ILayoutImageBlock { - - /** - * Constructs a new LayoutImageBlock. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock); - - /** LayoutImageBlock blobAssetId. */ - public blobAssetId?: (string|null); - - /** LayoutImageBlock gcsUri. */ - public gcsUri?: (string|null); - - /** LayoutImageBlock dataUri. */ - public dataUri?: (string|null); - - /** LayoutImageBlock mimeType. */ - public mimeType: string; - - /** LayoutImageBlock imageText. */ - public imageText: string; - - /** LayoutImageBlock annotations. */ - public annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); - - /** LayoutImageBlock imageSource. */ - public imageSource?: ("blobAssetId"|"gcsUri"|"dataUri"); - - /** - * Creates a new LayoutImageBlock instance using the specified properties. - * @param [properties] Properties to set - * @returns LayoutImageBlock instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock; - - /** - * Encodes the specified LayoutImageBlock message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.verify|verify} messages. - * @param message LayoutImageBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutImageBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.verify|verify} messages. - * @param message LayoutImageBlock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LayoutImageBlock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LayoutImageBlock - * @throws {Error} If the payload is not a 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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock; - - /** - * Decodes a LayoutImageBlock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LayoutImageBlock - * @throws {Error} If the payload is 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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock; - - /** - * Verifies a LayoutImageBlock message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LayoutImageBlock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LayoutImageBlock - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock; - - /** - * Creates a plain object from a LayoutImageBlock message. Also converts values to other types if specified. - * @param message LayoutImageBlock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LayoutImageBlock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LayoutImageBlock - * @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.v1beta3.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.v1beta3.Document.IChunkedDocument); - - /** ChunkedDocument chunks. */ - public chunks: google.cloud.documentai.v1beta3.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.v1beta3.Document.IChunkedDocument): google.cloud.documentai.v1beta3.Document.ChunkedDocument; - - /** - * Encodes the specified ChunkedDocument message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IChunkedDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChunkedDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); - - /** Chunk pageHeaders */ - pageHeaders?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageHeader[]|null); - - /** Chunk pageFooters */ - pageFooters?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageFooter[]|null); - - /** Chunk chunkFields */ - chunkFields?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField[]|null); - } - - /** Represents a Chunk. */ - class Chunk implements IChunk { - - /** - * Constructs a new Chunk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null); - - /** Chunk pageHeaders. */ - public pageHeaders: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageHeader[]; - - /** Chunk pageFooters. */ - public pageFooters: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageFooter[]; - - /** Chunk chunkFields. */ - public chunkFields: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField[]; - - /** - * Creates a new Chunk instance using the specified properties. - * @param [properties] Properties to set - * @returns Chunk instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.IChunk): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk; - - /** - * Encodes the specified Chunk message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan; - - /** - * Encodes the specified ChunkPageSpan message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChunkPageSpan message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageHeader); - - /** ChunkPageHeader text. */ - public text: string; - - /** ChunkPageHeader pageSpan. */ - public pageSpan?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageHeader): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader; - - /** - * Encodes the specified ChunkPageHeader message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageHeader, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChunkPageHeader message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageFooter); - - /** ChunkPageFooter text. */ - public text: string; - - /** ChunkPageFooter pageSpan. */ - public pageSpan?: (google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageFooter): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter; - - /** - * Encodes the specified ChunkPageFooter message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageFooter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChunkPageFooter message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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 ImageChunkField. */ - interface IImageChunkField { - - /** ImageChunkField blobAssetId */ - blobAssetId?: (string|null); - - /** ImageChunkField gcsUri */ - gcsUri?: (string|null); - - /** ImageChunkField dataUri */ - dataUri?: (string|null); - - /** ImageChunkField annotations */ - annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); - } - - /** Represents an ImageChunkField. */ - class ImageChunkField implements IImageChunkField { - - /** - * Constructs a new ImageChunkField. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField); - - /** ImageChunkField blobAssetId. */ - public blobAssetId?: (string|null); - - /** ImageChunkField gcsUri. */ - public gcsUri?: (string|null); - - /** ImageChunkField dataUri. */ - public dataUri?: (string|null); - - /** ImageChunkField annotations. */ - public annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); - - /** ImageChunkField imageSource. */ - public imageSource?: ("blobAssetId"|"gcsUri"|"dataUri"); - - /** - * Creates a new ImageChunkField instance using the specified properties. - * @param [properties] Properties to set - * @returns ImageChunkField instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField; - - /** - * Encodes the specified ImageChunkField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.verify|verify} messages. - * @param message ImageChunkField message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImageChunkField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.verify|verify} messages. - * @param message ImageChunkField message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImageChunkField message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImageChunkField - * @throws {Error} If the payload is not a 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.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField; - - /** - * Decodes an ImageChunkField message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImageChunkField - * @throws {Error} If the payload is 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.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField; - - /** - * Verifies an ImageChunkField message. - * @param message Plain 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 ImageChunkField message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImageChunkField - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField; - - /** - * Creates a plain object from an ImageChunkField message. Also converts values to other types if specified. - * @param message ImageChunkField - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImageChunkField to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImageChunkField - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TableChunkField. */ - interface ITableChunkField { - - /** TableChunkField annotations */ - annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); - } - - /** Represents a TableChunkField. */ - class TableChunkField implements ITableChunkField { - - /** - * Constructs a new TableChunkField. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField); - - /** TableChunkField annotations. */ - public annotations?: (google.cloud.documentai.v1beta3.Document.IAnnotations|null); - - /** - * Creates a new TableChunkField instance using the specified properties. - * @param [properties] Properties to set - * @returns TableChunkField instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField; - - /** - * Encodes the specified TableChunkField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.verify|verify} messages. - * @param message TableChunkField message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TableChunkField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.verify|verify} messages. - * @param message TableChunkField message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TableChunkField message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TableChunkField - * @throws {Error} If the payload is not a 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.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField; - - /** - * Decodes a TableChunkField message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TableChunkField - * @throws {Error} If the payload is 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.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField; - - /** - * Verifies a TableChunkField message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TableChunkField message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TableChunkField - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField; - - /** - * Creates a plain object from a TableChunkField message. Also converts values to other types if specified. - * @param message TableChunkField - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TableChunkField to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TableChunkField - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ChunkField. */ - interface IChunkField { - - /** ChunkField imageChunkField */ - imageChunkField?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField|null); - - /** ChunkField tableChunkField */ - tableChunkField?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField|null); - } - - /** Represents a ChunkField. */ - class ChunkField implements IChunkField { - - /** - * Constructs a new ChunkField. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField); - - /** ChunkField imageChunkField. */ - public imageChunkField?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField|null); - - /** ChunkField tableChunkField. */ - public tableChunkField?: (google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField|null); - - /** ChunkField fieldType. */ - public fieldType?: ("imageChunkField"|"tableChunkField"); - - /** - * Creates a new ChunkField instance using the specified properties. - * @param [properties] Properties to set - * @returns ChunkField instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField; - - /** - * Encodes the specified ChunkField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.verify|verify} messages. - * @param message ChunkField message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChunkField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.verify|verify} messages. - * @param message ChunkField message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChunkField message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChunkField - * @throws {Error} If the payload is not a 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.v1beta3.Document.ChunkedDocument.Chunk.ChunkField; - - /** - * Decodes a ChunkField message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChunkField - * @throws {Error} If the payload is 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.v1beta3.Document.ChunkedDocument.Chunk.ChunkField; - - /** - * Verifies a ChunkField message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChunkField message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChunkField - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField; - - /** - * Creates a plain object from a ChunkField message. Also converts values to other types if specified. - * @param message ChunkField - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChunkField to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChunkField - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of a BlobAsset. */ - interface IBlobAsset { - - /** BlobAsset assetId */ - assetId?: (string|null); - - /** BlobAsset content */ - content?: (Uint8Array|Buffer|string|null); - - /** BlobAsset mimeType */ - mimeType?: (string|null); - } - - /** Represents a BlobAsset. */ - class BlobAsset implements IBlobAsset { - - /** - * Constructs a new BlobAsset. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.IBlobAsset); - - /** BlobAsset assetId. */ - public assetId: string; - - /** BlobAsset content. */ - public content: (Uint8Array|Buffer|string); - - /** BlobAsset mimeType. */ - public mimeType: string; - - /** - * Creates a new BlobAsset instance using the specified properties. - * @param [properties] Properties to set - * @returns BlobAsset instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Document.IBlobAsset): google.cloud.documentai.v1beta3.Document.BlobAsset; - - /** - * Encodes the specified BlobAsset message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.BlobAsset.verify|verify} messages. - * @param message BlobAsset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Document.IBlobAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BlobAsset message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.BlobAsset.verify|verify} messages. - * @param message BlobAsset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Document.IBlobAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BlobAsset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BlobAsset - * @throws {Error} If the payload is not a 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.v1beta3.Document.BlobAsset; - - /** - * Decodes a BlobAsset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BlobAsset - * @throws {Error} If the payload is 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.v1beta3.Document.BlobAsset; - - /** - * Verifies a BlobAsset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BlobAsset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BlobAsset - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Document.BlobAsset; - - /** - * Creates a plain object from a BlobAsset message. Also converts values to other types if specified. - * @param message BlobAsset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Document.BlobAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BlobAsset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BlobAsset - * @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.v1beta3.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.v1beta3.Document.IEntityValidationOutput); - - /** EntityValidationOutput validationResults. */ - public validationResults: google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntityValidationOutput): google.cloud.documentai.v1beta3.Document.EntityValidationOutput; - - /** - * Encodes the specified EntityValidationOutput message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntityValidationOutput, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EntityValidationOutput message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult.ValidationResultType|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.IValidationResult); - - /** ValidationResult ruleName. */ - public ruleName: string; - - /** ValidationResult ruleDescription. */ - public ruleDescription: string; - - /** ValidationResult validationResultType. */ - public validationResultType: (google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult.ValidationResultType|keyof typeof google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.IValidationResult): google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult; - - /** - * Encodes the specified ValidationResult message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.IValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValidationResult message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.IEntity[]|null); - - /** EntitiesRevision entityValidationOutput */ - entityValidationOutput?: (google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null); - - /** EntitiesRevision provenance */ - provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); - } - - /** Represents an EntitiesRevision. */ - class EntitiesRevision implements IEntitiesRevision { - - /** - * Constructs a new EntitiesRevision. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Document.IEntitiesRevision); - - /** EntitiesRevision revisionId. */ - public revisionId: string; - - /** EntitiesRevision entities. */ - public entities: google.cloud.documentai.v1beta3.Document.IEntity[]; - - /** EntitiesRevision entityValidationOutput. */ - public entityValidationOutput?: (google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null); - - /** EntitiesRevision provenance. */ - public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|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.v1beta3.Document.IEntitiesRevision): google.cloud.documentai.v1beta3.Document.EntitiesRevision; - - /** - * Encodes the specified EntitiesRevision message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.Document.IEntitiesRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EntitiesRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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 RevisionRef. */ - interface IRevisionRef { - - /** RevisionRef revisionCase */ - revisionCase?: (google.cloud.documentai.v1beta3.RevisionRef.RevisionCase|keyof typeof google.cloud.documentai.v1beta3.RevisionRef.RevisionCase|null); - - /** RevisionRef revisionId */ - revisionId?: (string|null); - - /** RevisionRef latestProcessorVersion */ - latestProcessorVersion?: (string|null); - } - - /** Represents a RevisionRef. */ - class RevisionRef implements IRevisionRef { - - /** - * Constructs a new RevisionRef. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IRevisionRef); - - /** RevisionRef revisionCase. */ - public revisionCase?: (google.cloud.documentai.v1beta3.RevisionRef.RevisionCase|keyof typeof google.cloud.documentai.v1beta3.RevisionRef.RevisionCase|null); - - /** RevisionRef revisionId. */ - public revisionId?: (string|null); - - /** RevisionRef latestProcessorVersion. */ - public latestProcessorVersion?: (string|null); - - /** RevisionRef source. */ - public source?: ("revisionCase"|"revisionId"|"latestProcessorVersion"); - - /** - * Creates a new RevisionRef instance using the specified properties. - * @param [properties] Properties to set - * @returns RevisionRef instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IRevisionRef): google.cloud.documentai.v1beta3.RevisionRef; - - /** - * Encodes the specified RevisionRef message. Does not implicitly {@link google.cloud.documentai.v1beta3.RevisionRef.verify|verify} messages. - * @param message RevisionRef message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IRevisionRef, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RevisionRef message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RevisionRef.verify|verify} messages. - * @param message RevisionRef message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IRevisionRef, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RevisionRef message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RevisionRef - * @throws {Error} If the payload is not a 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.v1beta3.RevisionRef; - - /** - * Decodes a RevisionRef message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RevisionRef - * @throws {Error} If the payload is 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.v1beta3.RevisionRef; - - /** - * Verifies a RevisionRef message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RevisionRef message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RevisionRef - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.RevisionRef; - - /** - * Creates a plain object from a RevisionRef message. Also converts values to other types if specified. - * @param message RevisionRef - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.RevisionRef, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RevisionRef to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RevisionRef - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RevisionRef { - - /** RevisionCase enum. */ - enum RevisionCase { - REVISION_CASE_UNSPECIFIED = 0, - LATEST_HUMAN_REVIEW = 1, - LATEST_TIMESTAMP = 2, - BASE_OCR_REVISION = 3 - } - } - - /** 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.v1beta3.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.v1beta3.IVertex): google.cloud.documentai.v1beta3.Vertex; - - /** - * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.IVertex, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Vertex message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.INormalizedVertex): google.cloud.documentai.v1beta3.NormalizedVertex; - - /** - * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.INormalizedVertex, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NormalizedVertex message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.IVertex[]|null); - - /** BoundingPoly normalizedVertices */ - normalizedVertices?: (google.cloud.documentai.v1beta3.INormalizedVertex[]|null); - } - - /** Represents a BoundingPoly. */ - class BoundingPoly implements IBoundingPoly { - - /** - * Constructs a new BoundingPoly. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IBoundingPoly); - - /** BoundingPoly vertices. */ - public vertices: google.cloud.documentai.v1beta3.IVertex[]; - - /** BoundingPoly normalizedVertices. */ - public normalizedVertices: google.cloud.documentai.v1beta3.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.v1beta3.IBoundingPoly): google.cloud.documentai.v1beta3.BoundingPoly; - - /** - * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.IBoundingPoly, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoundingPoly message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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; - } - - /** Properties of a Documents. */ - interface IDocuments { - - /** Documents documents */ - documents?: (google.cloud.documentai.v1beta3.IDocument[]|null); - } - - /** Represents a Documents. */ - class Documents implements IDocuments { - - /** - * Constructs a new Documents. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDocuments); - - /** Documents documents. */ - public documents: google.cloud.documentai.v1beta3.IDocument[]; - - /** - * Creates a new Documents instance using the specified properties. - * @param [properties] Properties to set - * @returns Documents instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDocuments): google.cloud.documentai.v1beta3.Documents; - - /** - * Encodes the specified Documents message. Does not implicitly {@link google.cloud.documentai.v1beta3.Documents.verify|verify} messages. - * @param message Documents message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDocuments, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Documents message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Documents.verify|verify} messages. - * @param message Documents message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDocuments, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Documents message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Documents - * @throws {Error} If the payload is not a 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.v1beta3.Documents; - - /** - * Decodes a Documents message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Documents - * @throws {Error} If the payload is 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.v1beta3.Documents; - - /** - * Verifies a Documents message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Documents message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Documents - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Documents; - - /** - * Creates a plain object from a Documents message. Also converts values to other types if specified. - * @param message Documents - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Documents, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Documents to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Documents - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RawDocument. */ - interface IRawDocument { - - /** RawDocument content */ - content?: (Uint8Array|Buffer|string|null); - - /** RawDocument mimeType */ - mimeType?: (string|null); - - /** RawDocument displayName */ - displayName?: (string|null); - } - - /** Represents a RawDocument. */ - class RawDocument implements IRawDocument { - - /** - * Constructs a new RawDocument. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IRawDocument); - - /** RawDocument content. */ - public content: (Uint8Array|Buffer|string); - - /** RawDocument mimeType. */ - public mimeType: string; - - /** RawDocument displayName. */ - public displayName: string; - - /** - * Creates a new RawDocument instance using the specified properties. - * @param [properties] Properties to set - * @returns RawDocument instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IRawDocument): google.cloud.documentai.v1beta3.RawDocument; - - /** - * Encodes the specified RawDocument message. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocument.verify|verify} messages. - * @param message RawDocument message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IRawDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RawDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocument.verify|verify} messages. - * @param message RawDocument message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IRawDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RawDocument message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RawDocument - * @throws {Error} If the payload is not a 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.v1beta3.RawDocument; - - /** - * Decodes a RawDocument message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RawDocument - * @throws {Error} If the payload is 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.v1beta3.RawDocument; - - /** - * Verifies a RawDocument message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RawDocument message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RawDocument - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.RawDocument; - - /** - * Creates a plain object from a RawDocument message. Also converts values to other types if specified. - * @param message RawDocument - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.RawDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RawDocument to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RawDocument - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GcsDocument. */ - interface IGcsDocument { - - /** GcsDocument gcsUri */ - gcsUri?: (string|null); - - /** GcsDocument mimeType */ - mimeType?: (string|null); - } - - /** Represents a GcsDocument. */ - class GcsDocument implements IGcsDocument { - - /** - * Constructs a new GcsDocument. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGcsDocument); - - /** GcsDocument gcsUri. */ - public gcsUri: string; - - /** GcsDocument mimeType. */ - public mimeType: string; - - /** - * Creates a new GcsDocument instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsDocument instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IGcsDocument): google.cloud.documentai.v1beta3.GcsDocument; - - /** - * Encodes the specified GcsDocument message. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocument.verify|verify} messages. - * @param message GcsDocument message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IGcsDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocument.verify|verify} messages. - * @param message GcsDocument message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGcsDocument, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsDocument message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsDocument - * @throws {Error} If the payload is not a 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.v1beta3.GcsDocument; - - /** - * Decodes a GcsDocument message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsDocument - * @throws {Error} If the payload is 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.v1beta3.GcsDocument; - - /** - * Verifies a GcsDocument message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcsDocument message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsDocument - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GcsDocument; - - /** - * Creates a plain object from a GcsDocument message. Also converts values to other types if specified. - * @param message GcsDocument - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.GcsDocument, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsDocument to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsDocument - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GcsDocuments. */ - interface IGcsDocuments { - - /** GcsDocuments documents */ - documents?: (google.cloud.documentai.v1beta3.IGcsDocument[]|null); - } - - /** Represents a GcsDocuments. */ - class GcsDocuments implements IGcsDocuments { - - /** - * Constructs a new GcsDocuments. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGcsDocuments); - - /** GcsDocuments documents. */ - public documents: google.cloud.documentai.v1beta3.IGcsDocument[]; - - /** - * Creates a new GcsDocuments instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsDocuments instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IGcsDocuments): google.cloud.documentai.v1beta3.GcsDocuments; - - /** - * Encodes the specified GcsDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocuments.verify|verify} messages. - * @param message GcsDocuments message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IGcsDocuments, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocuments.verify|verify} messages. - * @param message GcsDocuments message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGcsDocuments, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsDocuments message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsDocuments - * @throws {Error} If the payload is not a 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.v1beta3.GcsDocuments; - - /** - * Decodes a GcsDocuments message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsDocuments - * @throws {Error} If the payload is 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.v1beta3.GcsDocuments; - - /** - * Verifies a GcsDocuments message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcsDocuments message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsDocuments - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GcsDocuments; - - /** - * Creates a plain object from a GcsDocuments message. Also converts values to other types if specified. - * @param message GcsDocuments - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.GcsDocuments, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsDocuments to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsDocuments - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GcsPrefix. */ - interface IGcsPrefix { - - /** GcsPrefix gcsUriPrefix */ - gcsUriPrefix?: (string|null); - } - - /** Represents a GcsPrefix. */ - class GcsPrefix implements IGcsPrefix { - - /** - * Constructs a new GcsPrefix. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGcsPrefix); - - /** GcsPrefix gcsUriPrefix. */ - public gcsUriPrefix: string; - - /** - * Creates a new GcsPrefix instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsPrefix instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IGcsPrefix): google.cloud.documentai.v1beta3.GcsPrefix; - - /** - * Encodes the specified GcsPrefix message. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsPrefix.verify|verify} messages. - * @param message GcsPrefix message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IGcsPrefix, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsPrefix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsPrefix.verify|verify} messages. - * @param message GcsPrefix message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGcsPrefix, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsPrefix message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsPrefix - * @throws {Error} If the payload is not a 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.v1beta3.GcsPrefix; - - /** - * Decodes a GcsPrefix message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsPrefix - * @throws {Error} If the payload is 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.v1beta3.GcsPrefix; - - /** - * Verifies a GcsPrefix message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcsPrefix message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsPrefix - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GcsPrefix; - - /** - * Creates a plain object from a GcsPrefix message. Also converts values to other types if specified. - * @param message GcsPrefix - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.GcsPrefix, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsPrefix to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsPrefix - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RawDocuments. */ - interface IRawDocuments { - - /** RawDocuments documents */ - documents?: (google.cloud.documentai.v1beta3.IRawDocument[]|null); - } - - /** Represents a RawDocuments. */ - class RawDocuments implements IRawDocuments { - - /** - * Constructs a new RawDocuments. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IRawDocuments); - - /** RawDocuments documents. */ - public documents: google.cloud.documentai.v1beta3.IRawDocument[]; - - /** - * Creates a new RawDocuments instance using the specified properties. - * @param [properties] Properties to set - * @returns RawDocuments instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IRawDocuments): google.cloud.documentai.v1beta3.RawDocuments; - - /** - * Encodes the specified RawDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocuments.verify|verify} messages. - * @param message RawDocuments message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IRawDocuments, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RawDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocuments.verify|verify} messages. - * @param message RawDocuments message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IRawDocuments, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RawDocuments message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RawDocuments - * @throws {Error} If the payload is not a 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.v1beta3.RawDocuments; - - /** - * Decodes a RawDocuments message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RawDocuments - * @throws {Error} If the payload is 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.v1beta3.RawDocuments; - - /** - * Verifies a RawDocuments message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RawDocuments message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RawDocuments - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.RawDocuments; - - /** - * Creates a plain object from a RawDocuments message. Also converts values to other types if specified. - * @param message RawDocuments - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.RawDocuments, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RawDocuments to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RawDocuments - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchDocumentsInputConfig. */ - interface IBatchDocumentsInputConfig { - - /** BatchDocumentsInputConfig gcsPrefix */ - gcsPrefix?: (google.cloud.documentai.v1beta3.IGcsPrefix|null); - - /** BatchDocumentsInputConfig gcsDocuments */ - gcsDocuments?: (google.cloud.documentai.v1beta3.IGcsDocuments|null); - } - - /** Represents a BatchDocumentsInputConfig. */ - class BatchDocumentsInputConfig implements IBatchDocumentsInputConfig { - - /** - * Constructs a new BatchDocumentsInputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig); - - /** BatchDocumentsInputConfig gcsPrefix. */ - public gcsPrefix?: (google.cloud.documentai.v1beta3.IGcsPrefix|null); - - /** BatchDocumentsInputConfig gcsDocuments. */ - public gcsDocuments?: (google.cloud.documentai.v1beta3.IGcsDocuments|null); - - /** BatchDocumentsInputConfig source. */ - public source?: ("gcsPrefix"|"gcsDocuments"); - - /** - * Creates a new BatchDocumentsInputConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDocumentsInputConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig): google.cloud.documentai.v1beta3.BatchDocumentsInputConfig; - - /** - * Encodes the specified BatchDocumentsInputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify|verify} messages. - * @param message BatchDocumentsInputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchDocumentsInputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify|verify} messages. - * @param message BatchDocumentsInputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDocumentsInputConfig - * @throws {Error} If the payload is not a 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.v1beta3.BatchDocumentsInputConfig; - - /** - * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDocumentsInputConfig - * @throws {Error} If the payload is 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.v1beta3.BatchDocumentsInputConfig; - - /** - * Verifies a BatchDocumentsInputConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchDocumentsInputConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDocumentsInputConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDocumentsInputConfig; - - /** - * Creates a plain object from a BatchDocumentsInputConfig message. Also converts values to other types if specified. - * @param message BatchDocumentsInputConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchDocumentsInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchDocumentsInputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchDocumentsInputConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DocumentOutputConfig. */ - interface IDocumentOutputConfig { - - /** DocumentOutputConfig gcsOutputConfig */ - gcsOutputConfig?: (google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null); - } - - /** Represents a DocumentOutputConfig. */ - class DocumentOutputConfig implements IDocumentOutputConfig { - - /** - * Constructs a new DocumentOutputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDocumentOutputConfig); - - /** DocumentOutputConfig gcsOutputConfig. */ - public gcsOutputConfig?: (google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null); - - /** DocumentOutputConfig destination. */ - public destination?: "gcsOutputConfig"; - - /** - * Creates a new DocumentOutputConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentOutputConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDocumentOutputConfig): google.cloud.documentai.v1beta3.DocumentOutputConfig; - - /** - * Encodes the specified DocumentOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.verify|verify} messages. - * @param message DocumentOutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.verify|verify} messages. - * @param message DocumentOutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDocumentOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DocumentOutputConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DocumentOutputConfig - * @throws {Error} If the payload is not a 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.v1beta3.DocumentOutputConfig; - - /** - * Decodes a DocumentOutputConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DocumentOutputConfig - * @throws {Error} If the payload is 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.v1beta3.DocumentOutputConfig; - - /** - * Verifies a DocumentOutputConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DocumentOutputConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentOutputConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentOutputConfig; - - /** - * Creates a plain object from a DocumentOutputConfig message. Also converts values to other types if specified. - * @param message DocumentOutputConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DocumentOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentOutputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DocumentOutputConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DocumentOutputConfig { - - /** Properties of a GcsOutputConfig. */ - interface IGcsOutputConfig { - - /** GcsOutputConfig gcsUri */ - gcsUri?: (string|null); - - /** GcsOutputConfig fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - - /** GcsOutputConfig shardingConfig */ - shardingConfig?: (google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null); - } - - /** Represents a GcsOutputConfig. */ - class GcsOutputConfig implements IGcsOutputConfig { - - /** - * Constructs a new GcsOutputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig); - - /** GcsOutputConfig gcsUri. */ - public gcsUri: string; - - /** GcsOutputConfig fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** GcsOutputConfig shardingConfig. */ - public shardingConfig?: (google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null); - - /** - * Creates a new GcsOutputConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsOutputConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig; - - /** - * Encodes the specified GcsOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. - * @param message GcsOutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. - * @param message GcsOutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcsOutputConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsOutputConfig - * @throws {Error} If the payload is not a 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.v1beta3.DocumentOutputConfig.GcsOutputConfig; - - /** - * Decodes a GcsOutputConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsOutputConfig - * @throws {Error} If the payload is 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.v1beta3.DocumentOutputConfig.GcsOutputConfig; - - /** - * Verifies a GcsOutputConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcsOutputConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsOutputConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig; - - /** - * Creates a plain object from a GcsOutputConfig message. Also converts values to other types if specified. - * @param message GcsOutputConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcsOutputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcsOutputConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GcsOutputConfig { - - /** Properties of a ShardingConfig. */ - interface IShardingConfig { - - /** ShardingConfig pagesPerShard */ - pagesPerShard?: (number|null); - - /** ShardingConfig pagesOverlap */ - pagesOverlap?: (number|null); - } - - /** Represents a ShardingConfig. */ - class ShardingConfig implements IShardingConfig { - - /** - * Constructs a new ShardingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig); - - /** ShardingConfig pagesPerShard. */ - public pagesPerShard: number; - - /** ShardingConfig pagesOverlap. */ - public pagesOverlap: number; - - /** - * Creates a new ShardingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ShardingConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; - - /** - * Encodes the specified ShardingConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. - * @param message ShardingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ShardingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. - * @param message ShardingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ShardingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ShardingConfig - * @throws {Error} If the payload is not a 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.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; - - /** - * Decodes a ShardingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ShardingConfig - * @throws {Error} If the payload is 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.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; - - /** - * Verifies a ShardingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ShardingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ShardingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig; - - /** - * Creates a plain object from a ShardingConfig message. Also converts values to other types if specified. - * @param message ShardingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ShardingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ShardingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of an OcrConfig. */ - interface IOcrConfig { - - /** OcrConfig hints */ - hints?: (google.cloud.documentai.v1beta3.OcrConfig.IHints|null); - - /** OcrConfig enableNativePdfParsing */ - enableNativePdfParsing?: (boolean|null); - - /** OcrConfig enableImageQualityScores */ - enableImageQualityScores?: (boolean|null); - - /** OcrConfig advancedOcrOptions */ - advancedOcrOptions?: (string[]|null); - - /** OcrConfig enableSymbol */ - enableSymbol?: (boolean|null); - - /** OcrConfig computeStyleInfo */ - computeStyleInfo?: (boolean|null); - - /** OcrConfig disableCharacterBoxesDetection */ - disableCharacterBoxesDetection?: (boolean|null); - - /** OcrConfig premiumFeatures */ - premiumFeatures?: (google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures|null); - } - - /** Represents an OcrConfig. */ - class OcrConfig implements IOcrConfig { - - /** - * Constructs a new OcrConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IOcrConfig); - - /** OcrConfig hints. */ - public hints?: (google.cloud.documentai.v1beta3.OcrConfig.IHints|null); - - /** OcrConfig enableNativePdfParsing. */ - public enableNativePdfParsing: boolean; - - /** OcrConfig enableImageQualityScores. */ - public enableImageQualityScores: boolean; - - /** OcrConfig advancedOcrOptions. */ - public advancedOcrOptions: string[]; - - /** OcrConfig enableSymbol. */ - public enableSymbol: boolean; - - /** OcrConfig computeStyleInfo. */ - public computeStyleInfo: boolean; - - /** OcrConfig disableCharacterBoxesDetection. */ - public disableCharacterBoxesDetection: boolean; - - /** OcrConfig premiumFeatures. */ - public premiumFeatures?: (google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures|null); - - /** - * Creates a new OcrConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns OcrConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IOcrConfig): google.cloud.documentai.v1beta3.OcrConfig; - - /** - * Encodes the specified OcrConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. - * @param message OcrConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IOcrConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OcrConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. - * @param message OcrConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IOcrConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OcrConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OcrConfig - * @throws {Error} If the payload is not a 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.v1beta3.OcrConfig; - - /** - * Decodes an OcrConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OcrConfig - * @throws {Error} If the payload is 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.v1beta3.OcrConfig; - - /** - * Verifies an OcrConfig message. - * @param message Plain 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 OcrConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OcrConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.OcrConfig; - - /** - * Creates a plain object from an OcrConfig message. Also converts values to other types if specified. - * @param message OcrConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.OcrConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OcrConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OcrConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace OcrConfig { - - /** Properties of a Hints. */ - interface IHints { - - /** Hints languageHints */ - languageHints?: (string[]|null); - } - - /** Represents a Hints. */ - class Hints implements IHints { - - /** - * Constructs a new Hints. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.OcrConfig.IHints); - - /** Hints languageHints. */ - public languageHints: string[]; - - /** - * Creates a new Hints instance using the specified properties. - * @param [properties] Properties to set - * @returns Hints instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.OcrConfig.IHints): google.cloud.documentai.v1beta3.OcrConfig.Hints; - - /** - * Encodes the specified Hints message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.Hints.verify|verify} messages. - * @param message Hints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.OcrConfig.IHints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Hints message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.Hints.verify|verify} messages. - * @param message Hints message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.OcrConfig.IHints, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Hints message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Hints - * @throws {Error} If the payload is not a 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.v1beta3.OcrConfig.Hints; - - /** - * Decodes a Hints message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Hints - * @throws {Error} If the payload is 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.v1beta3.OcrConfig.Hints; - - /** - * Verifies a Hints message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Hints message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Hints - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.OcrConfig.Hints; - - /** - * Creates a plain object from a Hints message. Also converts values to other types if specified. - * @param message Hints - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.OcrConfig.Hints, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Hints to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Hints - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PremiumFeatures. */ - interface IPremiumFeatures { - - /** PremiumFeatures enableSelectionMarkDetection */ - enableSelectionMarkDetection?: (boolean|null); - - /** PremiumFeatures computeStyleInfo */ - computeStyleInfo?: (boolean|null); - - /** PremiumFeatures enableMathOcr */ - enableMathOcr?: (boolean|null); - } - - /** Represents a PremiumFeatures. */ - class PremiumFeatures implements IPremiumFeatures { - - /** - * Constructs a new PremiumFeatures. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures); - - /** PremiumFeatures enableSelectionMarkDetection. */ - public enableSelectionMarkDetection: boolean; - - /** PremiumFeatures computeStyleInfo. */ - public computeStyleInfo: boolean; - - /** PremiumFeatures enableMathOcr. */ - public enableMathOcr: boolean; - - /** - * Creates a new PremiumFeatures instance using the specified properties. - * @param [properties] Properties to set - * @returns PremiumFeatures instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures): google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures; - - /** - * Encodes the specified PremiumFeatures message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify|verify} messages. - * @param message PremiumFeatures message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PremiumFeatures message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify|verify} messages. - * @param message PremiumFeatures message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PremiumFeatures message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PremiumFeatures - * @throws {Error} If the payload is not a 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.v1beta3.OcrConfig.PremiumFeatures; - - /** - * Decodes a PremiumFeatures message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PremiumFeatures - * @throws {Error} If the payload is 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.v1beta3.OcrConfig.PremiumFeatures; - - /** - * Verifies a PremiumFeatures message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PremiumFeatures message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PremiumFeatures - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures; - - /** - * Creates a plain object from a PremiumFeatures message. Also converts values to other types if specified. - * @param message PremiumFeatures - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PremiumFeatures to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PremiumFeatures - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SummaryOptions. */ - interface ISummaryOptions { - - /** SummaryOptions length */ - length?: (google.cloud.documentai.v1beta3.SummaryOptions.Length|keyof typeof google.cloud.documentai.v1beta3.SummaryOptions.Length|null); - - /** SummaryOptions format */ - format?: (google.cloud.documentai.v1beta3.SummaryOptions.Format|keyof typeof google.cloud.documentai.v1beta3.SummaryOptions.Format|null); - } - - /** Represents a SummaryOptions. */ - class SummaryOptions implements ISummaryOptions { - - /** - * Constructs a new SummaryOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ISummaryOptions); - - /** SummaryOptions length. */ - public length: (google.cloud.documentai.v1beta3.SummaryOptions.Length|keyof typeof google.cloud.documentai.v1beta3.SummaryOptions.Length); - - /** SummaryOptions format. */ - public format: (google.cloud.documentai.v1beta3.SummaryOptions.Format|keyof typeof google.cloud.documentai.v1beta3.SummaryOptions.Format); - - /** - * Creates a new SummaryOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns SummaryOptions instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ISummaryOptions): google.cloud.documentai.v1beta3.SummaryOptions; - - /** - * Encodes the specified SummaryOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.SummaryOptions.verify|verify} messages. - * @param message SummaryOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ISummaryOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SummaryOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SummaryOptions.verify|verify} messages. - * @param message SummaryOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ISummaryOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SummaryOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SummaryOptions - * @throws {Error} If the payload is not a 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.v1beta3.SummaryOptions; - - /** - * Decodes a SummaryOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SummaryOptions - * @throws {Error} If the payload is 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.v1beta3.SummaryOptions; - - /** - * Verifies a SummaryOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SummaryOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SummaryOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.SummaryOptions; - - /** - * Creates a plain object from a SummaryOptions message. Also converts values to other types if specified. - * @param message SummaryOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.SummaryOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SummaryOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SummaryOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SummaryOptions { - - /** Length enum. */ - enum Length { - LENGTH_UNSPECIFIED = 0, - BRIEF = 1, - MODERATE = 2, - COMPREHENSIVE = 3 - } - - /** Format enum. */ - enum Format { - FORMAT_UNSPECIFIED = 0, - PARAGRAPH = 1, - BULLETS = 2 - } - } - - /** Properties of a FieldExtractionMetadata. */ - interface IFieldExtractionMetadata { - - /** FieldExtractionMetadata summaryOptions */ - summaryOptions?: (google.cloud.documentai.v1beta3.ISummaryOptions|null); - } - - /** Represents a FieldExtractionMetadata. */ - class FieldExtractionMetadata implements IFieldExtractionMetadata { - - /** - * Constructs a new FieldExtractionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IFieldExtractionMetadata); - - /** FieldExtractionMetadata summaryOptions. */ - public summaryOptions?: (google.cloud.documentai.v1beta3.ISummaryOptions|null); - - /** - * Creates a new FieldExtractionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldExtractionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IFieldExtractionMetadata): google.cloud.documentai.v1beta3.FieldExtractionMetadata; - - /** - * Encodes the specified FieldExtractionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.FieldExtractionMetadata.verify|verify} messages. - * @param message FieldExtractionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IFieldExtractionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldExtractionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.FieldExtractionMetadata.verify|verify} messages. - * @param message FieldExtractionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IFieldExtractionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldExtractionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldExtractionMetadata - * @throws {Error} If the payload is not a 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.v1beta3.FieldExtractionMetadata; - - /** - * Decodes a FieldExtractionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldExtractionMetadata - * @throws {Error} If the payload is 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.v1beta3.FieldExtractionMetadata; - - /** - * Verifies a FieldExtractionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldExtractionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldExtractionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.FieldExtractionMetadata; - - /** - * Creates a plain object from a FieldExtractionMetadata message. Also converts values to other types if specified. - * @param message FieldExtractionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.FieldExtractionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldExtractionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldExtractionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PropertyMetadata. */ - interface IPropertyMetadata { - - /** PropertyMetadata inactive */ - inactive?: (boolean|null); - - /** PropertyMetadata fieldExtractionMetadata */ - fieldExtractionMetadata?: (google.cloud.documentai.v1beta3.IFieldExtractionMetadata|null); - } - - /** Represents a PropertyMetadata. */ - class PropertyMetadata implements IPropertyMetadata { - - /** - * Constructs a new PropertyMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IPropertyMetadata); - - /** PropertyMetadata inactive. */ - public inactive: boolean; - - /** PropertyMetadata fieldExtractionMetadata. */ - public fieldExtractionMetadata?: (google.cloud.documentai.v1beta3.IFieldExtractionMetadata|null); - - /** - * Creates a new PropertyMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns PropertyMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IPropertyMetadata): google.cloud.documentai.v1beta3.PropertyMetadata; - - /** - * Encodes the specified PropertyMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.PropertyMetadata.verify|verify} messages. - * @param message PropertyMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IPropertyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PropertyMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.PropertyMetadata.verify|verify} messages. - * @param message PropertyMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IPropertyMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PropertyMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PropertyMetadata - * @throws {Error} If the payload is not a 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.v1beta3.PropertyMetadata; - - /** - * Decodes a PropertyMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PropertyMetadata - * @throws {Error} If the payload is 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.v1beta3.PropertyMetadata; - - /** - * Verifies a PropertyMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PropertyMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PropertyMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.PropertyMetadata; - - /** - * Creates a plain object from a PropertyMetadata message. Also converts values to other types if specified. - * @param message PropertyMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.PropertyMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PropertyMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PropertyMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EntityTypeMetadata. */ - interface IEntityTypeMetadata { - - /** EntityTypeMetadata inactive */ - inactive?: (boolean|null); - } - - /** Represents an EntityTypeMetadata. */ - class EntityTypeMetadata implements IEntityTypeMetadata { - - /** - * Constructs a new EntityTypeMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IEntityTypeMetadata); - - /** EntityTypeMetadata inactive. */ - public inactive: boolean; - - /** - * Creates a new EntityTypeMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns EntityTypeMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IEntityTypeMetadata): google.cloud.documentai.v1beta3.EntityTypeMetadata; - - /** - * Encodes the specified EntityTypeMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.EntityTypeMetadata.verify|verify} messages. - * @param message EntityTypeMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IEntityTypeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EntityTypeMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EntityTypeMetadata.verify|verify} messages. - * @param message EntityTypeMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEntityTypeMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EntityTypeMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EntityTypeMetadata - * @throws {Error} If the payload is not a 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.v1beta3.EntityTypeMetadata; - - /** - * Decodes an EntityTypeMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EntityTypeMetadata - * @throws {Error} If the payload is 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.v1beta3.EntityTypeMetadata; - - /** - * Verifies an EntityTypeMetadata message. - * @param message Plain 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 EntityTypeMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EntityTypeMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EntityTypeMetadata; - - /** - * Creates a plain object from an EntityTypeMetadata message. Also converts values to other types if specified. - * @param message EntityTypeMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.EntityTypeMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EntityTypeMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EntityTypeMetadata - * @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 displayName */ - displayName?: (string|null); - - /** DocumentSchema description */ - description?: (string|null); - - /** DocumentSchema entityTypes */ - entityTypes?: (google.cloud.documentai.v1beta3.DocumentSchema.IEntityType[]|null); - - /** DocumentSchema metadata */ - metadata?: (google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null); - - /** DocumentSchema documentPrompt */ - documentPrompt?: (string|null); - } - - /** Represents a DocumentSchema. */ - class DocumentSchema implements IDocumentSchema { - - /** - * Constructs a new DocumentSchema. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDocumentSchema); - - /** DocumentSchema displayName. */ - public displayName: string; - - /** DocumentSchema description. */ - public description: string; - - /** DocumentSchema entityTypes. */ - public entityTypes: google.cloud.documentai.v1beta3.DocumentSchema.IEntityType[]; - - /** DocumentSchema metadata. */ - public metadata?: (google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null); - - /** DocumentSchema documentPrompt. */ - public documentPrompt: string; - - /** - * Creates a new DocumentSchema instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentSchema instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDocumentSchema): google.cloud.documentai.v1beta3.DocumentSchema; - - /** - * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.documentai.v1beta3.IDocumentSchema, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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; - } - - namespace DocumentSchema { - - /** Properties of an EntityType. */ - interface IEntityType { - - /** EntityType enumValues */ - enumValues?: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues|null); - - /** EntityType displayName */ - displayName?: (string|null); - - /** EntityType name */ - name?: (string|null); - - /** EntityType description */ - description?: (string|null); - - /** EntityType baseTypes */ - baseTypes?: (string[]|null); - - /** EntityType properties */ - properties?: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty[]|null); - - /** EntityType entityTypeMetadata */ - entityTypeMetadata?: (google.cloud.documentai.v1beta3.IEntityTypeMetadata|null); - } - - /** Represents an EntityType. */ - class EntityType implements IEntityType { - - /** - * Constructs a new EntityType. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.DocumentSchema.IEntityType); - - /** EntityType enumValues. */ - public enumValues?: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues|null); - - /** EntityType displayName. */ - public displayName: string; - - /** EntityType name. */ - public name: string; - - /** EntityType description. */ - public description: string; - - /** EntityType baseTypes. */ - public baseTypes: string[]; - - /** EntityType properties. */ - public properties: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty[]; - - /** EntityType entityTypeMetadata. */ - public entityTypeMetadata?: (google.cloud.documentai.v1beta3.IEntityTypeMetadata|null); - - /** EntityType valueSource. */ - public valueSource?: "enumValues"; - - /** - * Creates a new EntityType instance using the specified properties. - * @param [properties] Properties to set - * @returns EntityType instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.DocumentSchema.IEntityType): google.cloud.documentai.v1beta3.DocumentSchema.EntityType; - - /** - * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.verify|verify} messages. - * @param message EntityType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.DocumentSchema.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.verify|verify} messages. - * @param message EntityType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentSchema.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EntityType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EntityType - * @throws {Error} If the payload is not a 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.v1beta3.DocumentSchema.EntityType; - - /** - * Decodes an EntityType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EntityType - * @throws {Error} If the payload is 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.v1beta3.DocumentSchema.EntityType; - - /** - * Verifies an EntityType message. - * @param message Plain 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 EntityType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EntityType - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentSchema.EntityType; - - /** - * Creates a plain object from an EntityType message. Also converts values to other types if specified. - * @param message EntityType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EntityType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EntityType - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EntityType { - - /** Properties of an EnumValues. */ - interface IEnumValues { - - /** EnumValues values */ - values?: (string[]|null); - } - - /** Represents an EnumValues. */ - class EnumValues implements IEnumValues { - - /** - * Constructs a new EnumValues. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues); - - /** EnumValues values. */ - public values: string[]; - - /** - * Creates a new EnumValues instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValues instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues; - - /** - * Encodes the specified EnumValues message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.verify|verify} messages. - * @param message EnumValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValues message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.verify|verify} messages. - * @param message EnumValues message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValues message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValues - * @throws {Error} If the payload is not a 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.v1beta3.DocumentSchema.EntityType.EnumValues; - - /** - * Decodes an EnumValues message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValues - * @throws {Error} If the payload is 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.v1beta3.DocumentSchema.EntityType.EnumValues; - - /** - * Verifies an EnumValues message. - * @param message Plain 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 EnumValues message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValues - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues; - - /** - * Creates a plain object from an EnumValues message. Also converts values to other types if specified. - * @param message EnumValues - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValues to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValues - * @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 description */ - description?: (string|null); - - /** Property displayName */ - displayName?: (string|null); - - /** Property valueType */ - valueType?: (string|null); - - /** Property occurrenceType */ - occurrenceType?: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|keyof typeof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|null); - - /** Property method */ - method?: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method|keyof typeof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method|null); - - /** Property propertyMetadata */ - propertyMetadata?: (google.cloud.documentai.v1beta3.IPropertyMetadata|null); - } - - /** Represents a Property. */ - class Property implements IProperty { - - /** - * Constructs a new Property. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty); - - /** Property name. */ - public name: string; - - /** Property description. */ - public description: string; - - /** Property displayName. */ - public displayName: string; - - /** Property valueType. */ - public valueType: string; - - /** Property occurrenceType. */ - public occurrenceType: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|keyof typeof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType); - - /** Property method. */ - public method: (google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method|keyof typeof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method); - - /** Property propertyMetadata. */ - public propertyMetadata?: (google.cloud.documentai.v1beta3.IPropertyMetadata|null); - - /** - * Creates a new Property instance using the specified properties. - * @param [properties] Properties to set - * @returns Property instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty): google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property; - - /** - * Encodes the specified Property message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.IProperty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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; - } - - namespace Property { - - /** OccurrenceType enum. */ - enum OccurrenceType { - OCCURRENCE_TYPE_UNSPECIFIED = 0, - OPTIONAL_ONCE = 1, - OPTIONAL_MULTIPLE = 2, - REQUIRED_ONCE = 3, - REQUIRED_MULTIPLE = 4 - } - - /** Method enum. */ - enum Method { - METHOD_UNSPECIFIED = 0, - EXTRACT = 1, - DERIVE = 2 - } - } - } - - /** Properties of a Metadata. */ - interface IMetadata { - - /** Metadata documentSplitter */ - documentSplitter?: (boolean|null); - - /** Metadata documentAllowMultipleLabels */ - documentAllowMultipleLabels?: (boolean|null); - - /** Metadata prefixedNamingOnProperties */ - prefixedNamingOnProperties?: (boolean|null); - - /** Metadata skipNamingValidation */ - skipNamingValidation?: (boolean|null); - } - - /** Represents a Metadata. */ - class Metadata implements IMetadata { - - /** - * Constructs a new Metadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.DocumentSchema.IMetadata); - - /** Metadata documentSplitter. */ - public documentSplitter: boolean; - - /** Metadata documentAllowMultipleLabels. */ - public documentAllowMultipleLabels: boolean; - - /** Metadata prefixedNamingOnProperties. */ - public prefixedNamingOnProperties: boolean; - - /** Metadata skipNamingValidation. */ - public skipNamingValidation: boolean; - - /** - * Creates a new Metadata instance using the specified properties. - * @param [properties] Properties to set - * @returns Metadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.DocumentSchema.IMetadata): google.cloud.documentai.v1beta3.DocumentSchema.Metadata; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify|verify} messages. - * @param message Metadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.DocumentSchema.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify|verify} messages. - * @param message Metadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.DocumentSchema.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Metadata - * @throws {Error} If the payload is not a 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.v1beta3.DocumentSchema.Metadata; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Metadata - * @throws {Error} If the payload is 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.v1beta3.DocumentSchema.Metadata; - - /** - * Verifies a Metadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Metadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentSchema.Metadata; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @param message Metadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DocumentSchema.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Metadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Metadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Represents a DocumentProcessorService */ - class DocumentProcessorService extends $protobuf.rpc.Service { - - /** - * Constructs a new DocumentProcessorService 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 DocumentProcessorService 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): DocumentProcessorService; - - /** - * Calls ProcessDocument. - * @param request ProcessRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ProcessResponse - */ - public processDocument(request: google.cloud.documentai.v1beta3.IProcessRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocumentCallback): void; - - /** - * Calls ProcessDocument. - * @param request ProcessRequest message or plain object - * @returns Promise - */ - public processDocument(request: google.cloud.documentai.v1beta3.IProcessRequest): Promise; - - /** - * Calls BatchProcessDocuments. - * @param request BatchProcessRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchProcessDocuments(request: google.cloud.documentai.v1beta3.IBatchProcessRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocumentsCallback): void; - - /** - * Calls BatchProcessDocuments. - * @param request BatchProcessRequest message or plain object - * @returns Promise - */ - public batchProcessDocuments(request: google.cloud.documentai.v1beta3.IBatchProcessRequest): Promise; - - /** - * Calls FetchProcessorTypes. - * @param request FetchProcessorTypesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FetchProcessorTypesResponse - */ - public fetchProcessorTypes(request: google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypesCallback): void; - - /** - * Calls FetchProcessorTypes. - * @param request FetchProcessorTypesRequest message or plain object - * @returns Promise - */ - public fetchProcessorTypes(request: google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest): Promise; - - /** - * Calls ListProcessorTypes. - * @param request ListProcessorTypesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListProcessorTypesResponse - */ - public listProcessorTypes(request: google.cloud.documentai.v1beta3.IListProcessorTypesRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypesCallback): void; - - /** - * Calls ListProcessorTypes. - * @param request ListProcessorTypesRequest message or plain object - * @returns Promise - */ - public listProcessorTypes(request: google.cloud.documentai.v1beta3.IListProcessorTypesRequest): Promise; - - /** - * Calls GetProcessorType. - * @param request GetProcessorTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ProcessorType - */ - public getProcessorType(request: google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorTypeCallback): void; - - /** - * Calls GetProcessorType. - * @param request GetProcessorTypeRequest message or plain object - * @returns Promise - */ - public getProcessorType(request: google.cloud.documentai.v1beta3.IGetProcessorTypeRequest): Promise; - - /** - * Calls ListProcessors. - * @param request ListProcessorsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListProcessorsResponse - */ - public listProcessors(request: google.cloud.documentai.v1beta3.IListProcessorsRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorsCallback): void; - - /** - * Calls ListProcessors. - * @param request ListProcessorsRequest message or plain object - * @returns Promise - */ - public listProcessors(request: google.cloud.documentai.v1beta3.IListProcessorsRequest): Promise; - - /** - * Calls GetProcessor. - * @param request GetProcessorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Processor - */ - public getProcessor(request: google.cloud.documentai.v1beta3.IGetProcessorRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorCallback): void; - - /** - * Calls GetProcessor. - * @param request GetProcessorRequest message or plain object - * @returns Promise - */ - public getProcessor(request: google.cloud.documentai.v1beta3.IGetProcessorRequest): Promise; - - /** - * Calls TrainProcessorVersion. - * @param request TrainProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public trainProcessorVersion(request: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersionCallback): void; - - /** - * Calls TrainProcessorVersion. - * @param request TrainProcessorVersionRequest message or plain object - * @returns Promise - */ - public trainProcessorVersion(request: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest): Promise; - - /** - * Calls GetProcessorVersion. - * @param request GetProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ProcessorVersion - */ - public getProcessorVersion(request: google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersionCallback): void; - - /** - * Calls GetProcessorVersion. - * @param request GetProcessorVersionRequest message or plain object - * @returns Promise - */ - public getProcessorVersion(request: google.cloud.documentai.v1beta3.IGetProcessorVersionRequest): Promise; - - /** - * Calls ListProcessorVersions. - * @param request ListProcessorVersionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListProcessorVersionsResponse - */ - public listProcessorVersions(request: google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersionsCallback): void; - - /** - * Calls ListProcessorVersions. - * @param request ListProcessorVersionsRequest message or plain object - * @returns Promise - */ - public listProcessorVersions(request: google.cloud.documentai.v1beta3.IListProcessorVersionsRequest): Promise; - - /** - * Calls DeleteProcessorVersion. - * @param request DeleteProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteProcessorVersion(request: google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersionCallback): void; - - /** - * Calls DeleteProcessorVersion. - * @param request DeleteProcessorVersionRequest message or plain object - * @returns Promise - */ - public deleteProcessorVersion(request: google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest): Promise; - - /** - * Calls DeployProcessorVersion. - * @param request DeployProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deployProcessorVersion(request: google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersionCallback): void; - - /** - * Calls DeployProcessorVersion. - * @param request DeployProcessorVersionRequest message or plain object - * @returns Promise - */ - public deployProcessorVersion(request: google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest): Promise; - - /** - * Calls UndeployProcessorVersion. - * @param request UndeployProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public undeployProcessorVersion(request: google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersionCallback): void; - - /** - * Calls UndeployProcessorVersion. - * @param request UndeployProcessorVersionRequest message or plain object - * @returns Promise - */ - public undeployProcessorVersion(request: google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest): Promise; - - /** - * Calls CreateProcessor. - * @param request CreateProcessorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Processor - */ - public createProcessor(request: google.cloud.documentai.v1beta3.ICreateProcessorRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessorCallback): void; - - /** - * Calls CreateProcessor. - * @param request CreateProcessorRequest message or plain object - * @returns Promise - */ - public createProcessor(request: google.cloud.documentai.v1beta3.ICreateProcessorRequest): Promise; - - /** - * Calls DeleteProcessor. - * @param request DeleteProcessorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteProcessor(request: google.cloud.documentai.v1beta3.IDeleteProcessorRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorCallback): void; - - /** - * Calls DeleteProcessor. - * @param request DeleteProcessorRequest message or plain object - * @returns Promise - */ - public deleteProcessor(request: google.cloud.documentai.v1beta3.IDeleteProcessorRequest): Promise; - - /** - * Calls EnableProcessor. - * @param request EnableProcessorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public enableProcessor(request: google.cloud.documentai.v1beta3.IEnableProcessorRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessorCallback): void; - - /** - * Calls EnableProcessor. - * @param request EnableProcessorRequest message or plain object - * @returns Promise - */ - public enableProcessor(request: google.cloud.documentai.v1beta3.IEnableProcessorRequest): Promise; - - /** - * Calls DisableProcessor. - * @param request DisableProcessorRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public disableProcessor(request: google.cloud.documentai.v1beta3.IDisableProcessorRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessorCallback): void; - - /** - * Calls DisableProcessor. - * @param request DisableProcessorRequest message or plain object - * @returns Promise - */ - public disableProcessor(request: google.cloud.documentai.v1beta3.IDisableProcessorRequest): Promise; - - /** - * Calls SetDefaultProcessorVersion. - * @param request SetDefaultProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public setDefaultProcessorVersion(request: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersionCallback): void; - - /** - * Calls SetDefaultProcessorVersion. - * @param request SetDefaultProcessorVersionRequest message or plain object - * @returns Promise - */ - public setDefaultProcessorVersion(request: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest): Promise; - - /** - * Calls ReviewDocument. - * @param request ReviewDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public reviewDocument(request: google.cloud.documentai.v1beta3.IReviewDocumentRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocumentCallback): void; - - /** - * Calls ReviewDocument. - * @param request ReviewDocumentRequest message or plain object - * @returns Promise - */ - public reviewDocument(request: google.cloud.documentai.v1beta3.IReviewDocumentRequest): Promise; - - /** - * Calls EvaluateProcessorVersion. - * @param request EvaluateProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public evaluateProcessorVersion(request: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersionCallback): void; - - /** - * Calls EvaluateProcessorVersion. - * @param request EvaluateProcessorVersionRequest message or plain object - * @returns Promise - */ - public evaluateProcessorVersion(request: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest): Promise; - - /** - * Calls GetEvaluation. - * @param request GetEvaluationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Evaluation - */ - public getEvaluation(request: google.cloud.documentai.v1beta3.IGetEvaluationRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluationCallback): void; - - /** - * Calls GetEvaluation. - * @param request GetEvaluationRequest message or plain object - * @returns Promise - */ - public getEvaluation(request: google.cloud.documentai.v1beta3.IGetEvaluationRequest): Promise; - - /** - * Calls ListEvaluations. - * @param request ListEvaluationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEvaluationsResponse - */ - public listEvaluations(request: google.cloud.documentai.v1beta3.IListEvaluationsRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluationsCallback): void; - - /** - * Calls ListEvaluations. - * @param request ListEvaluationsRequest message or plain object - * @returns Promise - */ - public listEvaluations(request: google.cloud.documentai.v1beta3.IListEvaluationsRequest): Promise; - - /** - * Calls ImportProcessorVersion. - * @param request ImportProcessorVersionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importProcessorVersion(request: google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, callback: google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersionCallback): void; - - /** - * Calls ImportProcessorVersion. - * @param request ImportProcessorVersionRequest message or plain object - * @returns Promise - */ - public importProcessorVersion(request: google.cloud.documentai.v1beta3.IImportProcessorVersionRequest): Promise; - } - - namespace DocumentProcessorService { - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|processDocument}. - * @param error Error, if any - * @param [response] ProcessResponse - */ - type ProcessDocumentCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ProcessResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|batchProcessDocuments}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchProcessDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|fetchProcessorTypes}. - * @param error Error, if any - * @param [response] FetchProcessorTypesResponse - */ - type FetchProcessorTypesCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.FetchProcessorTypesResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listProcessorTypes}. - * @param error Error, if any - * @param [response] ListProcessorTypesResponse - */ - type ListProcessorTypesCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ListProcessorTypesResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getProcessorType}. - * @param error Error, if any - * @param [response] ProcessorType - */ - type GetProcessorTypeCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ProcessorType) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listProcessors}. - * @param error Error, if any - * @param [response] ListProcessorsResponse - */ - type ListProcessorsCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ListProcessorsResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getProcessor}. - * @param error Error, if any - * @param [response] Processor - */ - type GetProcessorCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.Processor) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|trainProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type TrainProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getProcessorVersion}. - * @param error Error, if any - * @param [response] ProcessorVersion - */ - type GetProcessorVersionCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ProcessorVersion) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listProcessorVersions}. - * @param error Error, if any - * @param [response] ListProcessorVersionsResponse - */ - type ListProcessorVersionsCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|deleteProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|deployProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type DeployProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|undeployProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type UndeployProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|createProcessor}. - * @param error Error, if any - * @param [response] Processor - */ - type CreateProcessorCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.Processor) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|deleteProcessor}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|enableProcessor}. - * @param error Error, if any - * @param [response] Operation - */ - type EnableProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|disableProcessor}. - * @param error Error, if any - * @param [response] Operation - */ - type DisableProcessorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|setDefaultProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type SetDefaultProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|reviewDocument}. - * @param error Error, if any - * @param [response] Operation - */ - type ReviewDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|evaluateProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type EvaluateProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getEvaluation}. - * @param error Error, if any - * @param [response] Evaluation - */ - type GetEvaluationCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.Evaluation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listEvaluations}. - * @param error Error, if any - * @param [response] ListEvaluationsResponse - */ - type ListEvaluationsCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ListEvaluationsResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|importProcessorVersion}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportProcessorVersionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a ProcessOptions. */ - interface IProcessOptions { - - /** ProcessOptions individualPageSelector */ - individualPageSelector?: (google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector|null); - - /** ProcessOptions fromStart */ - fromStart?: (number|null); - - /** ProcessOptions fromEnd */ - fromEnd?: (number|null); - - /** ProcessOptions ocrConfig */ - ocrConfig?: (google.cloud.documentai.v1beta3.IOcrConfig|null); - - /** ProcessOptions layoutConfig */ - layoutConfig?: (google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig|null); - - /** ProcessOptions schemaOverride */ - schemaOverride?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); - } - - /** Represents a ProcessOptions. */ - class ProcessOptions implements IProcessOptions { - - /** - * Constructs a new ProcessOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IProcessOptions); - - /** ProcessOptions individualPageSelector. */ - public individualPageSelector?: (google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector|null); - - /** ProcessOptions fromStart. */ - public fromStart?: (number|null); - - /** ProcessOptions fromEnd. */ - public fromEnd?: (number|null); - - /** ProcessOptions ocrConfig. */ - public ocrConfig?: (google.cloud.documentai.v1beta3.IOcrConfig|null); - - /** ProcessOptions layoutConfig. */ - public layoutConfig?: (google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig|null); - - /** ProcessOptions schemaOverride. */ - public schemaOverride?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); - - /** ProcessOptions pageRange. */ - public pageRange?: ("individualPageSelector"|"fromStart"|"fromEnd"); - - /** - * Creates a new ProcessOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessOptions instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IProcessOptions): google.cloud.documentai.v1beta3.ProcessOptions; - - /** - * Encodes the specified ProcessOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.verify|verify} messages. - * @param message ProcessOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IProcessOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.verify|verify} messages. - * @param message ProcessOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessOptions - * @throws {Error} If the payload is not a 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.v1beta3.ProcessOptions; - - /** - * Decodes a ProcessOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessOptions - * @throws {Error} If the payload is 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.v1beta3.ProcessOptions; - - /** - * Verifies a ProcessOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProcessOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessOptions; - - /** - * Creates a plain object from a ProcessOptions message. Also converts values to other types if specified. - * @param message ProcessOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ProcessOptions { - - /** Properties of a LayoutConfig. */ - interface ILayoutConfig { - - /** LayoutConfig chunkingConfig */ - chunkingConfig?: (google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig|null); - - /** LayoutConfig returnImages */ - returnImages?: (boolean|null); - - /** LayoutConfig returnBoundingBoxes */ - returnBoundingBoxes?: (boolean|null); - - /** LayoutConfig enableImageAnnotation */ - enableImageAnnotation?: (boolean|null); - - /** LayoutConfig enableImageExtraction */ - enableImageExtraction?: (boolean|null); - - /** LayoutConfig enableLlmLayoutParsing */ - enableLlmLayoutParsing?: (boolean|null); - - /** LayoutConfig enableTableAnnotation */ - enableTableAnnotation?: (boolean|null); - - /** LayoutConfig enableTableSplit */ - enableTableSplit?: (boolean|null); - } - - /** Represents a LayoutConfig. */ - class LayoutConfig implements ILayoutConfig { - - /** - * Constructs a new LayoutConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig); - - /** LayoutConfig chunkingConfig. */ - public chunkingConfig?: (google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig|null); - - /** LayoutConfig returnImages. */ - public returnImages: boolean; - - /** LayoutConfig returnBoundingBoxes. */ - public returnBoundingBoxes: boolean; - - /** LayoutConfig enableImageAnnotation. */ - public enableImageAnnotation: boolean; - - /** LayoutConfig enableImageExtraction. */ - public enableImageExtraction: boolean; - - /** LayoutConfig enableLlmLayoutParsing. */ - public enableLlmLayoutParsing: boolean; - - /** LayoutConfig enableTableAnnotation. */ - public enableTableAnnotation: boolean; - - /** LayoutConfig enableTableSplit. */ - public enableTableSplit: boolean; - - /** - * Creates a new LayoutConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns LayoutConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig): google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig; - - /** - * Encodes the specified LayoutConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.verify|verify} messages. - * @param message LayoutConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LayoutConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.verify|verify} messages. - * @param message LayoutConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LayoutConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LayoutConfig - * @throws {Error} If the payload is not a 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.v1beta3.ProcessOptions.LayoutConfig; - - /** - * Decodes a LayoutConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LayoutConfig - * @throws {Error} If the payload is 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.v1beta3.ProcessOptions.LayoutConfig; - - /** - * Verifies a LayoutConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LayoutConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LayoutConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig; - - /** - * Creates a plain object from a LayoutConfig message. Also converts values to other types if specified. - * @param message LayoutConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LayoutConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LayoutConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LayoutConfig { - - /** Properties of a ChunkingConfig. */ - interface IChunkingConfig { - - /** ChunkingConfig chunkSize */ - chunkSize?: (number|null); - - /** ChunkingConfig includeAncestorHeadings */ - includeAncestorHeadings?: (boolean|null); - - /** ChunkingConfig semanticChunkingGroupSize */ - semanticChunkingGroupSize?: (boolean|null); - - /** ChunkingConfig breakpointPercentileThreshold */ - breakpointPercentileThreshold?: (number|null); - } - - /** Represents a ChunkingConfig. */ - class ChunkingConfig implements IChunkingConfig { - - /** - * Constructs a new ChunkingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig); - - /** ChunkingConfig chunkSize. */ - public chunkSize: number; - - /** ChunkingConfig includeAncestorHeadings. */ - public includeAncestorHeadings: boolean; - - /** ChunkingConfig semanticChunkingGroupSize. */ - public semanticChunkingGroupSize: boolean; - - /** ChunkingConfig breakpointPercentileThreshold. */ - public breakpointPercentileThreshold: number; - - /** - * Creates a new ChunkingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ChunkingConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig): google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig; - - /** - * Encodes the specified ChunkingConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. - * @param message ChunkingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ChunkingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. - * @param message ChunkingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ChunkingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ChunkingConfig - * @throws {Error} If the payload is not a 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.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig; - - /** - * Decodes a ChunkingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ChunkingConfig - * @throws {Error} If the payload is 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.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig; - - /** - * Verifies a ChunkingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ChunkingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ChunkingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig; - - /** - * Creates a plain object from a ChunkingConfig message. Also converts values to other types if specified. - * @param message ChunkingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ChunkingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ChunkingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an IndividualPageSelector. */ - interface IIndividualPageSelector { - - /** IndividualPageSelector pages */ - pages?: (number[]|null); - } - - /** Represents an IndividualPageSelector. */ - class IndividualPageSelector implements IIndividualPageSelector { - - /** - * Constructs a new IndividualPageSelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector); - - /** IndividualPageSelector pages. */ - public pages: number[]; - - /** - * Creates a new IndividualPageSelector instance using the specified properties. - * @param [properties] Properties to set - * @returns IndividualPageSelector instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector): google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector; - - /** - * Encodes the specified IndividualPageSelector message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify|verify} messages. - * @param message IndividualPageSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IndividualPageSelector message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify|verify} messages. - * @param message IndividualPageSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IndividualPageSelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndividualPageSelector - * @throws {Error} If the payload is not a 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.v1beta3.ProcessOptions.IndividualPageSelector; - - /** - * Decodes an IndividualPageSelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndividualPageSelector - * @throws {Error} If the payload is 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.v1beta3.ProcessOptions.IndividualPageSelector; - - /** - * Verifies an IndividualPageSelector message. - * @param message Plain 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 IndividualPageSelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndividualPageSelector - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector; - - /** - * Creates a plain object from an IndividualPageSelector message. Also converts values to other types if specified. - * @param message IndividualPageSelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndividualPageSelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IndividualPageSelector - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ProcessRequest. */ - interface IProcessRequest { - - /** ProcessRequest inlineDocument */ - inlineDocument?: (google.cloud.documentai.v1beta3.IDocument|null); - - /** ProcessRequest rawDocument */ - rawDocument?: (google.cloud.documentai.v1beta3.IRawDocument|null); - - /** ProcessRequest gcsDocument */ - gcsDocument?: (google.cloud.documentai.v1beta3.IGcsDocument|null); - - /** ProcessRequest name */ - name?: (string|null); - - /** ProcessRequest document */ - document?: (google.cloud.documentai.v1beta3.IDocument|null); - - /** ProcessRequest skipHumanReview */ - skipHumanReview?: (boolean|null); - - /** ProcessRequest fieldMask */ - fieldMask?: (google.protobuf.IFieldMask|null); - - /** ProcessRequest processOptions */ - processOptions?: (google.cloud.documentai.v1beta3.IProcessOptions|null); - - /** ProcessRequest labels */ - labels?: ({ [k: string]: string }|null); - - /** ProcessRequest imagelessMode */ - imagelessMode?: (boolean|null); - } - - /** Represents a ProcessRequest. */ - class ProcessRequest implements IProcessRequest { - - /** - * Constructs a new ProcessRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IProcessRequest); - - /** ProcessRequest inlineDocument. */ - public inlineDocument?: (google.cloud.documentai.v1beta3.IDocument|null); - - /** ProcessRequest rawDocument. */ - public rawDocument?: (google.cloud.documentai.v1beta3.IRawDocument|null); - - /** ProcessRequest gcsDocument. */ - public gcsDocument?: (google.cloud.documentai.v1beta3.IGcsDocument|null); - - /** ProcessRequest name. */ - public name: string; - - /** ProcessRequest document. */ - public document?: (google.cloud.documentai.v1beta3.IDocument|null); - - /** ProcessRequest skipHumanReview. */ - public skipHumanReview: boolean; - - /** ProcessRequest fieldMask. */ - public fieldMask?: (google.protobuf.IFieldMask|null); - - /** ProcessRequest processOptions. */ - public processOptions?: (google.cloud.documentai.v1beta3.IProcessOptions|null); - - /** ProcessRequest labels. */ - public labels: { [k: string]: string }; - - /** ProcessRequest imagelessMode. */ - public imagelessMode: boolean; - - /** ProcessRequest source. */ - public source?: ("inlineDocument"|"rawDocument"|"gcsDocument"); - - /** - * Creates a new ProcessRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IProcessRequest): google.cloud.documentai.v1beta3.ProcessRequest; - - /** - * Encodes the specified ProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessRequest.verify|verify} messages. - * @param message ProcessRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessRequest.verify|verify} messages. - * @param message ProcessRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessRequest - * @throws {Error} If the payload is not a 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.v1beta3.ProcessRequest; - - /** - * Decodes a ProcessRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessRequest - * @throws {Error} If the payload is 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.v1beta3.ProcessRequest; - - /** - * Verifies a ProcessRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProcessRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessRequest; - - /** - * Creates a plain object from a ProcessRequest message. Also converts values to other types if specified. - * @param message ProcessRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HumanReviewStatus. */ - interface IHumanReviewStatus { - - /** HumanReviewStatus state */ - state?: (google.cloud.documentai.v1beta3.HumanReviewStatus.State|keyof typeof google.cloud.documentai.v1beta3.HumanReviewStatus.State|null); - - /** HumanReviewStatus stateMessage */ - stateMessage?: (string|null); - - /** HumanReviewStatus humanReviewOperation */ - humanReviewOperation?: (string|null); - } - - /** Represents a HumanReviewStatus. */ - class HumanReviewStatus implements IHumanReviewStatus { - - /** - * Constructs a new HumanReviewStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IHumanReviewStatus); - - /** HumanReviewStatus state. */ - public state: (google.cloud.documentai.v1beta3.HumanReviewStatus.State|keyof typeof google.cloud.documentai.v1beta3.HumanReviewStatus.State); - - /** HumanReviewStatus stateMessage. */ - public stateMessage: string; - - /** HumanReviewStatus humanReviewOperation. */ - public humanReviewOperation: string; - - /** - * Creates a new HumanReviewStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns HumanReviewStatus instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IHumanReviewStatus): google.cloud.documentai.v1beta3.HumanReviewStatus; - - /** - * Encodes the specified HumanReviewStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.HumanReviewStatus.verify|verify} messages. - * @param message HumanReviewStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IHumanReviewStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HumanReviewStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.HumanReviewStatus.verify|verify} messages. - * @param message HumanReviewStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IHumanReviewStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HumanReviewStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HumanReviewStatus - * @throws {Error} If the payload is not a 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.v1beta3.HumanReviewStatus; - - /** - * Decodes a HumanReviewStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HumanReviewStatus - * @throws {Error} If the payload is 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.v1beta3.HumanReviewStatus; - - /** - * Verifies a HumanReviewStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HumanReviewStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HumanReviewStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.HumanReviewStatus; - - /** - * Creates a plain object from a HumanReviewStatus message. Also converts values to other types if specified. - * @param message HumanReviewStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.HumanReviewStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HumanReviewStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HumanReviewStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace HumanReviewStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - SKIPPED = 1, - VALIDATION_PASSED = 2, - IN_PROGRESS = 3, - ERROR = 4 - } - } - - /** Properties of a ProcessResponse. */ - interface IProcessResponse { - - /** ProcessResponse document */ - document?: (google.cloud.documentai.v1beta3.IDocument|null); - - /** ProcessResponse humanReviewOperation */ - humanReviewOperation?: (string|null); - - /** ProcessResponse humanReviewStatus */ - humanReviewStatus?: (google.cloud.documentai.v1beta3.IHumanReviewStatus|null); - } - - /** Represents a ProcessResponse. */ - class ProcessResponse implements IProcessResponse { - - /** - * Constructs a new ProcessResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IProcessResponse); - - /** ProcessResponse document. */ - public document?: (google.cloud.documentai.v1beta3.IDocument|null); - - /** ProcessResponse humanReviewOperation. */ - public humanReviewOperation: string; - - /** ProcessResponse humanReviewStatus. */ - public humanReviewStatus?: (google.cloud.documentai.v1beta3.IHumanReviewStatus|null); - - /** - * Creates a new ProcessResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IProcessResponse): google.cloud.documentai.v1beta3.ProcessResponse; - - /** - * Encodes the specified ProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessResponse.verify|verify} messages. - * @param message ProcessResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessResponse.verify|verify} messages. - * @param message ProcessResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessResponse - * @throws {Error} If the payload is not a 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.v1beta3.ProcessResponse; - - /** - * Decodes a ProcessResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessResponse - * @throws {Error} If the payload is 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.v1beta3.ProcessResponse; - - /** - * Verifies a ProcessResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProcessResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessResponse; - - /** - * Creates a plain object from a ProcessResponse message. Also converts values to other types if specified. - * @param message ProcessResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchProcessRequest. */ - interface IBatchProcessRequest { - - /** BatchProcessRequest name */ - name?: (string|null); - - /** BatchProcessRequest inputConfigs */ - inputConfigs?: (google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig[]|null); - - /** BatchProcessRequest outputConfig */ - outputConfig?: (google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig|null); - - /** BatchProcessRequest inputDocuments */ - inputDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); - - /** BatchProcessRequest documentOutputConfig */ - documentOutputConfig?: (google.cloud.documentai.v1beta3.IDocumentOutputConfig|null); - - /** BatchProcessRequest skipHumanReview */ - skipHumanReview?: (boolean|null); - - /** BatchProcessRequest processOptions */ - processOptions?: (google.cloud.documentai.v1beta3.IProcessOptions|null); - - /** BatchProcessRequest labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a BatchProcessRequest. */ - class BatchProcessRequest implements IBatchProcessRequest { - - /** - * Constructs a new BatchProcessRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IBatchProcessRequest); - - /** BatchProcessRequest name. */ - public name: string; - - /** BatchProcessRequest inputConfigs. */ - public inputConfigs: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig[]; - - /** BatchProcessRequest outputConfig. */ - public outputConfig?: (google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig|null); - - /** BatchProcessRequest inputDocuments. */ - public inputDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); - - /** BatchProcessRequest documentOutputConfig. */ - public documentOutputConfig?: (google.cloud.documentai.v1beta3.IDocumentOutputConfig|null); - - /** BatchProcessRequest skipHumanReview. */ - public skipHumanReview: boolean; - - /** BatchProcessRequest processOptions. */ - public processOptions?: (google.cloud.documentai.v1beta3.IProcessOptions|null); - - /** BatchProcessRequest labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new BatchProcessRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchProcessRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IBatchProcessRequest): google.cloud.documentai.v1beta3.BatchProcessRequest; - - /** - * Encodes the specified BatchProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.verify|verify} messages. - * @param message BatchProcessRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IBatchProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.verify|verify} messages. - * @param message BatchProcessRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchProcessRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchProcessRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchProcessRequest - * @throws {Error} If the payload is not a 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.v1beta3.BatchProcessRequest; - - /** - * Decodes a BatchProcessRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchProcessRequest - * @throws {Error} If the payload is 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.v1beta3.BatchProcessRequest; - - /** - * Verifies a BatchProcessRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchProcessRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchProcessRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchProcessRequest; - - /** - * Creates a plain object from a BatchProcessRequest message. Also converts values to other types if specified. - * @param message BatchProcessRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchProcessRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchProcessRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchProcessRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BatchProcessRequest { - - /** Properties of a BatchInputConfig. */ - interface IBatchInputConfig { - - /** BatchInputConfig gcsSource */ - gcsSource?: (string|null); - - /** BatchInputConfig mimeType */ - mimeType?: (string|null); - } - - /** Represents a BatchInputConfig. */ - class BatchInputConfig implements IBatchInputConfig { - - /** - * Constructs a new BatchInputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig); - - /** BatchInputConfig gcsSource. */ - public gcsSource: string; - - /** BatchInputConfig mimeType. */ - public mimeType: string; - - /** - * Creates a new BatchInputConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchInputConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig): google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig; - - /** - * Encodes the specified BatchInputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.verify|verify} messages. - * @param message BatchInputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchInputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.verify|verify} messages. - * @param message BatchInputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchInputConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchInputConfig - * @throws {Error} If the payload is not a 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.v1beta3.BatchProcessRequest.BatchInputConfig; - - /** - * Decodes a BatchInputConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchInputConfig - * @throws {Error} If the payload is 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.v1beta3.BatchProcessRequest.BatchInputConfig; - - /** - * Verifies a BatchInputConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchInputConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchInputConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig; - - /** - * Creates a plain object from a BatchInputConfig message. Also converts values to other types if specified. - * @param message BatchInputConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchInputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchInputConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchOutputConfig. */ - interface IBatchOutputConfig { - - /** BatchOutputConfig gcsDestination */ - gcsDestination?: (string|null); - } - - /** Represents a BatchOutputConfig. */ - class BatchOutputConfig implements IBatchOutputConfig { - - /** - * Constructs a new BatchOutputConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig); - - /** BatchOutputConfig gcsDestination. */ - public gcsDestination: string; - - /** - * Creates a new BatchOutputConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchOutputConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig): google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig; - - /** - * Encodes the specified BatchOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.verify|verify} messages. - * @param message BatchOutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.verify|verify} messages. - * @param message BatchOutputConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchOutputConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchOutputConfig - * @throws {Error} If the payload is not a 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.v1beta3.BatchProcessRequest.BatchOutputConfig; - - /** - * Decodes a BatchOutputConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchOutputConfig - * @throws {Error} If the payload is 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.v1beta3.BatchProcessRequest.BatchOutputConfig; - - /** - * Verifies a BatchOutputConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchOutputConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchOutputConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig; - - /** - * Creates a plain object from a BatchOutputConfig message. Also converts values to other types if specified. - * @param message BatchOutputConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchOutputConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchOutputConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a BatchProcessResponse. */ - interface IBatchProcessResponse { - } - - /** Represents a BatchProcessResponse. */ - class BatchProcessResponse implements IBatchProcessResponse { - - /** - * Constructs a new BatchProcessResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IBatchProcessResponse); - - /** - * Creates a new BatchProcessResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchProcessResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IBatchProcessResponse): google.cloud.documentai.v1beta3.BatchProcessResponse; - - /** - * Encodes the specified BatchProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessResponse.verify|verify} messages. - * @param message BatchProcessResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IBatchProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessResponse.verify|verify} messages. - * @param message BatchProcessResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchProcessResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchProcessResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchProcessResponse - * @throws {Error} If the payload is not a 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.v1beta3.BatchProcessResponse; - - /** - * Decodes a BatchProcessResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchProcessResponse - * @throws {Error} If the payload is 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.v1beta3.BatchProcessResponse; - - /** - * Verifies a BatchProcessResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchProcessResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchProcessResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchProcessResponse; - - /** - * Creates a plain object from a BatchProcessResponse message. Also converts values to other types if specified. - * @param message BatchProcessResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchProcessResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchProcessResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchProcessResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchProcessMetadata. */ - interface IBatchProcessMetadata { - - /** BatchProcessMetadata state */ - state?: (google.cloud.documentai.v1beta3.BatchProcessMetadata.State|keyof typeof google.cloud.documentai.v1beta3.BatchProcessMetadata.State|null); - - /** BatchProcessMetadata stateMessage */ - stateMessage?: (string|null); - - /** BatchProcessMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** BatchProcessMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** BatchProcessMetadata individualProcessStatuses */ - individualProcessStatuses?: (google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus[]|null); - } - - /** Represents a BatchProcessMetadata. */ - class BatchProcessMetadata implements IBatchProcessMetadata { - - /** - * Constructs a new BatchProcessMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IBatchProcessMetadata); - - /** BatchProcessMetadata state. */ - public state: (google.cloud.documentai.v1beta3.BatchProcessMetadata.State|keyof typeof google.cloud.documentai.v1beta3.BatchProcessMetadata.State); - - /** BatchProcessMetadata stateMessage. */ - public stateMessage: string; - - /** BatchProcessMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** BatchProcessMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** BatchProcessMetadata individualProcessStatuses. */ - public individualProcessStatuses: google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus[]; - - /** - * Creates a new BatchProcessMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchProcessMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IBatchProcessMetadata): google.cloud.documentai.v1beta3.BatchProcessMetadata; - - /** - * Encodes the specified BatchProcessMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.verify|verify} messages. - * @param message BatchProcessMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IBatchProcessMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchProcessMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.verify|verify} messages. - * @param message BatchProcessMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchProcessMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchProcessMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchProcessMetadata - * @throws {Error} If the payload is not a 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.v1beta3.BatchProcessMetadata; - - /** - * Decodes a BatchProcessMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchProcessMetadata - * @throws {Error} If the payload is 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.v1beta3.BatchProcessMetadata; - - /** - * Verifies a BatchProcessMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchProcessMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchProcessMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchProcessMetadata; - - /** - * Creates a plain object from a BatchProcessMetadata message. Also converts values to other types if specified. - * @param message BatchProcessMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchProcessMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchProcessMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchProcessMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BatchProcessMetadata { - - /** Properties of an IndividualProcessStatus. */ - interface IIndividualProcessStatus { - - /** IndividualProcessStatus inputGcsSource */ - inputGcsSource?: (string|null); - - /** IndividualProcessStatus status */ - status?: (google.rpc.IStatus|null); - - /** IndividualProcessStatus outputGcsDestination */ - outputGcsDestination?: (string|null); - - /** IndividualProcessStatus humanReviewOperation */ - humanReviewOperation?: (string|null); - - /** IndividualProcessStatus humanReviewStatus */ - humanReviewStatus?: (google.cloud.documentai.v1beta3.IHumanReviewStatus|null); - } - - /** Represents an IndividualProcessStatus. */ - class IndividualProcessStatus implements IIndividualProcessStatus { - - /** - * Constructs a new IndividualProcessStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus); - - /** IndividualProcessStatus inputGcsSource. */ - public inputGcsSource: string; - - /** IndividualProcessStatus status. */ - public status?: (google.rpc.IStatus|null); - - /** IndividualProcessStatus outputGcsDestination. */ - public outputGcsDestination: string; - - /** IndividualProcessStatus humanReviewOperation. */ - public humanReviewOperation: string; - - /** IndividualProcessStatus humanReviewStatus. */ - public humanReviewStatus?: (google.cloud.documentai.v1beta3.IHumanReviewStatus|null); - - /** - * Creates a new IndividualProcessStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns IndividualProcessStatus instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus): google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus; - - /** - * Encodes the specified IndividualProcessStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. - * @param message IndividualProcessStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IndividualProcessStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. - * @param message IndividualProcessStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IndividualProcessStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndividualProcessStatus - * @throws {Error} If the payload is not a 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.v1beta3.BatchProcessMetadata.IndividualProcessStatus; - - /** - * Decodes an IndividualProcessStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndividualProcessStatus - * @throws {Error} If the payload is 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.v1beta3.BatchProcessMetadata.IndividualProcessStatus; - - /** - * Verifies an IndividualProcessStatus message. - * @param message Plain 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 IndividualProcessStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndividualProcessStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus; - - /** - * Creates a plain object from an IndividualProcessStatus message. Also converts values to other types if specified. - * @param message IndividualProcessStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndividualProcessStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IndividualProcessStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - WAITING = 1, - RUNNING = 2, - SUCCEEDED = 3, - CANCELLING = 4, - CANCELLED = 5, - FAILED = 6 - } - } - - /** Properties of a FetchProcessorTypesRequest. */ - interface IFetchProcessorTypesRequest { - - /** FetchProcessorTypesRequest parent */ - parent?: (string|null); - } - - /** Represents a FetchProcessorTypesRequest. */ - class FetchProcessorTypesRequest implements IFetchProcessorTypesRequest { - - /** - * Constructs a new FetchProcessorTypesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest); - - /** FetchProcessorTypesRequest parent. */ - public parent: string; - - /** - * Creates a new FetchProcessorTypesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchProcessorTypesRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest): google.cloud.documentai.v1beta3.FetchProcessorTypesRequest; - - /** - * Encodes the specified FetchProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.verify|verify} messages. - * @param message FetchProcessorTypesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.verify|verify} messages. - * @param message FetchProcessorTypesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchProcessorTypesRequest - * @throws {Error} If the payload is not a 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.v1beta3.FetchProcessorTypesRequest; - - /** - * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchProcessorTypesRequest - * @throws {Error} If the payload is 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.v1beta3.FetchProcessorTypesRequest; - - /** - * Verifies a FetchProcessorTypesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchProcessorTypesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.FetchProcessorTypesRequest; - - /** - * Creates a plain object from a FetchProcessorTypesRequest message. Also converts values to other types if specified. - * @param message FetchProcessorTypesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.FetchProcessorTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchProcessorTypesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchProcessorTypesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchProcessorTypesResponse. */ - interface IFetchProcessorTypesResponse { - - /** FetchProcessorTypesResponse processorTypes */ - processorTypes?: (google.cloud.documentai.v1beta3.IProcessorType[]|null); - } - - /** Represents a FetchProcessorTypesResponse. */ - class FetchProcessorTypesResponse implements IFetchProcessorTypesResponse { - - /** - * Constructs a new FetchProcessorTypesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse); - - /** FetchProcessorTypesResponse processorTypes. */ - public processorTypes: google.cloud.documentai.v1beta3.IProcessorType[]; - - /** - * Creates a new FetchProcessorTypesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchProcessorTypesResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse): google.cloud.documentai.v1beta3.FetchProcessorTypesResponse; - - /** - * Encodes the specified FetchProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.verify|verify} messages. - * @param message FetchProcessorTypesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.verify|verify} messages. - * @param message FetchProcessorTypesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchProcessorTypesResponse - * @throws {Error} If the payload is not a 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.v1beta3.FetchProcessorTypesResponse; - - /** - * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchProcessorTypesResponse - * @throws {Error} If the payload is 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.v1beta3.FetchProcessorTypesResponse; - - /** - * Verifies a FetchProcessorTypesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchProcessorTypesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.FetchProcessorTypesResponse; - - /** - * Creates a plain object from a FetchProcessorTypesResponse message. Also converts values to other types if specified. - * @param message FetchProcessorTypesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.FetchProcessorTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchProcessorTypesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchProcessorTypesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProcessorTypesRequest. */ - interface IListProcessorTypesRequest { - - /** ListProcessorTypesRequest parent */ - parent?: (string|null); - - /** ListProcessorTypesRequest pageSize */ - pageSize?: (number|null); - - /** ListProcessorTypesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListProcessorTypesRequest. */ - class ListProcessorTypesRequest implements IListProcessorTypesRequest { - - /** - * Constructs a new ListProcessorTypesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IListProcessorTypesRequest); - - /** ListProcessorTypesRequest parent. */ - public parent: string; - - /** ListProcessorTypesRequest pageSize. */ - public pageSize: number; - - /** ListProcessorTypesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListProcessorTypesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProcessorTypesRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IListProcessorTypesRequest): google.cloud.documentai.v1beta3.ListProcessorTypesRequest; - - /** - * Encodes the specified ListProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesRequest.verify|verify} messages. - * @param message ListProcessorTypesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IListProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesRequest.verify|verify} messages. - * @param message ListProcessorTypesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListProcessorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProcessorTypesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProcessorTypesRequest - * @throws {Error} If the payload is not a 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.v1beta3.ListProcessorTypesRequest; - - /** - * Decodes a ListProcessorTypesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProcessorTypesRequest - * @throws {Error} If the payload is 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.v1beta3.ListProcessorTypesRequest; - - /** - * Verifies a ListProcessorTypesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProcessorTypesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListProcessorTypesRequest; - - /** - * Creates a plain object from a ListProcessorTypesRequest message. Also converts values to other types if specified. - * @param message ListProcessorTypesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ListProcessorTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProcessorTypesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProcessorTypesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProcessorTypesResponse. */ - interface IListProcessorTypesResponse { - - /** ListProcessorTypesResponse processorTypes */ - processorTypes?: (google.cloud.documentai.v1beta3.IProcessorType[]|null); - - /** ListProcessorTypesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListProcessorTypesResponse. */ - class ListProcessorTypesResponse implements IListProcessorTypesResponse { - - /** - * Constructs a new ListProcessorTypesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IListProcessorTypesResponse); - - /** ListProcessorTypesResponse processorTypes. */ - public processorTypes: google.cloud.documentai.v1beta3.IProcessorType[]; - - /** ListProcessorTypesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListProcessorTypesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProcessorTypesResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IListProcessorTypesResponse): google.cloud.documentai.v1beta3.ListProcessorTypesResponse; - - /** - * Encodes the specified ListProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesResponse.verify|verify} messages. - * @param message ListProcessorTypesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IListProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesResponse.verify|verify} messages. - * @param message ListProcessorTypesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListProcessorTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProcessorTypesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProcessorTypesResponse - * @throws {Error} If the payload is not a 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.v1beta3.ListProcessorTypesResponse; - - /** - * Decodes a ListProcessorTypesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProcessorTypesResponse - * @throws {Error} If the payload is 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.v1beta3.ListProcessorTypesResponse; - - /** - * Verifies a ListProcessorTypesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProcessorTypesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListProcessorTypesResponse; - - /** - * Creates a plain object from a ListProcessorTypesResponse message. Also converts values to other types if specified. - * @param message ListProcessorTypesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ListProcessorTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProcessorTypesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProcessorTypesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProcessorsRequest. */ - interface IListProcessorsRequest { - - /** ListProcessorsRequest parent */ - parent?: (string|null); - - /** ListProcessorsRequest pageSize */ - pageSize?: (number|null); - - /** ListProcessorsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListProcessorsRequest. */ - class ListProcessorsRequest implements IListProcessorsRequest { - - /** - * Constructs a new ListProcessorsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IListProcessorsRequest); - - /** ListProcessorsRequest parent. */ - public parent: string; - - /** ListProcessorsRequest pageSize. */ - public pageSize: number; - - /** ListProcessorsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListProcessorsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProcessorsRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IListProcessorsRequest): google.cloud.documentai.v1beta3.ListProcessorsRequest; - - /** - * Encodes the specified ListProcessorsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsRequest.verify|verify} messages. - * @param message ListProcessorsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IListProcessorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProcessorsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsRequest.verify|verify} messages. - * @param message ListProcessorsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListProcessorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProcessorsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProcessorsRequest - * @throws {Error} If the payload is not a 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.v1beta3.ListProcessorsRequest; - - /** - * Decodes a ListProcessorsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProcessorsRequest - * @throws {Error} If the payload is 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.v1beta3.ListProcessorsRequest; - - /** - * Verifies a ListProcessorsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListProcessorsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProcessorsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListProcessorsRequest; - - /** - * Creates a plain object from a ListProcessorsRequest message. Also converts values to other types if specified. - * @param message ListProcessorsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ListProcessorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProcessorsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProcessorsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProcessorsResponse. */ - interface IListProcessorsResponse { - - /** ListProcessorsResponse processors */ - processors?: (google.cloud.documentai.v1beta3.IProcessor[]|null); - - /** ListProcessorsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListProcessorsResponse. */ - class ListProcessorsResponse implements IListProcessorsResponse { - - /** - * Constructs a new ListProcessorsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IListProcessorsResponse); - - /** ListProcessorsResponse processors. */ - public processors: google.cloud.documentai.v1beta3.IProcessor[]; - - /** ListProcessorsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListProcessorsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProcessorsResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IListProcessorsResponse): google.cloud.documentai.v1beta3.ListProcessorsResponse; - - /** - * Encodes the specified ListProcessorsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsResponse.verify|verify} messages. - * @param message ListProcessorsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IListProcessorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProcessorsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsResponse.verify|verify} messages. - * @param message ListProcessorsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListProcessorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProcessorsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProcessorsResponse - * @throws {Error} If the payload is not a 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.v1beta3.ListProcessorsResponse; - - /** - * Decodes a ListProcessorsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProcessorsResponse - * @throws {Error} If the payload is 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.v1beta3.ListProcessorsResponse; - - /** - * Verifies a ListProcessorsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListProcessorsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProcessorsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListProcessorsResponse; - - /** - * Creates a plain object from a ListProcessorsResponse message. Also converts values to other types if specified. - * @param message ListProcessorsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ListProcessorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProcessorsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProcessorsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetProcessorTypeRequest. */ - interface IGetProcessorTypeRequest { - - /** GetProcessorTypeRequest name */ - name?: (string|null); - } - - /** Represents a GetProcessorTypeRequest. */ - class GetProcessorTypeRequest implements IGetProcessorTypeRequest { - - /** - * Constructs a new GetProcessorTypeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGetProcessorTypeRequest); - - /** GetProcessorTypeRequest name. */ - public name: string; - - /** - * Creates a new GetProcessorTypeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetProcessorTypeRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IGetProcessorTypeRequest): google.cloud.documentai.v1beta3.GetProcessorTypeRequest; - - /** - * Encodes the specified GetProcessorTypeRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorTypeRequest.verify|verify} messages. - * @param message GetProcessorTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetProcessorTypeRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorTypeRequest.verify|verify} messages. - * @param message GetProcessorTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetProcessorTypeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetProcessorTypeRequest - * @throws {Error} If the payload is not a 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.v1beta3.GetProcessorTypeRequest; - - /** - * Decodes a GetProcessorTypeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetProcessorTypeRequest - * @throws {Error} If the payload is 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.v1beta3.GetProcessorTypeRequest; - - /** - * Verifies a GetProcessorTypeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetProcessorTypeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetProcessorTypeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GetProcessorTypeRequest; - - /** - * Creates a plain object from a GetProcessorTypeRequest message. Also converts values to other types if specified. - * @param message GetProcessorTypeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.GetProcessorTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetProcessorTypeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetProcessorTypeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetProcessorRequest. */ - interface IGetProcessorRequest { - - /** GetProcessorRequest name */ - name?: (string|null); - } - - /** Represents a GetProcessorRequest. */ - class GetProcessorRequest implements IGetProcessorRequest { - - /** - * Constructs a new GetProcessorRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGetProcessorRequest); - - /** GetProcessorRequest name. */ - public name: string; - - /** - * Creates a new GetProcessorRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetProcessorRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IGetProcessorRequest): google.cloud.documentai.v1beta3.GetProcessorRequest; - - /** - * Encodes the specified GetProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorRequest.verify|verify} messages. - * @param message GetProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IGetProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorRequest.verify|verify} messages. - * @param message GetProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGetProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetProcessorRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetProcessorRequest - * @throws {Error} If the payload is not a 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.v1beta3.GetProcessorRequest; - - /** - * Decodes a GetProcessorRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetProcessorRequest - * @throws {Error} If the payload is 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.v1beta3.GetProcessorRequest; - - /** - * Verifies a GetProcessorRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetProcessorRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GetProcessorRequest; - - /** - * Creates a plain object from a GetProcessorRequest message. Also converts values to other types if specified. - * @param message GetProcessorRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.GetProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetProcessorRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetProcessorRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetProcessorVersionRequest. */ - interface IGetProcessorVersionRequest { - - /** GetProcessorVersionRequest name */ - name?: (string|null); - } - - /** Represents a GetProcessorVersionRequest. */ - class GetProcessorVersionRequest implements IGetProcessorVersionRequest { - - /** - * Constructs a new GetProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGetProcessorVersionRequest); - - /** GetProcessorVersionRequest name. */ - public name: string; - - /** - * Creates a new GetProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IGetProcessorVersionRequest): google.cloud.documentai.v1beta3.GetProcessorVersionRequest; - - /** - * Encodes the specified GetProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorVersionRequest.verify|verify} messages. - * @param message GetProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorVersionRequest.verify|verify} messages. - * @param message GetProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetProcessorVersionRequest - * @throws {Error} If the payload is not a 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.v1beta3.GetProcessorVersionRequest; - - /** - * Decodes a GetProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetProcessorVersionRequest - * @throws {Error} If the payload is 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.v1beta3.GetProcessorVersionRequest; - - /** - * Verifies a GetProcessorVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GetProcessorVersionRequest; - - /** - * Creates a plain object from a GetProcessorVersionRequest message. Also converts values to other types if specified. - * @param message GetProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.GetProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProcessorVersionsRequest. */ - interface IListProcessorVersionsRequest { - - /** ListProcessorVersionsRequest parent */ - parent?: (string|null); - - /** ListProcessorVersionsRequest pageSize */ - pageSize?: (number|null); - - /** ListProcessorVersionsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListProcessorVersionsRequest. */ - class ListProcessorVersionsRequest implements IListProcessorVersionsRequest { - - /** - * Constructs a new ListProcessorVersionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IListProcessorVersionsRequest); - - /** ListProcessorVersionsRequest parent. */ - public parent: string; - - /** ListProcessorVersionsRequest pageSize. */ - public pageSize: number; - - /** ListProcessorVersionsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListProcessorVersionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProcessorVersionsRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IListProcessorVersionsRequest): google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; - - /** - * Encodes the specified ListProcessorVersionsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.verify|verify} messages. - * @param message ListProcessorVersionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProcessorVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.verify|verify} messages. - * @param message ListProcessorVersionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProcessorVersionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProcessorVersionsRequest - * @throws {Error} If the payload is not a 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.v1beta3.ListProcessorVersionsRequest; - - /** - * Decodes a ListProcessorVersionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProcessorVersionsRequest - * @throws {Error} If the payload is 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.v1beta3.ListProcessorVersionsRequest; - - /** - * Verifies a ListProcessorVersionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListProcessorVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProcessorVersionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListProcessorVersionsRequest; - - /** - * Creates a plain object from a ListProcessorVersionsRequest message. Also converts values to other types if specified. - * @param message ListProcessorVersionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ListProcessorVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProcessorVersionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProcessorVersionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListProcessorVersionsResponse. */ - interface IListProcessorVersionsResponse { - - /** ListProcessorVersionsResponse processorVersions */ - processorVersions?: (google.cloud.documentai.v1beta3.IProcessorVersion[]|null); - - /** ListProcessorVersionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListProcessorVersionsResponse. */ - class ListProcessorVersionsResponse implements IListProcessorVersionsResponse { - - /** - * Constructs a new ListProcessorVersionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IListProcessorVersionsResponse); - - /** ListProcessorVersionsResponse processorVersions. */ - public processorVersions: google.cloud.documentai.v1beta3.IProcessorVersion[]; - - /** ListProcessorVersionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListProcessorVersionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListProcessorVersionsResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IListProcessorVersionsResponse): google.cloud.documentai.v1beta3.ListProcessorVersionsResponse; - - /** - * Encodes the specified ListProcessorVersionsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.verify|verify} messages. - * @param message ListProcessorVersionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IListProcessorVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListProcessorVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.verify|verify} messages. - * @param message ListProcessorVersionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListProcessorVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListProcessorVersionsResponse - * @throws {Error} If the payload is not a 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.v1beta3.ListProcessorVersionsResponse; - - /** - * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListProcessorVersionsResponse - * @throws {Error} If the payload is 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.v1beta3.ListProcessorVersionsResponse; - - /** - * Verifies a ListProcessorVersionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListProcessorVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListProcessorVersionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListProcessorVersionsResponse; - - /** - * Creates a plain object from a ListProcessorVersionsResponse message. Also converts values to other types if specified. - * @param message ListProcessorVersionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ListProcessorVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListProcessorVersionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListProcessorVersionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteProcessorVersionRequest. */ - interface IDeleteProcessorVersionRequest { - - /** DeleteProcessorVersionRequest name */ - name?: (string|null); - } - - /** Represents a DeleteProcessorVersionRequest. */ - class DeleteProcessorVersionRequest implements IDeleteProcessorVersionRequest { - - /** - * Constructs a new DeleteProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest); - - /** DeleteProcessorVersionRequest name. */ - public name: string; - - /** - * Creates a new DeleteProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest): google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; - - /** - * Encodes the specified DeleteProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.verify|verify} messages. - * @param message DeleteProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.verify|verify} messages. - * @param message DeleteProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteProcessorVersionRequest - * @throws {Error} If the payload is not a 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.v1beta3.DeleteProcessorVersionRequest; - - /** - * Decodes a DeleteProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteProcessorVersionRequest - * @throws {Error} If the payload is 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.v1beta3.DeleteProcessorVersionRequest; - - /** - * Verifies a DeleteProcessorVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest; - - /** - * Creates a plain object from a DeleteProcessorVersionRequest message. Also converts values to other types if specified. - * @param message DeleteProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteProcessorVersionMetadata. */ - interface IDeleteProcessorVersionMetadata { - - /** DeleteProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - } - - /** Represents a DeleteProcessorVersionMetadata. */ - class DeleteProcessorVersionMetadata implements IDeleteProcessorVersionMetadata { - - /** - * Constructs a new DeleteProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata); - - /** DeleteProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** - * Creates a new DeleteProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata): google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata; - - /** - * Encodes the specified DeleteProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.verify|verify} messages. - * @param message DeleteProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.verify|verify} messages. - * @param message DeleteProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.v1beta3.DeleteProcessorVersionMetadata; - - /** - * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteProcessorVersionMetadata - * @throws {Error} If the payload is 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.v1beta3.DeleteProcessorVersionMetadata; - - /** - * Verifies a DeleteProcessorVersionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata; - - /** - * Creates a plain object from a DeleteProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message DeleteProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeployProcessorVersionRequest. */ - interface IDeployProcessorVersionRequest { - - /** DeployProcessorVersionRequest name */ - name?: (string|null); - } - - /** Represents a DeployProcessorVersionRequest. */ - class DeployProcessorVersionRequest implements IDeployProcessorVersionRequest { - - /** - * Constructs a new DeployProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest); - - /** DeployProcessorVersionRequest name. */ - public name: string; - - /** - * Creates a new DeployProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeployProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest): google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; - - /** - * Encodes the specified DeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.verify|verify} messages. - * @param message DeployProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.verify|verify} messages. - * @param message DeployProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeployProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeployProcessorVersionRequest - * @throws {Error} If the payload is not a 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.v1beta3.DeployProcessorVersionRequest; - - /** - * Decodes a DeployProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeployProcessorVersionRequest - * @throws {Error} If the payload is 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.v1beta3.DeployProcessorVersionRequest; - - /** - * Verifies a DeployProcessorVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeployProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeployProcessorVersionRequest; - - /** - * Creates a plain object from a DeployProcessorVersionRequest message. Also converts values to other types if specified. - * @param message DeployProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DeployProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeployProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeployProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeployProcessorVersionResponse. */ - interface IDeployProcessorVersionResponse { - } - - /** Represents a DeployProcessorVersionResponse. */ - class DeployProcessorVersionResponse implements IDeployProcessorVersionResponse { - - /** - * Constructs a new DeployProcessorVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse); - - /** - * Creates a new DeployProcessorVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns DeployProcessorVersionResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse): google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; - - /** - * Encodes the specified DeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.verify|verify} messages. - * @param message DeployProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.verify|verify} messages. - * @param message DeployProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeployProcessorVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeployProcessorVersionResponse - * @throws {Error} If the payload is not a 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.v1beta3.DeployProcessorVersionResponse; - - /** - * Decodes a DeployProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeployProcessorVersionResponse - * @throws {Error} If the payload is 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.v1beta3.DeployProcessorVersionResponse; - - /** - * Verifies a DeployProcessorVersionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeployProcessorVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeployProcessorVersionResponse; - - /** - * Creates a plain object from a DeployProcessorVersionResponse message. Also converts values to other types if specified. - * @param message DeployProcessorVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DeployProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeployProcessorVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeployProcessorVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeployProcessorVersionMetadata. */ - interface IDeployProcessorVersionMetadata { - - /** DeployProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - } - - /** Represents a DeployProcessorVersionMetadata. */ - class DeployProcessorVersionMetadata implements IDeployProcessorVersionMetadata { - - /** - * Constructs a new DeployProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata); - - /** DeployProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** - * Creates a new DeployProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DeployProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata): google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata; - - /** - * Encodes the specified DeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.verify|verify} messages. - * @param message DeployProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.verify|verify} messages. - * @param message DeployProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeployProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.v1beta3.DeployProcessorVersionMetadata; - - /** - * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeployProcessorVersionMetadata - * @throws {Error} If the payload is 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.v1beta3.DeployProcessorVersionMetadata; - - /** - * Verifies a DeployProcessorVersionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeployProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata; - - /** - * Creates a plain object from a DeployProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message DeployProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeployProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeployProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UndeployProcessorVersionRequest. */ - interface IUndeployProcessorVersionRequest { - - /** UndeployProcessorVersionRequest name */ - name?: (string|null); - } - - /** Represents an UndeployProcessorVersionRequest. */ - class UndeployProcessorVersionRequest implements IUndeployProcessorVersionRequest { - - /** - * Constructs a new UndeployProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest); - - /** UndeployProcessorVersionRequest name. */ - public name: string; - - /** - * Creates a new UndeployProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UndeployProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest): google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; - - /** - * Encodes the specified UndeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.verify|verify} messages. - * @param message UndeployProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UndeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.verify|verify} messages. - * @param message UndeployProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UndeployProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UndeployProcessorVersionRequest - * @throws {Error} If the payload is not a 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.v1beta3.UndeployProcessorVersionRequest; - - /** - * Decodes an UndeployProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UndeployProcessorVersionRequest - * @throws {Error} If the payload is 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.v1beta3.UndeployProcessorVersionRequest; - - /** - * Verifies an UndeployProcessorVersionRequest message. - * @param message Plain 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 UndeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UndeployProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest; - - /** - * Creates a plain object from an UndeployProcessorVersionRequest message. Also converts values to other types if specified. - * @param message UndeployProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UndeployProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UndeployProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UndeployProcessorVersionResponse. */ - interface IUndeployProcessorVersionResponse { - } - - /** Represents an UndeployProcessorVersionResponse. */ - class UndeployProcessorVersionResponse implements IUndeployProcessorVersionResponse { - - /** - * Constructs a new UndeployProcessorVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse); - - /** - * Creates a new UndeployProcessorVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns UndeployProcessorVersionResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse): google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; - - /** - * Encodes the specified UndeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.verify|verify} messages. - * @param message UndeployProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UndeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.verify|verify} messages. - * @param message UndeployProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UndeployProcessorVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UndeployProcessorVersionResponse - * @throws {Error} If the payload is not a 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.v1beta3.UndeployProcessorVersionResponse; - - /** - * Decodes an UndeployProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UndeployProcessorVersionResponse - * @throws {Error} If the payload is 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.v1beta3.UndeployProcessorVersionResponse; - - /** - * Verifies an UndeployProcessorVersionResponse message. - * @param message Plain 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 UndeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UndeployProcessorVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse; - - /** - * Creates a plain object from an UndeployProcessorVersionResponse message. Also converts values to other types if specified. - * @param message UndeployProcessorVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UndeployProcessorVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UndeployProcessorVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UndeployProcessorVersionMetadata. */ - interface IUndeployProcessorVersionMetadata { - - /** UndeployProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - } - - /** Represents an UndeployProcessorVersionMetadata. */ - class UndeployProcessorVersionMetadata implements IUndeployProcessorVersionMetadata { - - /** - * Constructs a new UndeployProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata); - - /** UndeployProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** - * Creates a new UndeployProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UndeployProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata): google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata; - - /** - * Encodes the specified UndeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.verify|verify} messages. - * @param message UndeployProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UndeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.verify|verify} messages. - * @param message UndeployProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UndeployProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.v1beta3.UndeployProcessorVersionMetadata; - - /** - * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UndeployProcessorVersionMetadata - * @throws {Error} If the payload is 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.v1beta3.UndeployProcessorVersionMetadata; - - /** - * Verifies an UndeployProcessorVersionMetadata message. - * @param message Plain 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 UndeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UndeployProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata; - - /** - * Creates a plain object from an UndeployProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message UndeployProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UndeployProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UndeployProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateProcessorRequest. */ - interface ICreateProcessorRequest { - - /** CreateProcessorRequest parent */ - parent?: (string|null); - - /** CreateProcessorRequest processor */ - processor?: (google.cloud.documentai.v1beta3.IProcessor|null); - } - - /** Represents a CreateProcessorRequest. */ - class CreateProcessorRequest implements ICreateProcessorRequest { - - /** - * Constructs a new CreateProcessorRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ICreateProcessorRequest); - - /** CreateProcessorRequest parent. */ - public parent: string; - - /** CreateProcessorRequest processor. */ - public processor?: (google.cloud.documentai.v1beta3.IProcessor|null); - - /** - * Creates a new CreateProcessorRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateProcessorRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ICreateProcessorRequest): google.cloud.documentai.v1beta3.CreateProcessorRequest; - - /** - * Encodes the specified CreateProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.CreateProcessorRequest.verify|verify} messages. - * @param message CreateProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ICreateProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.CreateProcessorRequest.verify|verify} messages. - * @param message CreateProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ICreateProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateProcessorRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateProcessorRequest - * @throws {Error} If the payload is not a 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.v1beta3.CreateProcessorRequest; - - /** - * Decodes a CreateProcessorRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateProcessorRequest - * @throws {Error} If the payload is 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.v1beta3.CreateProcessorRequest; - - /** - * Verifies a CreateProcessorRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateProcessorRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.CreateProcessorRequest; - - /** - * Creates a plain object from a CreateProcessorRequest message. Also converts values to other types if specified. - * @param message CreateProcessorRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.CreateProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateProcessorRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateProcessorRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteProcessorRequest. */ - interface IDeleteProcessorRequest { - - /** DeleteProcessorRequest name */ - name?: (string|null); - } - - /** Represents a DeleteProcessorRequest. */ - class DeleteProcessorRequest implements IDeleteProcessorRequest { - - /** - * Constructs a new DeleteProcessorRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorRequest); - - /** DeleteProcessorRequest name. */ - public name: string; - - /** - * Creates a new DeleteProcessorRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteProcessorRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorRequest): google.cloud.documentai.v1beta3.DeleteProcessorRequest; - - /** - * Encodes the specified DeleteProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorRequest.verify|verify} messages. - * @param message DeleteProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDeleteProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorRequest.verify|verify} messages. - * @param message DeleteProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeleteProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteProcessorRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteProcessorRequest - * @throws {Error} If the payload is not a 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.v1beta3.DeleteProcessorRequest; - - /** - * Decodes a DeleteProcessorRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteProcessorRequest - * @throws {Error} If the payload is 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.v1beta3.DeleteProcessorRequest; - - /** - * Verifies a DeleteProcessorRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteProcessorRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeleteProcessorRequest; - - /** - * Creates a plain object from a DeleteProcessorRequest message. Also converts values to other types if specified. - * @param message DeleteProcessorRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DeleteProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteProcessorRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteProcessorRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteProcessorMetadata. */ - interface IDeleteProcessorMetadata { - - /** DeleteProcessorMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - } - - /** Represents a DeleteProcessorMetadata. */ - class DeleteProcessorMetadata implements IDeleteProcessorMetadata { - - /** - * Constructs a new DeleteProcessorMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorMetadata); - - /** DeleteProcessorMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** - * Creates a new DeleteProcessorMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteProcessorMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDeleteProcessorMetadata): google.cloud.documentai.v1beta3.DeleteProcessorMetadata; - - /** - * Encodes the specified DeleteProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorMetadata.verify|verify} messages. - * @param message DeleteProcessorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDeleteProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorMetadata.verify|verify} messages. - * @param message DeleteProcessorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDeleteProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteProcessorMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteProcessorMetadata - * @throws {Error} If the payload is not a 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.v1beta3.DeleteProcessorMetadata; - - /** - * Decodes a DeleteProcessorMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteProcessorMetadata - * @throws {Error} If the payload is 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.v1beta3.DeleteProcessorMetadata; - - /** - * Verifies a DeleteProcessorMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteProcessorMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteProcessorMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DeleteProcessorMetadata; - - /** - * Creates a plain object from a DeleteProcessorMetadata message. Also converts values to other types if specified. - * @param message DeleteProcessorMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DeleteProcessorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteProcessorMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteProcessorMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnableProcessorRequest. */ - interface IEnableProcessorRequest { - - /** EnableProcessorRequest name */ - name?: (string|null); - } - - /** Represents an EnableProcessorRequest. */ - class EnableProcessorRequest implements IEnableProcessorRequest { - - /** - * Constructs a new EnableProcessorRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IEnableProcessorRequest); - - /** EnableProcessorRequest name. */ - public name: string; - - /** - * Creates a new EnableProcessorRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns EnableProcessorRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IEnableProcessorRequest): google.cloud.documentai.v1beta3.EnableProcessorRequest; - - /** - * Encodes the specified EnableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorRequest.verify|verify} messages. - * @param message EnableProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IEnableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorRequest.verify|verify} messages. - * @param message EnableProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEnableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnableProcessorRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnableProcessorRequest - * @throws {Error} If the payload is not a 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.v1beta3.EnableProcessorRequest; - - /** - * Decodes an EnableProcessorRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnableProcessorRequest - * @throws {Error} If the payload is 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.v1beta3.EnableProcessorRequest; - - /** - * Verifies an EnableProcessorRequest message. - * @param message Plain 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 EnableProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnableProcessorRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EnableProcessorRequest; - - /** - * Creates a plain object from an EnableProcessorRequest message. Also converts values to other types if specified. - * @param message EnableProcessorRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.EnableProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnableProcessorRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnableProcessorRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnableProcessorResponse. */ - interface IEnableProcessorResponse { - } - - /** Represents an EnableProcessorResponse. */ - class EnableProcessorResponse implements IEnableProcessorResponse { - - /** - * Constructs a new EnableProcessorResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IEnableProcessorResponse); - - /** - * Creates a new EnableProcessorResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns EnableProcessorResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IEnableProcessorResponse): google.cloud.documentai.v1beta3.EnableProcessorResponse; - - /** - * Encodes the specified EnableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorResponse.verify|verify} messages. - * @param message EnableProcessorResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IEnableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorResponse.verify|verify} messages. - * @param message EnableProcessorResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEnableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnableProcessorResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnableProcessorResponse - * @throws {Error} If the payload is not a 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.v1beta3.EnableProcessorResponse; - - /** - * Decodes an EnableProcessorResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnableProcessorResponse - * @throws {Error} If the payload is 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.v1beta3.EnableProcessorResponse; - - /** - * Verifies an EnableProcessorResponse message. - * @param message Plain 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 EnableProcessorResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnableProcessorResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EnableProcessorResponse; - - /** - * Creates a plain object from an EnableProcessorResponse message. Also converts values to other types if specified. - * @param message EnableProcessorResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.EnableProcessorResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnableProcessorResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnableProcessorResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnableProcessorMetadata. */ - interface IEnableProcessorMetadata { - - /** EnableProcessorMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - } - - /** Represents an EnableProcessorMetadata. */ - class EnableProcessorMetadata implements IEnableProcessorMetadata { - - /** - * Constructs a new EnableProcessorMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IEnableProcessorMetadata); - - /** EnableProcessorMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** - * Creates a new EnableProcessorMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns EnableProcessorMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IEnableProcessorMetadata): google.cloud.documentai.v1beta3.EnableProcessorMetadata; - - /** - * Encodes the specified EnableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorMetadata.verify|verify} messages. - * @param message EnableProcessorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IEnableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorMetadata.verify|verify} messages. - * @param message EnableProcessorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEnableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnableProcessorMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnableProcessorMetadata - * @throws {Error} If the payload is not a 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.v1beta3.EnableProcessorMetadata; - - /** - * Decodes an EnableProcessorMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnableProcessorMetadata - * @throws {Error} If the payload is 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.v1beta3.EnableProcessorMetadata; - - /** - * Verifies an EnableProcessorMetadata message. - * @param message Plain 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 EnableProcessorMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnableProcessorMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EnableProcessorMetadata; - - /** - * Creates a plain object from an EnableProcessorMetadata message. Also converts values to other types if specified. - * @param message EnableProcessorMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.EnableProcessorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnableProcessorMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnableProcessorMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DisableProcessorRequest. */ - interface IDisableProcessorRequest { - - /** DisableProcessorRequest name */ - name?: (string|null); - } - - /** Represents a DisableProcessorRequest. */ - class DisableProcessorRequest implements IDisableProcessorRequest { - - /** - * Constructs a new DisableProcessorRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDisableProcessorRequest); - - /** DisableProcessorRequest name. */ - public name: string; - - /** - * Creates a new DisableProcessorRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DisableProcessorRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDisableProcessorRequest): google.cloud.documentai.v1beta3.DisableProcessorRequest; - - /** - * Encodes the specified DisableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorRequest.verify|verify} messages. - * @param message DisableProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDisableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorRequest.verify|verify} messages. - * @param message DisableProcessorRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDisableProcessorRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisableProcessorRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisableProcessorRequest - * @throws {Error} If the payload is not a 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.v1beta3.DisableProcessorRequest; - - /** - * Decodes a DisableProcessorRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisableProcessorRequest - * @throws {Error} If the payload is 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.v1beta3.DisableProcessorRequest; - - /** - * Verifies a DisableProcessorRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DisableProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisableProcessorRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DisableProcessorRequest; - - /** - * Creates a plain object from a DisableProcessorRequest message. Also converts values to other types if specified. - * @param message DisableProcessorRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DisableProcessorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisableProcessorRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisableProcessorRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DisableProcessorResponse. */ - interface IDisableProcessorResponse { - } - - /** Represents a DisableProcessorResponse. */ - class DisableProcessorResponse implements IDisableProcessorResponse { - - /** - * Constructs a new DisableProcessorResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDisableProcessorResponse); - - /** - * Creates a new DisableProcessorResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns DisableProcessorResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDisableProcessorResponse): google.cloud.documentai.v1beta3.DisableProcessorResponse; - - /** - * Encodes the specified DisableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorResponse.verify|verify} messages. - * @param message DisableProcessorResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDisableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorResponse.verify|verify} messages. - * @param message DisableProcessorResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDisableProcessorResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisableProcessorResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisableProcessorResponse - * @throws {Error} If the payload is not a 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.v1beta3.DisableProcessorResponse; - - /** - * Decodes a DisableProcessorResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisableProcessorResponse - * @throws {Error} If the payload is 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.v1beta3.DisableProcessorResponse; - - /** - * Verifies a DisableProcessorResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DisableProcessorResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisableProcessorResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DisableProcessorResponse; - - /** - * Creates a plain object from a DisableProcessorResponse message. Also converts values to other types if specified. - * @param message DisableProcessorResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DisableProcessorResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisableProcessorResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisableProcessorResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DisableProcessorMetadata. */ - interface IDisableProcessorMetadata { - - /** DisableProcessorMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - } - - /** Represents a DisableProcessorMetadata. */ - class DisableProcessorMetadata implements IDisableProcessorMetadata { - - /** - * Constructs a new DisableProcessorMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDisableProcessorMetadata); - - /** DisableProcessorMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** - * Creates a new DisableProcessorMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DisableProcessorMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDisableProcessorMetadata): google.cloud.documentai.v1beta3.DisableProcessorMetadata; - - /** - * Encodes the specified DisableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorMetadata.verify|verify} messages. - * @param message DisableProcessorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDisableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorMetadata.verify|verify} messages. - * @param message DisableProcessorMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDisableProcessorMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisableProcessorMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisableProcessorMetadata - * @throws {Error} If the payload is not a 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.v1beta3.DisableProcessorMetadata; - - /** - * Decodes a DisableProcessorMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisableProcessorMetadata - * @throws {Error} If the payload is 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.v1beta3.DisableProcessorMetadata; - - /** - * Verifies a DisableProcessorMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DisableProcessorMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisableProcessorMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DisableProcessorMetadata; - - /** - * Creates a plain object from a DisableProcessorMetadata message. Also converts values to other types if specified. - * @param message DisableProcessorMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DisableProcessorMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisableProcessorMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisableProcessorMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SetDefaultProcessorVersionRequest. */ - interface ISetDefaultProcessorVersionRequest { - - /** SetDefaultProcessorVersionRequest processor */ - processor?: (string|null); - - /** SetDefaultProcessorVersionRequest defaultProcessorVersion */ - defaultProcessorVersion?: (string|null); - } - - /** Represents a SetDefaultProcessorVersionRequest. */ - class SetDefaultProcessorVersionRequest implements ISetDefaultProcessorVersionRequest { - - /** - * Constructs a new SetDefaultProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest); - - /** SetDefaultProcessorVersionRequest processor. */ - public processor: string; - - /** SetDefaultProcessorVersionRequest defaultProcessorVersion. */ - public defaultProcessorVersion: string; - - /** - * Creates a new SetDefaultProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetDefaultProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest): google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; - - /** - * Encodes the specified SetDefaultProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.verify|verify} messages. - * @param message SetDefaultProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetDefaultProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.verify|verify} messages. - * @param message SetDefaultProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetDefaultProcessorVersionRequest - * @throws {Error} If the payload is not a 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.v1beta3.SetDefaultProcessorVersionRequest; - - /** - * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetDefaultProcessorVersionRequest - * @throws {Error} If the payload is 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.v1beta3.SetDefaultProcessorVersionRequest; - - /** - * Verifies a SetDefaultProcessorVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetDefaultProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetDefaultProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest; - - /** - * Creates a plain object from a SetDefaultProcessorVersionRequest message. Also converts values to other types if specified. - * @param message SetDefaultProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetDefaultProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetDefaultProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SetDefaultProcessorVersionResponse. */ - interface ISetDefaultProcessorVersionResponse { - } - - /** Represents a SetDefaultProcessorVersionResponse. */ - class SetDefaultProcessorVersionResponse implements ISetDefaultProcessorVersionResponse { - - /** - * Constructs a new SetDefaultProcessorVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse); - - /** - * Creates a new SetDefaultProcessorVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SetDefaultProcessorVersionResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse): google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse; - - /** - * Encodes the specified SetDefaultProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.verify|verify} messages. - * @param message SetDefaultProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetDefaultProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.verify|verify} messages. - * @param message SetDefaultProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetDefaultProcessorVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetDefaultProcessorVersionResponse - * @throws {Error} If the payload is not a 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.v1beta3.SetDefaultProcessorVersionResponse; - - /** - * Decodes a SetDefaultProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetDefaultProcessorVersionResponse - * @throws {Error} If the payload is 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.v1beta3.SetDefaultProcessorVersionResponse; - - /** - * Verifies a SetDefaultProcessorVersionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetDefaultProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetDefaultProcessorVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse; - - /** - * Creates a plain object from a SetDefaultProcessorVersionResponse message. Also converts values to other types if specified. - * @param message SetDefaultProcessorVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetDefaultProcessorVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetDefaultProcessorVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SetDefaultProcessorVersionMetadata. */ - interface ISetDefaultProcessorVersionMetadata { - - /** SetDefaultProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - } - - /** Represents a SetDefaultProcessorVersionMetadata. */ - class SetDefaultProcessorVersionMetadata implements ISetDefaultProcessorVersionMetadata { - - /** - * Constructs a new SetDefaultProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata); - - /** SetDefaultProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** - * Creates a new SetDefaultProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns SetDefaultProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata): google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata; - - /** - * Encodes the specified SetDefaultProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.verify|verify} messages. - * @param message SetDefaultProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetDefaultProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.verify|verify} messages. - * @param message SetDefaultProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetDefaultProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.v1beta3.SetDefaultProcessorVersionMetadata; - - /** - * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetDefaultProcessorVersionMetadata - * @throws {Error} If the payload is 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.v1beta3.SetDefaultProcessorVersionMetadata; - - /** - * Verifies a SetDefaultProcessorVersionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetDefaultProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetDefaultProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata; - - /** - * Creates a plain object from a SetDefaultProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message SetDefaultProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetDefaultProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetDefaultProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TrainProcessorVersionRequest. */ - interface ITrainProcessorVersionRequest { - - /** TrainProcessorVersionRequest customDocumentExtractionOptions */ - customDocumentExtractionOptions?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null); - - /** TrainProcessorVersionRequest foundationModelTuningOptions */ - foundationModelTuningOptions?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null); - - /** TrainProcessorVersionRequest parent */ - parent?: (string|null); - - /** TrainProcessorVersionRequest processorVersion */ - processorVersion?: (google.cloud.documentai.v1beta3.IProcessorVersion|null); - - /** TrainProcessorVersionRequest documentSchema */ - documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); - - /** TrainProcessorVersionRequest inputData */ - inputData?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData|null); - - /** TrainProcessorVersionRequest baseProcessorVersion */ - baseProcessorVersion?: (string|null); - } - - /** Represents a TrainProcessorVersionRequest. */ - class TrainProcessorVersionRequest implements ITrainProcessorVersionRequest { - - /** - * Constructs a new TrainProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest); - - /** TrainProcessorVersionRequest customDocumentExtractionOptions. */ - public customDocumentExtractionOptions?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null); - - /** TrainProcessorVersionRequest foundationModelTuningOptions. */ - public foundationModelTuningOptions?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null); - - /** TrainProcessorVersionRequest parent. */ - public parent: string; - - /** TrainProcessorVersionRequest processorVersion. */ - public processorVersion?: (google.cloud.documentai.v1beta3.IProcessorVersion|null); - - /** TrainProcessorVersionRequest documentSchema. */ - public documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); - - /** TrainProcessorVersionRequest inputData. */ - public inputData?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData|null); - - /** TrainProcessorVersionRequest baseProcessorVersion. */ - public baseProcessorVersion: string; - - /** TrainProcessorVersionRequest processorFlags. */ - public processorFlags?: ("customDocumentExtractionOptions"|"foundationModelTuningOptions"); - - /** - * Creates a new TrainProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TrainProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest; - - /** - * Encodes the specified TrainProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.verify|verify} messages. - * @param message TrainProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrainProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.verify|verify} messages. - * @param message TrainProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrainProcessorVersionRequest - * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionRequest; - - /** - * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrainProcessorVersionRequest - * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionRequest; - - /** - * Verifies a TrainProcessorVersionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrainProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrainProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest; - - /** - * Creates a plain object from a TrainProcessorVersionRequest message. Also converts values to other types if specified. - * @param message TrainProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrainProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrainProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TrainProcessorVersionRequest { - - /** Properties of an InputData. */ - interface IInputData { - - /** InputData trainingDocuments */ - trainingDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); - - /** InputData testDocuments */ - testDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); - } - - /** Represents an InputData. */ - class InputData implements IInputData { - - /** - * Constructs a new InputData. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData); - - /** InputData trainingDocuments. */ - public trainingDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); - - /** InputData testDocuments. */ - public testDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); - - /** - * Creates a new InputData instance using the specified properties. - * @param [properties] Properties to set - * @returns InputData instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData; - - /** - * Encodes the specified InputData message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.verify|verify} messages. - * @param message InputData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InputData message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.verify|verify} messages. - * @param message InputData message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InputData message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InputData - * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionRequest.InputData; - - /** - * Decodes an InputData message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InputData - * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionRequest.InputData; - - /** - * Verifies an InputData message. - * @param message Plain 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 InputData message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InputData - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData; - - /** - * Creates a plain object from an InputData message. Also converts values to other types if specified. - * @param message InputData - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InputData to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InputData - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomDocumentExtractionOptions. */ - interface ICustomDocumentExtractionOptions { - - /** CustomDocumentExtractionOptions trainingMethod */ - trainingMethod?: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|keyof typeof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|null); - } - - /** Represents a CustomDocumentExtractionOptions. */ - class CustomDocumentExtractionOptions implements ICustomDocumentExtractionOptions { - - /** - * Constructs a new CustomDocumentExtractionOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions); - - /** CustomDocumentExtractionOptions trainingMethod. */ - public trainingMethod: (google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|keyof typeof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod); - - /** - * Creates a new CustomDocumentExtractionOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomDocumentExtractionOptions instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; - - /** - * Encodes the specified CustomDocumentExtractionOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. - * @param message CustomDocumentExtractionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomDocumentExtractionOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. - * @param message CustomDocumentExtractionOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomDocumentExtractionOptions - * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; - - /** - * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomDocumentExtractionOptions - * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; - - /** - * Verifies a CustomDocumentExtractionOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomDocumentExtractionOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomDocumentExtractionOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions; - - /** - * Creates a plain object from a CustomDocumentExtractionOptions message. Also converts values to other types if specified. - * @param message CustomDocumentExtractionOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomDocumentExtractionOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomDocumentExtractionOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CustomDocumentExtractionOptions { - - /** TrainingMethod enum. */ - enum TrainingMethod { - TRAINING_METHOD_UNSPECIFIED = 0, - MODEL_BASED = 1, - TEMPLATE_BASED = 2 - } - } - - /** Properties of a FoundationModelTuningOptions. */ - interface IFoundationModelTuningOptions { - - /** FoundationModelTuningOptions trainSteps */ - trainSteps?: (number|null); - - /** FoundationModelTuningOptions learningRateMultiplier */ - learningRateMultiplier?: (number|null); - } - - /** Represents a FoundationModelTuningOptions. */ - class FoundationModelTuningOptions implements IFoundationModelTuningOptions { - - /** - * Constructs a new FoundationModelTuningOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions); - - /** FoundationModelTuningOptions trainSteps. */ - public trainSteps: number; - - /** FoundationModelTuningOptions learningRateMultiplier. */ - public learningRateMultiplier: number; - - /** - * Creates a new FoundationModelTuningOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FoundationModelTuningOptions instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions; - - /** - * Encodes the specified FoundationModelTuningOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. - * @param message FoundationModelTuningOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FoundationModelTuningOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. - * @param message FoundationModelTuningOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FoundationModelTuningOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FoundationModelTuningOptions - * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions; - - /** - * Decodes a FoundationModelTuningOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FoundationModelTuningOptions - * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions; - - /** - * Verifies a FoundationModelTuningOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FoundationModelTuningOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FoundationModelTuningOptions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions; - - /** - * Creates a plain object from a FoundationModelTuningOptions message. Also converts values to other types if specified. - * @param message FoundationModelTuningOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FoundationModelTuningOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FoundationModelTuningOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a TrainProcessorVersionResponse. */ - interface ITrainProcessorVersionResponse { - - /** TrainProcessorVersionResponse processorVersion */ - processorVersion?: (string|null); - } - - /** Represents a TrainProcessorVersionResponse. */ - class TrainProcessorVersionResponse implements ITrainProcessorVersionResponse { - - /** - * Constructs a new TrainProcessorVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse); - - /** TrainProcessorVersionResponse processorVersion. */ - public processorVersion: string; - - /** - * Creates a new TrainProcessorVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TrainProcessorVersionResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse): google.cloud.documentai.v1beta3.TrainProcessorVersionResponse; - - /** - * Encodes the specified TrainProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionResponse.verify|verify} messages. - * @param message TrainProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrainProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionResponse.verify|verify} messages. - * @param message TrainProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrainProcessorVersionResponse - * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionResponse; - - /** - * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrainProcessorVersionResponse - * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionResponse; - - /** - * Verifies a TrainProcessorVersionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrainProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrainProcessorVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionResponse; - - /** - * Creates a plain object from a TrainProcessorVersionResponse message. Also converts values to other types if specified. - * @param message TrainProcessorVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrainProcessorVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrainProcessorVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TrainProcessorVersionMetadata. */ - interface ITrainProcessorVersionMetadata { - - /** TrainProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** TrainProcessorVersionMetadata trainingDatasetValidation */ - trainingDatasetValidation?: (google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null); - - /** TrainProcessorVersionMetadata testDatasetValidation */ - testDatasetValidation?: (google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null); - } - - /** Represents a TrainProcessorVersionMetadata. */ - class TrainProcessorVersionMetadata implements ITrainProcessorVersionMetadata { - - /** - * Constructs a new TrainProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata); - - /** TrainProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** TrainProcessorVersionMetadata trainingDatasetValidation. */ - public trainingDatasetValidation?: (google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null); - - /** TrainProcessorVersionMetadata testDatasetValidation. */ - public testDatasetValidation?: (google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null); - - /** - * Creates a new TrainProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns TrainProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata): google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata; - - /** - * Encodes the specified TrainProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.verify|verify} messages. - * @param message TrainProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrainProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.verify|verify} messages. - * @param message TrainProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrainProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionMetadata; - - /** - * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrainProcessorVersionMetadata - * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionMetadata; - - /** - * Verifies a TrainProcessorVersionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrainProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrainProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata; - - /** - * Creates a plain object from a TrainProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message TrainProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrainProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrainProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TrainProcessorVersionMetadata { - - /** Properties of a DatasetValidation. */ - interface IDatasetValidation { - - /** DatasetValidation documentErrorCount */ - documentErrorCount?: (number|null); - - /** DatasetValidation datasetErrorCount */ - datasetErrorCount?: (number|null); - - /** DatasetValidation documentErrors */ - documentErrors?: (google.rpc.IStatus[]|null); - - /** DatasetValidation datasetErrors */ - datasetErrors?: (google.rpc.IStatus[]|null); - } - - /** Represents a DatasetValidation. */ - class DatasetValidation implements IDatasetValidation { - - /** - * Constructs a new DatasetValidation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation); - - /** DatasetValidation documentErrorCount. */ - public documentErrorCount: number; - - /** DatasetValidation datasetErrorCount. */ - public datasetErrorCount: number; - - /** DatasetValidation documentErrors. */ - public documentErrors: google.rpc.IStatus[]; - - /** DatasetValidation datasetErrors. */ - public datasetErrors: google.rpc.IStatus[]; - - /** - * Creates a new DatasetValidation instance using the specified properties. - * @param [properties] Properties to set - * @returns DatasetValidation instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation): google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation; - - /** - * Encodes the specified DatasetValidation message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. - * @param message DatasetValidation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DatasetValidation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. - * @param message DatasetValidation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DatasetValidation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DatasetValidation - * @throws {Error} If the payload is not a 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.v1beta3.TrainProcessorVersionMetadata.DatasetValidation; - - /** - * Decodes a DatasetValidation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DatasetValidation - * @throws {Error} If the payload is 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.v1beta3.TrainProcessorVersionMetadata.DatasetValidation; - - /** - * Verifies a DatasetValidation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DatasetValidation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DatasetValidation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation; - - /** - * Creates a plain object from a DatasetValidation message. Also converts values to other types if specified. - * @param message DatasetValidation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DatasetValidation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DatasetValidation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a ReviewDocumentRequest. */ - interface IReviewDocumentRequest { - - /** ReviewDocumentRequest inlineDocument */ - inlineDocument?: (google.cloud.documentai.v1beta3.IDocument|null); - - /** ReviewDocumentRequest humanReviewConfig */ - humanReviewConfig?: (string|null); - - /** ReviewDocumentRequest document */ - document?: (google.cloud.documentai.v1beta3.IDocument|null); - - /** ReviewDocumentRequest enableSchemaValidation */ - enableSchemaValidation?: (boolean|null); - - /** ReviewDocumentRequest priority */ - priority?: (google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority|keyof typeof google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority|null); - - /** ReviewDocumentRequest documentSchema */ - documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); - } - - /** Represents a ReviewDocumentRequest. */ - class ReviewDocumentRequest implements IReviewDocumentRequest { - - /** - * Constructs a new ReviewDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IReviewDocumentRequest); - - /** ReviewDocumentRequest inlineDocument. */ - public inlineDocument?: (google.cloud.documentai.v1beta3.IDocument|null); - - /** ReviewDocumentRequest humanReviewConfig. */ - public humanReviewConfig: string; - - /** ReviewDocumentRequest document. */ - public document?: (google.cloud.documentai.v1beta3.IDocument|null); - - /** ReviewDocumentRequest enableSchemaValidation. */ - public enableSchemaValidation: boolean; - - /** ReviewDocumentRequest priority. */ - public priority: (google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority|keyof typeof google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority); - - /** ReviewDocumentRequest documentSchema. */ - public documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); - - /** ReviewDocumentRequest source. */ - public source?: "inlineDocument"; - - /** - * Creates a new ReviewDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ReviewDocumentRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IReviewDocumentRequest): google.cloud.documentai.v1beta3.ReviewDocumentRequest; - - /** - * Encodes the specified ReviewDocumentRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentRequest.verify|verify} messages. - * @param message ReviewDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IReviewDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReviewDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentRequest.verify|verify} messages. - * @param message ReviewDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IReviewDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReviewDocumentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReviewDocumentRequest - * @throws {Error} If the payload is not a 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.v1beta3.ReviewDocumentRequest; - - /** - * Decodes a ReviewDocumentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReviewDocumentRequest - * @throws {Error} If the payload is 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.v1beta3.ReviewDocumentRequest; - - /** - * Verifies a ReviewDocumentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReviewDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReviewDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ReviewDocumentRequest; - - /** - * Creates a plain object from a ReviewDocumentRequest message. Also converts values to other types if specified. - * @param message ReviewDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ReviewDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReviewDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReviewDocumentRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReviewDocumentRequest { - - /** Priority enum. */ - enum Priority { - DEFAULT = 0, - URGENT = 1 - } - } - - /** Properties of a ReviewDocumentResponse. */ - interface IReviewDocumentResponse { - - /** ReviewDocumentResponse gcsDestination */ - gcsDestination?: (string|null); - - /** ReviewDocumentResponse state */ - state?: (google.cloud.documentai.v1beta3.ReviewDocumentResponse.State|keyof typeof google.cloud.documentai.v1beta3.ReviewDocumentResponse.State|null); - - /** ReviewDocumentResponse rejectionReason */ - rejectionReason?: (string|null); - } - - /** Represents a ReviewDocumentResponse. */ - class ReviewDocumentResponse implements IReviewDocumentResponse { - - /** - * Constructs a new ReviewDocumentResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IReviewDocumentResponse); - - /** ReviewDocumentResponse gcsDestination. */ - public gcsDestination: string; - - /** ReviewDocumentResponse state. */ - public state: (google.cloud.documentai.v1beta3.ReviewDocumentResponse.State|keyof typeof google.cloud.documentai.v1beta3.ReviewDocumentResponse.State); - - /** ReviewDocumentResponse rejectionReason. */ - public rejectionReason: string; - - /** - * Creates a new ReviewDocumentResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ReviewDocumentResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IReviewDocumentResponse): google.cloud.documentai.v1beta3.ReviewDocumentResponse; - - /** - * Encodes the specified ReviewDocumentResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentResponse.verify|verify} messages. - * @param message ReviewDocumentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IReviewDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReviewDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentResponse.verify|verify} messages. - * @param message ReviewDocumentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IReviewDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReviewDocumentResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReviewDocumentResponse - * @throws {Error} If the payload is not a 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.v1beta3.ReviewDocumentResponse; - - /** - * Decodes a ReviewDocumentResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReviewDocumentResponse - * @throws {Error} If the payload is 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.v1beta3.ReviewDocumentResponse; - - /** - * Verifies a ReviewDocumentResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReviewDocumentResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReviewDocumentResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ReviewDocumentResponse; - - /** - * Creates a plain object from a ReviewDocumentResponse message. Also converts values to other types if specified. - * @param message ReviewDocumentResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ReviewDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReviewDocumentResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReviewDocumentResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReviewDocumentResponse { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - REJECTED = 1, - SUCCEEDED = 2 - } - } - - /** Properties of a ReviewDocumentOperationMetadata. */ - interface IReviewDocumentOperationMetadata { - - /** ReviewDocumentOperationMetadata state */ - state?: (google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State|keyof typeof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State|null); - - /** ReviewDocumentOperationMetadata stateMessage */ - stateMessage?: (string|null); - - /** ReviewDocumentOperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ReviewDocumentOperationMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ReviewDocumentOperationMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** ReviewDocumentOperationMetadata questionId */ - questionId?: (string|null); - } - - /** Represents a ReviewDocumentOperationMetadata. */ - class ReviewDocumentOperationMetadata implements IReviewDocumentOperationMetadata { - - /** - * Constructs a new ReviewDocumentOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata); - - /** ReviewDocumentOperationMetadata state. */ - public state: (google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State|keyof typeof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State); - - /** ReviewDocumentOperationMetadata stateMessage. */ - public stateMessage: string; - - /** ReviewDocumentOperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ReviewDocumentOperationMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ReviewDocumentOperationMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** ReviewDocumentOperationMetadata questionId. */ - public questionId: string; - - /** - * Creates a new ReviewDocumentOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ReviewDocumentOperationMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata): google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata; - - /** - * Encodes the specified ReviewDocumentOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.verify|verify} messages. - * @param message ReviewDocumentOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReviewDocumentOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.verify|verify} messages. - * @param message ReviewDocumentOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReviewDocumentOperationMetadata - * @throws {Error} If the payload is not a 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.v1beta3.ReviewDocumentOperationMetadata; - - /** - * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReviewDocumentOperationMetadata - * @throws {Error} If the payload is 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.v1beta3.ReviewDocumentOperationMetadata; - - /** - * Verifies a ReviewDocumentOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReviewDocumentOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReviewDocumentOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata; - - /** - * Creates a plain object from a ReviewDocumentOperationMetadata message. Also converts values to other types if specified. - * @param message ReviewDocumentOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReviewDocumentOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReviewDocumentOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReviewDocumentOperationMetadata { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - RUNNING = 1, - CANCELLING = 2, - SUCCEEDED = 3, - FAILED = 4, - CANCELLED = 5 - } - } - - /** Properties of an EvaluateProcessorVersionRequest. */ - interface IEvaluateProcessorVersionRequest { - - /** EvaluateProcessorVersionRequest processorVersion */ - processorVersion?: (string|null); - - /** EvaluateProcessorVersionRequest evaluationDocuments */ - evaluationDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); - } - - /** Represents an EvaluateProcessorVersionRequest. */ - class EvaluateProcessorVersionRequest implements IEvaluateProcessorVersionRequest { - - /** - * Constructs a new EvaluateProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest); - - /** EvaluateProcessorVersionRequest processorVersion. */ - public processorVersion: string; - - /** EvaluateProcessorVersionRequest evaluationDocuments. */ - public evaluationDocuments?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); - - /** - * Creates a new EvaluateProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluateProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest): google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest; - - /** - * Encodes the specified EvaluateProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest.verify|verify} messages. - * @param message EvaluateProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluateProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest.verify|verify} messages. - * @param message EvaluateProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluateProcessorVersionRequest - * @throws {Error} If the payload is not a 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.v1beta3.EvaluateProcessorVersionRequest; - - /** - * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluateProcessorVersionRequest - * @throws {Error} If the payload is 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.v1beta3.EvaluateProcessorVersionRequest; - - /** - * Verifies an EvaluateProcessorVersionRequest message. - * @param message Plain 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 EvaluateProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluateProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest; - - /** - * Creates a plain object from an EvaluateProcessorVersionRequest message. Also converts values to other types if specified. - * @param message EvaluateProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluateProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluateProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EvaluateProcessorVersionMetadata. */ - interface IEvaluateProcessorVersionMetadata { - - /** EvaluateProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - } - - /** Represents an EvaluateProcessorVersionMetadata. */ - class EvaluateProcessorVersionMetadata implements IEvaluateProcessorVersionMetadata { - - /** - * Constructs a new EvaluateProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata); - - /** EvaluateProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** - * Creates a new EvaluateProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluateProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata): google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata; - - /** - * Encodes the specified EvaluateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata.verify|verify} messages. - * @param message EvaluateProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata.verify|verify} messages. - * @param message EvaluateProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluateProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.v1beta3.EvaluateProcessorVersionMetadata; - - /** - * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluateProcessorVersionMetadata - * @throws {Error} If the payload is 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.v1beta3.EvaluateProcessorVersionMetadata; - - /** - * Verifies an EvaluateProcessorVersionMetadata message. - * @param message Plain 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 EvaluateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluateProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata; - - /** - * Creates a plain object from an EvaluateProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message EvaluateProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluateProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluateProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EvaluateProcessorVersionResponse. */ - interface IEvaluateProcessorVersionResponse { - - /** EvaluateProcessorVersionResponse evaluation */ - evaluation?: (string|null); - } - - /** Represents an EvaluateProcessorVersionResponse. */ - class EvaluateProcessorVersionResponse implements IEvaluateProcessorVersionResponse { - - /** - * Constructs a new EvaluateProcessorVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse); - - /** EvaluateProcessorVersionResponse evaluation. */ - public evaluation: string; - - /** - * Creates a new EvaluateProcessorVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluateProcessorVersionResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse): google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse; - - /** - * Encodes the specified EvaluateProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse.verify|verify} messages. - * @param message EvaluateProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluateProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse.verify|verify} messages. - * @param message EvaluateProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluateProcessorVersionResponse - * @throws {Error} If the payload is not a 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.v1beta3.EvaluateProcessorVersionResponse; - - /** - * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluateProcessorVersionResponse - * @throws {Error} If the payload is 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.v1beta3.EvaluateProcessorVersionResponse; - - /** - * Verifies an EvaluateProcessorVersionResponse message. - * @param message Plain 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 EvaluateProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluateProcessorVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse; - - /** - * Creates a plain object from an EvaluateProcessorVersionResponse message. Also converts values to other types if specified. - * @param message EvaluateProcessorVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluateProcessorVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluateProcessorVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetEvaluationRequest. */ - interface IGetEvaluationRequest { - - /** GetEvaluationRequest name */ - name?: (string|null); - } - - /** Represents a GetEvaluationRequest. */ - class GetEvaluationRequest implements IGetEvaluationRequest { - - /** - * Constructs a new GetEvaluationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGetEvaluationRequest); - - /** GetEvaluationRequest name. */ - public name: string; - - /** - * Creates a new GetEvaluationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetEvaluationRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IGetEvaluationRequest): google.cloud.documentai.v1beta3.GetEvaluationRequest; - - /** - * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetEvaluationRequest.verify|verify} messages. - * @param message GetEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetEvaluationRequest.verify|verify} messages. - * @param message GetEvaluationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGetEvaluationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetEvaluationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetEvaluationRequest - * @throws {Error} If the payload is not a 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.v1beta3.GetEvaluationRequest; - - /** - * Decodes a GetEvaluationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetEvaluationRequest - * @throws {Error} If the payload is 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.v1beta3.GetEvaluationRequest; - - /** - * Verifies a GetEvaluationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetEvaluationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GetEvaluationRequest; - - /** - * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. - * @param message GetEvaluationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.GetEvaluationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetEvaluationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetEvaluationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationsRequest. */ - interface IListEvaluationsRequest { - - /** ListEvaluationsRequest parent */ - parent?: (string|null); - - /** ListEvaluationsRequest pageSize */ - pageSize?: (number|null); - - /** ListEvaluationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListEvaluationsRequest. */ - class ListEvaluationsRequest implements IListEvaluationsRequest { - - /** - * Constructs a new ListEvaluationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IListEvaluationsRequest); - - /** ListEvaluationsRequest parent. */ - public parent: string; - - /** ListEvaluationsRequest pageSize. */ - public pageSize: number; - - /** ListEvaluationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListEvaluationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationsRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IListEvaluationsRequest): google.cloud.documentai.v1beta3.ListEvaluationsRequest; - - /** - * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsRequest.verify|verify} messages. - * @param message ListEvaluationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsRequest.verify|verify} messages. - * @param message ListEvaluationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListEvaluationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationsRequest - * @throws {Error} If the payload is not a 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.v1beta3.ListEvaluationsRequest; - - /** - * Decodes a ListEvaluationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationsRequest - * @throws {Error} If the payload is 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.v1beta3.ListEvaluationsRequest; - - /** - * Verifies a ListEvaluationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListEvaluationsRequest; - - /** - * Creates a plain object from a ListEvaluationsRequest message. Also converts values to other types if specified. - * @param message ListEvaluationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ListEvaluationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListEvaluationsResponse. */ - interface IListEvaluationsResponse { - - /** ListEvaluationsResponse evaluations */ - evaluations?: (google.cloud.documentai.v1beta3.IEvaluation[]|null); - - /** ListEvaluationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListEvaluationsResponse. */ - class ListEvaluationsResponse implements IListEvaluationsResponse { - - /** - * Constructs a new ListEvaluationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IListEvaluationsResponse); - - /** ListEvaluationsResponse evaluations. */ - public evaluations: google.cloud.documentai.v1beta3.IEvaluation[]; - - /** ListEvaluationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListEvaluationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEvaluationsResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IListEvaluationsResponse): google.cloud.documentai.v1beta3.ListEvaluationsResponse; - - /** - * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsResponse.verify|verify} messages. - * @param message ListEvaluationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsResponse.verify|verify} messages. - * @param message ListEvaluationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListEvaluationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListEvaluationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEvaluationsResponse - * @throws {Error} If the payload is not a 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.v1beta3.ListEvaluationsResponse; - - /** - * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEvaluationsResponse - * @throws {Error} If the payload is 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.v1beta3.ListEvaluationsResponse; - - /** - * Verifies a ListEvaluationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEvaluationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListEvaluationsResponse; - - /** - * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. - * @param message ListEvaluationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ListEvaluationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListEvaluationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListEvaluationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportProcessorVersionRequest. */ - interface IImportProcessorVersionRequest { - - /** ImportProcessorVersionRequest processorVersionSource */ - processorVersionSource?: (string|null); - - /** ImportProcessorVersionRequest externalProcessorVersionSource */ - externalProcessorVersionSource?: (google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource|null); - - /** ImportProcessorVersionRequest parent */ - parent?: (string|null); - } - - /** Represents an ImportProcessorVersionRequest. */ - class ImportProcessorVersionRequest implements IImportProcessorVersionRequest { - - /** - * Constructs a new ImportProcessorVersionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionRequest); - - /** ImportProcessorVersionRequest processorVersionSource. */ - public processorVersionSource?: (string|null); - - /** ImportProcessorVersionRequest externalProcessorVersionSource. */ - public externalProcessorVersionSource?: (google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource|null); - - /** ImportProcessorVersionRequest parent. */ - public parent: string; - - /** ImportProcessorVersionRequest source. */ - public source?: ("processorVersionSource"|"externalProcessorVersionSource"); - - /** - * Creates a new ImportProcessorVersionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportProcessorVersionRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionRequest): google.cloud.documentai.v1beta3.ImportProcessorVersionRequest; - - /** - * Encodes the specified ImportProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.verify|verify} messages. - * @param message ImportProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.verify|verify} messages. - * @param message ImportProcessorVersionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportProcessorVersionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportProcessorVersionRequest - * @throws {Error} If the payload is not a 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.v1beta3.ImportProcessorVersionRequest; - - /** - * Decodes an ImportProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportProcessorVersionRequest - * @throws {Error} If the payload is 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.v1beta3.ImportProcessorVersionRequest; - - /** - * Verifies an ImportProcessorVersionRequest message. - * @param message Plain 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 ImportProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportProcessorVersionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportProcessorVersionRequest; - - /** - * Creates a plain object from an ImportProcessorVersionRequest message. Also converts values to other types if specified. - * @param message ImportProcessorVersionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ImportProcessorVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportProcessorVersionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportProcessorVersionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImportProcessorVersionRequest { - - /** Properties of an ExternalProcessorVersionSource. */ - interface IExternalProcessorVersionSource { - - /** ExternalProcessorVersionSource processorVersion */ - processorVersion?: (string|null); - - /** ExternalProcessorVersionSource serviceEndpoint */ - serviceEndpoint?: (string|null); - } - - /** Represents an ExternalProcessorVersionSource. */ - class ExternalProcessorVersionSource implements IExternalProcessorVersionSource { - - /** - * Constructs a new ExternalProcessorVersionSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource); - - /** ExternalProcessorVersionSource processorVersion. */ - public processorVersion: string; - - /** ExternalProcessorVersionSource serviceEndpoint. */ - public serviceEndpoint: string; - - /** - * Creates a new ExternalProcessorVersionSource instance using the specified properties. - * @param [properties] Properties to set - * @returns ExternalProcessorVersionSource instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource): google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource; - - /** - * Encodes the specified ExternalProcessorVersionSource message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.verify|verify} messages. - * @param message ExternalProcessorVersionSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExternalProcessorVersionSource message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.verify|verify} messages. - * @param message ExternalProcessorVersionSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExternalProcessorVersionSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExternalProcessorVersionSource - * @throws {Error} If the payload is not a 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.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource; - - /** - * Decodes an ExternalProcessorVersionSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExternalProcessorVersionSource - * @throws {Error} If the payload is 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.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource; - - /** - * Verifies an ExternalProcessorVersionSource message. - * @param message Plain 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 ExternalProcessorVersionSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExternalProcessorVersionSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource; - - /** - * Creates a plain object from an ExternalProcessorVersionSource message. Also converts values to other types if specified. - * @param message ExternalProcessorVersionSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExternalProcessorVersionSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExternalProcessorVersionSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ImportProcessorVersionResponse. */ - interface IImportProcessorVersionResponse { - - /** ImportProcessorVersionResponse processorVersion */ - processorVersion?: (string|null); - } - - /** Represents an ImportProcessorVersionResponse. */ - class ImportProcessorVersionResponse implements IImportProcessorVersionResponse { - - /** - * Constructs a new ImportProcessorVersionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionResponse); - - /** ImportProcessorVersionResponse processorVersion. */ - public processorVersion: string; - - /** - * Creates a new ImportProcessorVersionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportProcessorVersionResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionResponse): google.cloud.documentai.v1beta3.ImportProcessorVersionResponse; - - /** - * Encodes the specified ImportProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionResponse.verify|verify} messages. - * @param message ImportProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IImportProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionResponse.verify|verify} messages. - * @param message ImportProcessorVersionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportProcessorVersionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportProcessorVersionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportProcessorVersionResponse - * @throws {Error} If the payload is not a 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.v1beta3.ImportProcessorVersionResponse; - - /** - * Decodes an ImportProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportProcessorVersionResponse - * @throws {Error} If the payload is 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.v1beta3.ImportProcessorVersionResponse; - - /** - * Verifies an ImportProcessorVersionResponse message. - * @param message Plain 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 ImportProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportProcessorVersionResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportProcessorVersionResponse; - - /** - * Creates a plain object from an ImportProcessorVersionResponse message. Also converts values to other types if specified. - * @param message ImportProcessorVersionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ImportProcessorVersionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportProcessorVersionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportProcessorVersionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportProcessorVersionMetadata. */ - interface IImportProcessorVersionMetadata { - - /** ImportProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - } - - /** Represents an ImportProcessorVersionMetadata. */ - class ImportProcessorVersionMetadata implements IImportProcessorVersionMetadata { - - /** - * Constructs a new ImportProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata); - - /** ImportProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** - * Creates a new ImportProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata): google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata; - - /** - * Encodes the specified ImportProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata.verify|verify} messages. - * @param message ImportProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata.verify|verify} messages. - * @param message ImportProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.v1beta3.ImportProcessorVersionMetadata; - - /** - * Decodes an ImportProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportProcessorVersionMetadata - * @throws {Error} If the payload is 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.v1beta3.ImportProcessorVersionMetadata; - - /** - * Verifies an ImportProcessorVersionMetadata message. - * @param message Plain 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 ImportProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata; - - /** - * Creates a plain object from an ImportProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message ImportProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateProcessorVersionMetadata. */ - interface IUpdateProcessorVersionMetadata { - - /** UpdateProcessorVersionMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - } - - /** Represents an UpdateProcessorVersionMetadata. */ - class UpdateProcessorVersionMetadata implements IUpdateProcessorVersionMetadata { - - /** - * Constructs a new UpdateProcessorVersionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata); - - /** UpdateProcessorVersionMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** - * Creates a new UpdateProcessorVersionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateProcessorVersionMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata): google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata; - - /** - * Encodes the specified UpdateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.verify|verify} messages. - * @param message UpdateProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.verify|verify} messages. - * @param message UpdateProcessorVersionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateProcessorVersionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateProcessorVersionMetadata - * @throws {Error} If the payload is not a 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.v1beta3.UpdateProcessorVersionMetadata; - - /** - * Decodes an UpdateProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateProcessorVersionMetadata - * @throws {Error} If the payload is 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.v1beta3.UpdateProcessorVersionMetadata; - - /** - * Verifies an UpdateProcessorVersionMetadata message. - * @param message Plain 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 UpdateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateProcessorVersionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata; - - /** - * Creates a plain object from an UpdateProcessorVersionMetadata message. Also converts values to other types if specified. - * @param message UpdateProcessorVersionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateProcessorVersionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateProcessorVersionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EvaluationReference. */ - interface IEvaluationReference { - - /** EvaluationReference operation */ - operation?: (string|null); - - /** EvaluationReference evaluation */ - evaluation?: (string|null); - - /** EvaluationReference aggregateMetrics */ - aggregateMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMetrics|null); - - /** EvaluationReference aggregateMetricsExact */ - aggregateMetricsExact?: (google.cloud.documentai.v1beta3.Evaluation.IMetrics|null); - } - - /** Represents an EvaluationReference. */ - class EvaluationReference implements IEvaluationReference { - - /** - * Constructs a new EvaluationReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IEvaluationReference); - - /** EvaluationReference operation. */ - public operation: string; - - /** EvaluationReference evaluation. */ - public evaluation: string; - - /** EvaluationReference aggregateMetrics. */ - public aggregateMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMetrics|null); - - /** EvaluationReference aggregateMetricsExact. */ - public aggregateMetricsExact?: (google.cloud.documentai.v1beta3.Evaluation.IMetrics|null); - - /** - * Creates a new EvaluationReference instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationReference instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IEvaluationReference): google.cloud.documentai.v1beta3.EvaluationReference; - - /** - * Encodes the specified EvaluationReference message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluationReference.verify|verify} messages. - * @param message EvaluationReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IEvaluationReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationReference message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluationReference.verify|verify} messages. - * @param message EvaluationReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEvaluationReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationReference - * @throws {Error} If the payload is not a 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.v1beta3.EvaluationReference; - - /** - * Decodes an EvaluationReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationReference - * @throws {Error} If the payload is 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.v1beta3.EvaluationReference; - - /** - * Verifies an EvaluationReference message. - * @param message Plain 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 EvaluationReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationReference - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.EvaluationReference; - - /** - * Creates a plain object from an EvaluationReference message. Also converts values to other types if specified. - * @param message EvaluationReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.EvaluationReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Evaluation. */ - interface IEvaluation { - - /** Evaluation name */ - name?: (string|null); - - /** Evaluation createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Evaluation documentCounters */ - documentCounters?: (google.cloud.documentai.v1beta3.Evaluation.ICounters|null); - - /** Evaluation allEntitiesMetrics */ - allEntitiesMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null); - - /** Evaluation entityMetrics */ - entityMetrics?: ({ [k: string]: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics }|null); - - /** Evaluation kmsKeyName */ - kmsKeyName?: (string|null); - - /** Evaluation kmsKeyVersionName */ - kmsKeyVersionName?: (string|null); - - /** Evaluation revisions */ - revisions?: (google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision[]|null); - } - - /** Represents an Evaluation. */ - class Evaluation implements IEvaluation { - - /** - * Constructs a new Evaluation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IEvaluation); - - /** Evaluation name. */ - public name: string; - - /** Evaluation createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Evaluation documentCounters. */ - public documentCounters?: (google.cloud.documentai.v1beta3.Evaluation.ICounters|null); - - /** Evaluation allEntitiesMetrics. */ - public allEntitiesMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null); - - /** Evaluation entityMetrics. */ - public entityMetrics: { [k: string]: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics }; - - /** Evaluation kmsKeyName. */ - public kmsKeyName: string; - - /** Evaluation kmsKeyVersionName. */ - public kmsKeyVersionName: string; - - /** Evaluation revisions. */ - public revisions: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision[]; - - /** - * Creates a new Evaluation instance using the specified properties. - * @param [properties] Properties to set - * @returns Evaluation instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IEvaluation): google.cloud.documentai.v1beta3.Evaluation; - - /** - * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.verify|verify} messages. - * @param message Evaluation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.verify|verify} messages. - * @param message Evaluation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Evaluation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Evaluation - * @throws {Error} If the payload is not a 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.v1beta3.Evaluation; - - /** - * Decodes an Evaluation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Evaluation - * @throws {Error} If the payload is 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.v1beta3.Evaluation; - - /** - * Verifies an Evaluation message. - * @param message Plain 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 Evaluation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Evaluation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation; - - /** - * Creates a plain object from an Evaluation message. Also converts values to other types if specified. - * @param message Evaluation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Evaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Evaluation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Evaluation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Evaluation { - - /** Properties of a Counters. */ - interface ICounters { - - /** Counters inputDocumentsCount */ - inputDocumentsCount?: (number|null); - - /** Counters invalidDocumentsCount */ - invalidDocumentsCount?: (number|null); - - /** Counters failedDocumentsCount */ - failedDocumentsCount?: (number|null); - - /** Counters evaluatedDocumentsCount */ - evaluatedDocumentsCount?: (number|null); - } - - /** Represents a Counters. */ - class Counters implements ICounters { - - /** - * Constructs a new Counters. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Evaluation.ICounters); - - /** Counters inputDocumentsCount. */ - public inputDocumentsCount: number; - - /** Counters invalidDocumentsCount. */ - public invalidDocumentsCount: number; - - /** Counters failedDocumentsCount. */ - public failedDocumentsCount: number; - - /** Counters evaluatedDocumentsCount. */ - public evaluatedDocumentsCount: number; - - /** - * Creates a new Counters instance using the specified properties. - * @param [properties] Properties to set - * @returns Counters instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Evaluation.ICounters): google.cloud.documentai.v1beta3.Evaluation.Counters; - - /** - * Encodes the specified Counters message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Counters.verify|verify} messages. - * @param message Counters message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Evaluation.ICounters, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Counters message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Counters.verify|verify} messages. - * @param message Counters message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Evaluation.ICounters, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Counters message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Counters - * @throws {Error} If the payload is not a 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.v1beta3.Evaluation.Counters; - - /** - * Decodes a Counters message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Counters - * @throws {Error} If the payload is 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.v1beta3.Evaluation.Counters; - - /** - * Verifies a Counters message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Counters message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Counters - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation.Counters; - - /** - * Creates a plain object from a Counters message. Also converts values to other types if specified. - * @param message Counters - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Evaluation.Counters, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Counters to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Counters - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Metrics. */ - interface IMetrics { - - /** Metrics precision */ - precision?: (number|null); - - /** Metrics recall */ - recall?: (number|null); - - /** Metrics f1Score */ - f1Score?: (number|null); - - /** Metrics predictedOccurrencesCount */ - predictedOccurrencesCount?: (number|null); - - /** Metrics groundTruthOccurrencesCount */ - groundTruthOccurrencesCount?: (number|null); - - /** Metrics predictedDocumentCount */ - predictedDocumentCount?: (number|null); - - /** Metrics groundTruthDocumentCount */ - groundTruthDocumentCount?: (number|null); - - /** Metrics truePositivesCount */ - truePositivesCount?: (number|null); - - /** Metrics falsePositivesCount */ - falsePositivesCount?: (number|null); - - /** Metrics falseNegativesCount */ - falseNegativesCount?: (number|null); - - /** Metrics totalDocumentsCount */ - totalDocumentsCount?: (number|null); - } - - /** Represents a Metrics. */ - class Metrics implements IMetrics { - - /** - * Constructs a new Metrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Evaluation.IMetrics); - - /** Metrics precision. */ - public precision: number; - - /** Metrics recall. */ - public recall: number; - - /** Metrics f1Score. */ - public f1Score: number; - - /** Metrics predictedOccurrencesCount. */ - public predictedOccurrencesCount: number; - - /** Metrics groundTruthOccurrencesCount. */ - public groundTruthOccurrencesCount: number; - - /** Metrics predictedDocumentCount. */ - public predictedDocumentCount: number; - - /** Metrics groundTruthDocumentCount. */ - public groundTruthDocumentCount: number; - - /** Metrics truePositivesCount. */ - public truePositivesCount: number; - - /** Metrics falsePositivesCount. */ - public falsePositivesCount: number; - - /** Metrics falseNegativesCount. */ - public falseNegativesCount: number; - - /** Metrics totalDocumentsCount. */ - public totalDocumentsCount: number; - - /** - * Creates a new Metrics instance using the specified properties. - * @param [properties] Properties to set - * @returns Metrics instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Evaluation.IMetrics): google.cloud.documentai.v1beta3.Evaluation.Metrics; - - /** - * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Metrics.verify|verify} messages. - * @param message Metrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Evaluation.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Metrics.verify|verify} messages. - * @param message Metrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Evaluation.IMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Metrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Metrics - * @throws {Error} If the payload is not a 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.v1beta3.Evaluation.Metrics; - - /** - * Decodes a Metrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Metrics - * @throws {Error} If the payload is 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.v1beta3.Evaluation.Metrics; - - /** - * Verifies a Metrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Metrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Metrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation.Metrics; - - /** - * Creates a plain object from a Metrics message. Also converts values to other types if specified. - * @param message Metrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Evaluation.Metrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Metrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Metrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ConfidenceLevelMetrics. */ - interface IConfidenceLevelMetrics { - - /** ConfidenceLevelMetrics confidenceLevel */ - confidenceLevel?: (number|null); - - /** ConfidenceLevelMetrics metrics */ - metrics?: (google.cloud.documentai.v1beta3.Evaluation.IMetrics|null); - } - - /** Represents a ConfidenceLevelMetrics. */ - class ConfidenceLevelMetrics implements IConfidenceLevelMetrics { - - /** - * Constructs a new ConfidenceLevelMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics); - - /** ConfidenceLevelMetrics confidenceLevel. */ - public confidenceLevel: number; - - /** ConfidenceLevelMetrics metrics. */ - public metrics?: (google.cloud.documentai.v1beta3.Evaluation.IMetrics|null); - - /** - * Creates a new ConfidenceLevelMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns ConfidenceLevelMetrics instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics): google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics; - - /** - * Encodes the specified ConfidenceLevelMetrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. - * @param message ConfidenceLevelMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConfidenceLevelMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. - * @param message ConfidenceLevelMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConfidenceLevelMetrics - * @throws {Error} If the payload is not a 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.v1beta3.Evaluation.ConfidenceLevelMetrics; - - /** - * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConfidenceLevelMetrics - * @throws {Error} If the payload is 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.v1beta3.Evaluation.ConfidenceLevelMetrics; - - /** - * Verifies a ConfidenceLevelMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConfidenceLevelMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConfidenceLevelMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics; - - /** - * Creates a plain object from a ConfidenceLevelMetrics message. Also converts values to other types if specified. - * @param message ConfidenceLevelMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConfidenceLevelMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConfidenceLevelMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MultiConfidenceMetrics. */ - interface IMultiConfidenceMetrics { - - /** MultiConfidenceMetrics confidenceLevelMetrics */ - confidenceLevelMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics[]|null); - - /** MultiConfidenceMetrics confidenceLevelMetricsExact */ - confidenceLevelMetricsExact?: (google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics[]|null); - - /** MultiConfidenceMetrics auprc */ - auprc?: (number|null); - - /** MultiConfidenceMetrics estimatedCalibrationError */ - estimatedCalibrationError?: (number|null); - - /** MultiConfidenceMetrics auprcExact */ - auprcExact?: (number|null); - - /** MultiConfidenceMetrics estimatedCalibrationErrorExact */ - estimatedCalibrationErrorExact?: (number|null); - - /** MultiConfidenceMetrics metricsType */ - metricsType?: (google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType|keyof typeof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType|null); - } - - /** Represents a MultiConfidenceMetrics. */ - class MultiConfidenceMetrics implements IMultiConfidenceMetrics { - - /** - * Constructs a new MultiConfidenceMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics); - - /** MultiConfidenceMetrics confidenceLevelMetrics. */ - public confidenceLevelMetrics: google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics[]; - - /** MultiConfidenceMetrics confidenceLevelMetricsExact. */ - public confidenceLevelMetricsExact: google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics[]; - - /** MultiConfidenceMetrics auprc. */ - public auprc: number; - - /** MultiConfidenceMetrics estimatedCalibrationError. */ - public estimatedCalibrationError: number; - - /** MultiConfidenceMetrics auprcExact. */ - public auprcExact: number; - - /** MultiConfidenceMetrics estimatedCalibrationErrorExact. */ - public estimatedCalibrationErrorExact: number; - - /** MultiConfidenceMetrics metricsType. */ - public metricsType: (google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType|keyof typeof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType); - - /** - * Creates a new MultiConfidenceMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns MultiConfidenceMetrics instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics): google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics; - - /** - * Encodes the specified MultiConfidenceMetrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify|verify} messages. - * @param message MultiConfidenceMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MultiConfidenceMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify|verify} messages. - * @param message MultiConfidenceMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MultiConfidenceMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MultiConfidenceMetrics - * @throws {Error} If the payload is not a 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.v1beta3.Evaluation.MultiConfidenceMetrics; - - /** - * Decodes a MultiConfidenceMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MultiConfidenceMetrics - * @throws {Error} If the payload is 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.v1beta3.Evaluation.MultiConfidenceMetrics; - - /** - * Verifies a MultiConfidenceMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MultiConfidenceMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MultiConfidenceMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics; - - /** - * Creates a plain object from a MultiConfidenceMetrics message. Also converts values to other types if specified. - * @param message MultiConfidenceMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MultiConfidenceMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MultiConfidenceMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MultiConfidenceMetrics { - - /** MetricsType enum. */ - enum MetricsType { - METRICS_TYPE_UNSPECIFIED = 0, - AGGREGATE = 1 - } - } - - /** Properties of an EvaluationRevision. */ - interface IEvaluationRevision { - - /** EvaluationRevision revisionId */ - revisionId?: (string|null); - - /** EvaluationRevision documentCounters */ - documentCounters?: (google.cloud.documentai.v1beta3.Evaluation.ICounters|null); - - /** EvaluationRevision allEntitiesMetrics */ - allEntitiesMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null); - - /** EvaluationRevision entityMetrics */ - entityMetrics?: ({ [k: string]: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics }|null); - } - - /** Represents an EvaluationRevision. */ - class EvaluationRevision implements IEvaluationRevision { - - /** - * Constructs a new EvaluationRevision. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision); - - /** EvaluationRevision revisionId. */ - public revisionId: string; - - /** EvaluationRevision documentCounters. */ - public documentCounters?: (google.cloud.documentai.v1beta3.Evaluation.ICounters|null); - - /** EvaluationRevision allEntitiesMetrics. */ - public allEntitiesMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null); - - /** EvaluationRevision entityMetrics. */ - public entityMetrics: { [k: string]: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics }; - - /** - * Creates a new EvaluationRevision instance using the specified properties. - * @param [properties] Properties to set - * @returns EvaluationRevision instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision): google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision; - - /** - * Encodes the specified EvaluationRevision message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.verify|verify} messages. - * @param message EvaluationRevision message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EvaluationRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.verify|verify} messages. - * @param message EvaluationRevision message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EvaluationRevision message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EvaluationRevision - * @throws {Error} If the payload is not a 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.v1beta3.Evaluation.EvaluationRevision; - - /** - * Decodes an EvaluationRevision message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EvaluationRevision - * @throws {Error} If the payload is 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.v1beta3.Evaluation.EvaluationRevision; - - /** - * Verifies an EvaluationRevision message. - * @param message Plain 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 EvaluationRevision message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EvaluationRevision - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision; - - /** - * Creates a plain object from an EvaluationRevision message. Also converts values to other types if specified. - * @param message EvaluationRevision - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EvaluationRevision to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EvaluationRevision - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a CommonOperationMetadata. */ - interface ICommonOperationMetadata { - - /** CommonOperationMetadata state */ - state?: (google.cloud.documentai.v1beta3.CommonOperationMetadata.State|keyof typeof google.cloud.documentai.v1beta3.CommonOperationMetadata.State|null); - - /** CommonOperationMetadata stateMessage */ - stateMessage?: (string|null); - - /** CommonOperationMetadata resource */ - resource?: (string|null); - - /** CommonOperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** CommonOperationMetadata updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CommonOperationMetadata. */ - class CommonOperationMetadata implements ICommonOperationMetadata { - - /** - * Constructs a new CommonOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ICommonOperationMetadata); - - /** CommonOperationMetadata state. */ - public state: (google.cloud.documentai.v1beta3.CommonOperationMetadata.State|keyof typeof google.cloud.documentai.v1beta3.CommonOperationMetadata.State); - - /** CommonOperationMetadata stateMessage. */ - public stateMessage: string; - - /** CommonOperationMetadata resource. */ - public resource: string; - - /** CommonOperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** CommonOperationMetadata updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CommonOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonOperationMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ICommonOperationMetadata): google.cloud.documentai.v1beta3.CommonOperationMetadata; - - /** - * Encodes the specified CommonOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.CommonOperationMetadata.verify|verify} messages. - * @param message CommonOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ICommonOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.CommonOperationMetadata.verify|verify} messages. - * @param message CommonOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ICommonOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonOperationMetadata - * @throws {Error} If the payload is not a 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.v1beta3.CommonOperationMetadata; - - /** - * Decodes a CommonOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonOperationMetadata - * @throws {Error} If the payload is 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.v1beta3.CommonOperationMetadata; - - /** - * Verifies a CommonOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.CommonOperationMetadata; - - /** - * Creates a plain object from a CommonOperationMetadata message. Also converts values to other types if specified. - * @param message CommonOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.CommonOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CommonOperationMetadata { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - RUNNING = 1, - CANCELLING = 2, - SUCCEEDED = 3, - FAILED = 4, - CANCELLED = 5 - } - } - - /** Properties of a ProcessorVersion. */ - interface IProcessorVersion { - - /** ProcessorVersion name */ - name?: (string|null); - - /** ProcessorVersion displayName */ - displayName?: (string|null); - - /** ProcessorVersion documentSchema */ - documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); - - /** ProcessorVersion state */ - state?: (google.cloud.documentai.v1beta3.ProcessorVersion.State|keyof typeof google.cloud.documentai.v1beta3.ProcessorVersion.State|null); - - /** ProcessorVersion createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ProcessorVersion latestEvaluation */ - latestEvaluation?: (google.cloud.documentai.v1beta3.IEvaluationReference|null); - - /** ProcessorVersion kmsKeyName */ - kmsKeyName?: (string|null); - - /** ProcessorVersion kmsKeyVersionName */ - kmsKeyVersionName?: (string|null); - - /** ProcessorVersion googleManaged */ - googleManaged?: (boolean|null); - - /** ProcessorVersion deprecationInfo */ - deprecationInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo|null); - - /** ProcessorVersion modelType */ - modelType?: (google.cloud.documentai.v1beta3.ProcessorVersion.ModelType|keyof typeof google.cloud.documentai.v1beta3.ProcessorVersion.ModelType|null); - - /** ProcessorVersion satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** ProcessorVersion satisfiesPzi */ - satisfiesPzi?: (boolean|null); - - /** ProcessorVersion genAiModelInfo */ - genAiModelInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo|null); - } - - /** Represents a ProcessorVersion. */ - class ProcessorVersion implements IProcessorVersion { - - /** - * Constructs a new ProcessorVersion. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IProcessorVersion); - - /** ProcessorVersion name. */ - public name: string; - - /** ProcessorVersion displayName. */ - public displayName: string; - - /** ProcessorVersion documentSchema. */ - public documentSchema?: (google.cloud.documentai.v1beta3.IDocumentSchema|null); - - /** ProcessorVersion state. */ - public state: (google.cloud.documentai.v1beta3.ProcessorVersion.State|keyof typeof google.cloud.documentai.v1beta3.ProcessorVersion.State); - - /** ProcessorVersion createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ProcessorVersion latestEvaluation. */ - public latestEvaluation?: (google.cloud.documentai.v1beta3.IEvaluationReference|null); - - /** ProcessorVersion kmsKeyName. */ - public kmsKeyName: string; - - /** ProcessorVersion kmsKeyVersionName. */ - public kmsKeyVersionName: string; - - /** ProcessorVersion googleManaged. */ - public googleManaged: boolean; - - /** ProcessorVersion deprecationInfo. */ - public deprecationInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo|null); - - /** ProcessorVersion modelType. */ - public modelType: (google.cloud.documentai.v1beta3.ProcessorVersion.ModelType|keyof typeof google.cloud.documentai.v1beta3.ProcessorVersion.ModelType); - - /** ProcessorVersion satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** ProcessorVersion satisfiesPzi. */ - public satisfiesPzi: boolean; - - /** ProcessorVersion genAiModelInfo. */ - public genAiModelInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo|null); - - /** - * Creates a new ProcessorVersion instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessorVersion instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IProcessorVersion): google.cloud.documentai.v1beta3.ProcessorVersion; - - /** - * Encodes the specified ProcessorVersion message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.verify|verify} messages. - * @param message ProcessorVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IProcessorVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessorVersion message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.verify|verify} messages. - * @param message ProcessorVersion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessorVersion, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessorVersion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessorVersion - * @throws {Error} If the payload is not a 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.v1beta3.ProcessorVersion; - - /** - * Decodes a ProcessorVersion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessorVersion - * @throws {Error} If the payload is 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.v1beta3.ProcessorVersion; - - /** - * Verifies a ProcessorVersion message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProcessorVersion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessorVersion - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorVersion; - - /** - * Creates a plain object from a ProcessorVersion message. Also converts values to other types if specified. - * @param message ProcessorVersion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessorVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessorVersion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessorVersion - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ProcessorVersion { - - /** Properties of a DeprecationInfo. */ - interface IDeprecationInfo { - - /** DeprecationInfo deprecationTime */ - deprecationTime?: (google.protobuf.ITimestamp|null); - - /** DeprecationInfo replacementProcessorVersion */ - replacementProcessorVersion?: (string|null); - } - - /** Represents a DeprecationInfo. */ - class DeprecationInfo implements IDeprecationInfo { - - /** - * Constructs a new DeprecationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo); - - /** DeprecationInfo deprecationTime. */ - public deprecationTime?: (google.protobuf.ITimestamp|null); - - /** DeprecationInfo replacementProcessorVersion. */ - public replacementProcessorVersion: string; - - /** - * Creates a new DeprecationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns DeprecationInfo instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo): google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo; - - /** - * Encodes the specified DeprecationInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.verify|verify} messages. - * @param message DeprecationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeprecationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.verify|verify} messages. - * @param message DeprecationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeprecationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeprecationInfo - * @throws {Error} If the payload is not a 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.v1beta3.ProcessorVersion.DeprecationInfo; - - /** - * Decodes a DeprecationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeprecationInfo - * @throws {Error} If the payload is 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.v1beta3.ProcessorVersion.DeprecationInfo; - - /** - * Verifies a DeprecationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeprecationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeprecationInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo; - - /** - * Creates a plain object from a DeprecationInfo message. Also converts values to other types if specified. - * @param message DeprecationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeprecationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeprecationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GenAiModelInfo. */ - interface IGenAiModelInfo { - - /** GenAiModelInfo foundationGenAiModelInfo */ - foundationGenAiModelInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null); - - /** GenAiModelInfo customGenAiModelInfo */ - customGenAiModelInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null); - } - - /** Represents a GenAiModelInfo. */ - class GenAiModelInfo implements IGenAiModelInfo { - - /** - * Constructs a new GenAiModelInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo); - - /** GenAiModelInfo foundationGenAiModelInfo. */ - public foundationGenAiModelInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null); - - /** GenAiModelInfo customGenAiModelInfo. */ - public customGenAiModelInfo?: (google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null); - - /** GenAiModelInfo modelInfo. */ - public modelInfo?: ("foundationGenAiModelInfo"|"customGenAiModelInfo"); - - /** - * Creates a new GenAiModelInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GenAiModelInfo instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo): google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo; - - /** - * Encodes the specified GenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.verify|verify} messages. - * @param message GenAiModelInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.verify|verify} messages. - * @param message GenAiModelInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GenAiModelInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GenAiModelInfo - * @throws {Error} If the payload is not a 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.v1beta3.ProcessorVersion.GenAiModelInfo; - - /** - * Decodes a GenAiModelInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GenAiModelInfo - * @throws {Error} If the payload is 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.v1beta3.ProcessorVersion.GenAiModelInfo; - - /** - * Verifies a GenAiModelInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GenAiModelInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GenAiModelInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo; - - /** - * Creates a plain object from a GenAiModelInfo message. Also converts values to other types if specified. - * @param message GenAiModelInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GenAiModelInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GenAiModelInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GenAiModelInfo { - - /** Properties of a FoundationGenAiModelInfo. */ - interface IFoundationGenAiModelInfo { - - /** FoundationGenAiModelInfo finetuningAllowed */ - finetuningAllowed?: (boolean|null); - - /** FoundationGenAiModelInfo minTrainLabeledDocuments */ - minTrainLabeledDocuments?: (number|null); - } - - /** Represents a FoundationGenAiModelInfo. */ - class FoundationGenAiModelInfo implements IFoundationGenAiModelInfo { - - /** - * Constructs a new FoundationGenAiModelInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo); - - /** FoundationGenAiModelInfo finetuningAllowed. */ - public finetuningAllowed: boolean; - - /** FoundationGenAiModelInfo minTrainLabeledDocuments. */ - public minTrainLabeledDocuments: number; - - /** - * Creates a new FoundationGenAiModelInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FoundationGenAiModelInfo instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo): google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; - - /** - * Encodes the specified FoundationGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. - * @param message FoundationGenAiModelInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FoundationGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. - * @param message FoundationGenAiModelInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FoundationGenAiModelInfo - * @throws {Error} If the payload is not a 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.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; - - /** - * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FoundationGenAiModelInfo - * @throws {Error} If the payload is 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.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; - - /** - * Verifies a FoundationGenAiModelInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FoundationGenAiModelInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FoundationGenAiModelInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo; - - /** - * Creates a plain object from a FoundationGenAiModelInfo message. Also converts values to other types if specified. - * @param message FoundationGenAiModelInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FoundationGenAiModelInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FoundationGenAiModelInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomGenAiModelInfo. */ - interface ICustomGenAiModelInfo { - - /** CustomGenAiModelInfo customModelType */ - customModelType?: (google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|keyof typeof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|null); - - /** CustomGenAiModelInfo baseProcessorVersionId */ - baseProcessorVersionId?: (string|null); - } - - /** Represents a CustomGenAiModelInfo. */ - class CustomGenAiModelInfo implements ICustomGenAiModelInfo { - - /** - * Constructs a new CustomGenAiModelInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo); - - /** CustomGenAiModelInfo customModelType. */ - public customModelType: (google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|keyof typeof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType); - - /** CustomGenAiModelInfo baseProcessorVersionId. */ - public baseProcessorVersionId: string; - - /** - * Creates a new CustomGenAiModelInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomGenAiModelInfo instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo): google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; - - /** - * Encodes the specified CustomGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. - * @param message CustomGenAiModelInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. - * @param message CustomGenAiModelInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomGenAiModelInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomGenAiModelInfo - * @throws {Error} If the payload is not a 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.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; - - /** - * Decodes a CustomGenAiModelInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomGenAiModelInfo - * @throws {Error} If the payload is 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.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; - - /** - * Verifies a CustomGenAiModelInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomGenAiModelInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomGenAiModelInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo; - - /** - * Creates a plain object from a CustomGenAiModelInfo message. Also converts values to other types if specified. - * @param message CustomGenAiModelInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomGenAiModelInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomGenAiModelInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CustomGenAiModelInfo { - - /** CustomModelType enum. */ - enum CustomModelType { - CUSTOM_MODEL_TYPE_UNSPECIFIED = 0, - VERSIONED_FOUNDATION = 1, - FINE_TUNED = 2 - } - } - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - DEPLOYED = 1, - DEPLOYING = 2, - UNDEPLOYED = 3, - UNDEPLOYING = 4, - CREATING = 5, - DELETING = 6, - FAILED = 7, - IMPORTING = 8 - } - - /** ModelType enum. */ - enum ModelType { - MODEL_TYPE_UNSPECIFIED = 0, - MODEL_TYPE_GENERATIVE = 1, - MODEL_TYPE_CUSTOM = 2 - } - } - - /** Properties of a ProcessorVersionAlias. */ - interface IProcessorVersionAlias { - - /** ProcessorVersionAlias alias */ - alias?: (string|null); - - /** ProcessorVersionAlias processorVersion */ - processorVersion?: (string|null); - } - - /** Represents a ProcessorVersionAlias. */ - class ProcessorVersionAlias implements IProcessorVersionAlias { - - /** - * Constructs a new ProcessorVersionAlias. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IProcessorVersionAlias); - - /** ProcessorVersionAlias alias. */ - public alias: string; - - /** ProcessorVersionAlias processorVersion. */ - public processorVersion: string; - - /** - * Creates a new ProcessorVersionAlias instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessorVersionAlias instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IProcessorVersionAlias): google.cloud.documentai.v1beta3.ProcessorVersionAlias; - - /** - * Encodes the specified ProcessorVersionAlias message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersionAlias.verify|verify} messages. - * @param message ProcessorVersionAlias message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IProcessorVersionAlias, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessorVersionAlias message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersionAlias.verify|verify} messages. - * @param message ProcessorVersionAlias message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessorVersionAlias, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessorVersionAlias message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessorVersionAlias - * @throws {Error} If the payload is not a 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.v1beta3.ProcessorVersionAlias; - - /** - * Decodes a ProcessorVersionAlias message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessorVersionAlias - * @throws {Error} If the payload is 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.v1beta3.ProcessorVersionAlias; - - /** - * Verifies a ProcessorVersionAlias message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProcessorVersionAlias message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessorVersionAlias - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorVersionAlias; - - /** - * Creates a plain object from a ProcessorVersionAlias message. Also converts values to other types if specified. - * @param message ProcessorVersionAlias - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessorVersionAlias, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessorVersionAlias to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessorVersionAlias - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Processor. */ - interface IProcessor { - - /** Processor name */ - name?: (string|null); - - /** Processor type */ - type?: (string|null); - - /** Processor displayName */ - displayName?: (string|null); - - /** Processor state */ - state?: (google.cloud.documentai.v1beta3.Processor.State|keyof typeof google.cloud.documentai.v1beta3.Processor.State|null); - - /** Processor defaultProcessorVersion */ - defaultProcessorVersion?: (string|null); - - /** Processor processorVersionAliases */ - processorVersionAliases?: (google.cloud.documentai.v1beta3.IProcessorVersionAlias[]|null); - - /** Processor processEndpoint */ - processEndpoint?: (string|null); - - /** Processor createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Processor kmsKeyName */ - kmsKeyName?: (string|null); - - /** Processor satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Processor satisfiesPzi */ - satisfiesPzi?: (boolean|null); - } - - /** Represents a Processor. */ - class Processor implements IProcessor { - - /** - * Constructs a new Processor. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IProcessor); - - /** Processor name. */ - public name: string; - - /** Processor type. */ - public type: string; - - /** Processor displayName. */ - public displayName: string; - - /** Processor state. */ - public state: (google.cloud.documentai.v1beta3.Processor.State|keyof typeof google.cloud.documentai.v1beta3.Processor.State); - - /** Processor defaultProcessorVersion. */ - public defaultProcessorVersion: string; - - /** Processor processorVersionAliases. */ - public processorVersionAliases: google.cloud.documentai.v1beta3.IProcessorVersionAlias[]; - - /** Processor processEndpoint. */ - public processEndpoint: string; - - /** Processor createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Processor kmsKeyName. */ - public kmsKeyName: string; - - /** Processor satisfiesPzs. */ - public satisfiesPzs: boolean; - - /** Processor satisfiesPzi. */ - public satisfiesPzi: boolean; - - /** - * Creates a new Processor instance using the specified properties. - * @param [properties] Properties to set - * @returns Processor instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IProcessor): google.cloud.documentai.v1beta3.Processor; - - /** - * Encodes the specified Processor message. Does not implicitly {@link google.cloud.documentai.v1beta3.Processor.verify|verify} messages. - * @param message Processor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IProcessor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Processor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Processor.verify|verify} messages. - * @param message Processor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Processor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Processor - * @throws {Error} If the payload is not a 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.v1beta3.Processor; - - /** - * Decodes a Processor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Processor - * @throws {Error} If the payload is 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.v1beta3.Processor; - - /** - * Verifies a Processor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Processor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Processor - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Processor; - - /** - * Creates a plain object from a Processor message. Also converts values to other types if specified. - * @param message Processor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Processor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Processor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Processor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Processor { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ENABLED = 1, - DISABLED = 2, - ENABLING = 3, - DISABLING = 4, - CREATING = 5, - FAILED = 6, - DELETING = 7 - } - } - - /** Properties of a ProcessorType. */ - interface IProcessorType { - - /** ProcessorType name */ - name?: (string|null); - - /** ProcessorType type */ - type?: (string|null); - - /** ProcessorType category */ - category?: (string|null); - - /** ProcessorType availableLocations */ - availableLocations?: (google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo[]|null); - - /** ProcessorType allowCreation */ - allowCreation?: (boolean|null); - - /** ProcessorType launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ProcessorType sampleDocumentUris */ - sampleDocumentUris?: (string[]|null); - } - - /** Represents a ProcessorType. */ - class ProcessorType implements IProcessorType { - - /** - * Constructs a new ProcessorType. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IProcessorType); - - /** ProcessorType name. */ - public name: string; - - /** ProcessorType type. */ - public type: string; - - /** ProcessorType category. */ - public category: string; - - /** ProcessorType availableLocations. */ - public availableLocations: google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo[]; - - /** ProcessorType allowCreation. */ - public allowCreation: boolean; - - /** ProcessorType launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ProcessorType sampleDocumentUris. */ - public sampleDocumentUris: string[]; - - /** - * Creates a new ProcessorType instance using the specified properties. - * @param [properties] Properties to set - * @returns ProcessorType instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IProcessorType): google.cloud.documentai.v1beta3.ProcessorType; - - /** - * Encodes the specified ProcessorType message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.verify|verify} messages. - * @param message ProcessorType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IProcessorType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProcessorType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.verify|verify} messages. - * @param message ProcessorType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IProcessorType, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProcessorType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProcessorType - * @throws {Error} If the payload is not a 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.v1beta3.ProcessorType; - - /** - * Decodes a ProcessorType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProcessorType - * @throws {Error} If the payload is 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.v1beta3.ProcessorType; - - /** - * Verifies a ProcessorType message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProcessorType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProcessorType - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorType; - - /** - * Creates a plain object from a ProcessorType message. Also converts values to other types if specified. - * @param message ProcessorType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessorType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProcessorType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProcessorType - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ProcessorType { - - /** Properties of a LocationInfo. */ - interface ILocationInfo { - - /** LocationInfo locationId */ - locationId?: (string|null); - } - - /** Represents a LocationInfo. */ - class LocationInfo implements ILocationInfo { - - /** - * Constructs a new LocationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo); - - /** LocationInfo locationId. */ - public locationId: string; - - /** - * Creates a new LocationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns LocationInfo instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo): google.cloud.documentai.v1beta3.ProcessorType.LocationInfo; - - /** - * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.verify|verify} messages. - * @param message LocationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.verify|verify} messages. - * @param message LocationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LocationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LocationInfo - * @throws {Error} If the payload is not a 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.v1beta3.ProcessorType.LocationInfo; - - /** - * Decodes a LocationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LocationInfo - * @throws {Error} If the payload is 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.v1beta3.ProcessorType.LocationInfo; - - /** - * Verifies a LocationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LocationInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ProcessorType.LocationInfo; - - /** - * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. - * @param message LocationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ProcessorType.LocationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LocationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LocationInfo - * @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 UpdateDataset. - * @param request UpdateDatasetRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateDataset(request: google.cloud.documentai.v1beta3.IUpdateDatasetRequest, callback: google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetCallback): void; - - /** - * Calls UpdateDataset. - * @param request UpdateDatasetRequest message or plain object - * @returns Promise - */ - public updateDataset(request: google.cloud.documentai.v1beta3.IUpdateDatasetRequest): Promise; - - /** - * Calls ImportDocuments. - * @param request ImportDocumentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importDocuments(request: google.cloud.documentai.v1beta3.IImportDocumentsRequest, callback: google.cloud.documentai.v1beta3.DocumentService.ImportDocumentsCallback): void; - - /** - * Calls ImportDocuments. - * @param request ImportDocumentsRequest message or plain object - * @returns Promise - */ - public importDocuments(request: google.cloud.documentai.v1beta3.IImportDocumentsRequest): Promise; - - /** - * Calls GetDocument. - * @param request GetDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and GetDocumentResponse - */ - public getDocument(request: google.cloud.documentai.v1beta3.IGetDocumentRequest, callback: google.cloud.documentai.v1beta3.DocumentService.GetDocumentCallback): void; - - /** - * Calls GetDocument. - * @param request GetDocumentRequest message or plain object - * @returns Promise - */ - public getDocument(request: google.cloud.documentai.v1beta3.IGetDocumentRequest): Promise; - - /** - * Calls ListDocuments. - * @param request ListDocumentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDocumentsResponse - */ - public listDocuments(request: google.cloud.documentai.v1beta3.IListDocumentsRequest, callback: google.cloud.documentai.v1beta3.DocumentService.ListDocumentsCallback): void; - - /** - * Calls ListDocuments. - * @param request ListDocumentsRequest message or plain object - * @returns Promise - */ - public listDocuments(request: google.cloud.documentai.v1beta3.IListDocumentsRequest): Promise; - - /** - * Calls BatchDeleteDocuments. - * @param request BatchDeleteDocumentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchDeleteDocuments(request: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, callback: google.cloud.documentai.v1beta3.DocumentService.BatchDeleteDocumentsCallback): void; - - /** - * Calls BatchDeleteDocuments. - * @param request BatchDeleteDocumentsRequest message or plain object - * @returns Promise - */ - public batchDeleteDocuments(request: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest): Promise; - - /** - * Calls GetDatasetSchema. - * @param request GetDatasetSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DatasetSchema - */ - public getDatasetSchema(request: google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, callback: google.cloud.documentai.v1beta3.DocumentService.GetDatasetSchemaCallback): void; - - /** - * Calls GetDatasetSchema. - * @param request GetDatasetSchemaRequest message or plain object - * @returns Promise - */ - public getDatasetSchema(request: google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest): Promise; - - /** - * Calls UpdateDatasetSchema. - * @param request UpdateDatasetSchemaRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DatasetSchema - */ - public updateDatasetSchema(request: google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, callback: google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetSchemaCallback): void; - - /** - * Calls UpdateDatasetSchema. - * @param request UpdateDatasetSchemaRequest message or plain object - * @returns Promise - */ - public updateDatasetSchema(request: google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest): Promise; - } - - namespace DocumentService { - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|updateDataset}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|importDocuments}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|getDocument}. - * @param error Error, if any - * @param [response] GetDocumentResponse - */ - type GetDocumentCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.GetDocumentResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|listDocuments}. - * @param error Error, if any - * @param [response] ListDocumentsResponse - */ - type ListDocumentsCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.ListDocumentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|batchDeleteDocuments}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchDeleteDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|getDatasetSchema}. - * @param error Error, if any - * @param [response] DatasetSchema - */ - type GetDatasetSchemaCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.DatasetSchema) => void; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|updateDatasetSchema}. - * @param error Error, if any - * @param [response] DatasetSchema - */ - type UpdateDatasetSchemaCallback = (error: (Error|null), response?: google.cloud.documentai.v1beta3.DatasetSchema) => void; - } - - /** DatasetSplitType enum. */ - enum DatasetSplitType { - DATASET_SPLIT_TYPE_UNSPECIFIED = 0, - DATASET_SPLIT_TRAIN = 1, - DATASET_SPLIT_TEST = 2, - DATASET_SPLIT_UNASSIGNED = 3 - } - - /** DocumentLabelingState enum. */ - enum DocumentLabelingState { - DOCUMENT_LABELING_STATE_UNSPECIFIED = 0, - DOCUMENT_LABELED = 1, - DOCUMENT_UNLABELED = 2, - DOCUMENT_AUTO_LABELED = 3 - } - - /** Properties of an UpdateDatasetRequest. */ - interface IUpdateDatasetRequest { - - /** UpdateDatasetRequest dataset */ - dataset?: (google.cloud.documentai.v1beta3.IDataset|null); - - /** UpdateDatasetRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateDatasetRequest. */ - class UpdateDatasetRequest implements IUpdateDatasetRequest { - - /** - * Constructs a new UpdateDatasetRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IUpdateDatasetRequest); - - /** UpdateDatasetRequest dataset. */ - public dataset?: (google.cloud.documentai.v1beta3.IDataset|null); - - /** UpdateDatasetRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateDatasetRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDatasetRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IUpdateDatasetRequest): google.cloud.documentai.v1beta3.UpdateDatasetRequest; - - /** - * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetRequest.verify|verify} messages. - * @param message UpdateDatasetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetRequest.verify|verify} messages. - * @param message UpdateDatasetRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUpdateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDatasetRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDatasetRequest - * @throws {Error} If the payload is not a 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.v1beta3.UpdateDatasetRequest; - - /** - * Decodes an UpdateDatasetRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDatasetRequest - * @throws {Error} If the payload is 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.v1beta3.UpdateDatasetRequest; - - /** - * Verifies an UpdateDatasetRequest message. - * @param message Plain 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 UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatasetRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UpdateDatasetRequest; - - /** - * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. - * @param message UpdateDatasetRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.UpdateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatasetRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDatasetRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDatasetOperationMetadata. */ - interface IUpdateDatasetOperationMetadata { - - /** UpdateDatasetOperationMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - } - - /** Represents an UpdateDatasetOperationMetadata. */ - class UpdateDatasetOperationMetadata implements IUpdateDatasetOperationMetadata { - - /** - * Constructs a new UpdateDatasetOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata); - - /** UpdateDatasetOperationMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** - * Creates a new UpdateDatasetOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDatasetOperationMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata): google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata; - - /** - * Encodes the specified UpdateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata.verify|verify} messages. - * @param message UpdateDatasetOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata.verify|verify} messages. - * @param message UpdateDatasetOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDatasetOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDatasetOperationMetadata - * @throws {Error} If the payload is not a 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.v1beta3.UpdateDatasetOperationMetadata; - - /** - * Decodes an UpdateDatasetOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDatasetOperationMetadata - * @throws {Error} If the payload is 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.v1beta3.UpdateDatasetOperationMetadata; - - /** - * Verifies an UpdateDatasetOperationMetadata message. - * @param message Plain 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 UpdateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatasetOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata; - - /** - * Creates a plain object from an UpdateDatasetOperationMetadata message. Also converts values to other types if specified. - * @param message UpdateDatasetOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatasetOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDatasetOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportDocumentsRequest. */ - interface IImportDocumentsRequest { - - /** ImportDocumentsRequest dataset */ - dataset?: (string|null); - - /** ImportDocumentsRequest batchDocumentsImportConfigs */ - batchDocumentsImportConfigs?: (google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig[]|null); - } - - /** Represents an ImportDocumentsRequest. */ - class ImportDocumentsRequest implements IImportDocumentsRequest { - - /** - * Constructs a new ImportDocumentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IImportDocumentsRequest); - - /** ImportDocumentsRequest dataset. */ - public dataset: string; - - /** ImportDocumentsRequest batchDocumentsImportConfigs. */ - public batchDocumentsImportConfigs: google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig[]; - - /** - * Creates a new ImportDocumentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportDocumentsRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IImportDocumentsRequest): google.cloud.documentai.v1beta3.ImportDocumentsRequest; - - /** - * Encodes the specified ImportDocumentsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.verify|verify} messages. - * @param message ImportDocumentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IImportDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.verify|verify} messages. - * @param message ImportDocumentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportDocumentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportDocumentsRequest - * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsRequest; - - /** - * Decodes an ImportDocumentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportDocumentsRequest - * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsRequest; - - /** - * Verifies an ImportDocumentsRequest message. - * @param message Plain 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 ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportDocumentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsRequest; - - /** - * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. - * @param message ImportDocumentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportDocumentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportDocumentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImportDocumentsRequest { - - /** Properties of a BatchDocumentsImportConfig. */ - interface IBatchDocumentsImportConfig { - - /** BatchDocumentsImportConfig datasetSplit */ - datasetSplit?: (google.cloud.documentai.v1beta3.DatasetSplitType|keyof typeof google.cloud.documentai.v1beta3.DatasetSplitType|null); - - /** BatchDocumentsImportConfig autoSplitConfig */ - autoSplitConfig?: (google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig|null); - - /** BatchDocumentsImportConfig batchInputConfig */ - batchInputConfig?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); - - /** BatchDocumentsImportConfig documentType */ - documentType?: (string|null); - } - - /** Represents a BatchDocumentsImportConfig. */ - class BatchDocumentsImportConfig implements IBatchDocumentsImportConfig { - - /** - * Constructs a new BatchDocumentsImportConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig); - - /** BatchDocumentsImportConfig datasetSplit. */ - public datasetSplit?: (google.cloud.documentai.v1beta3.DatasetSplitType|keyof typeof google.cloud.documentai.v1beta3.DatasetSplitType|null); - - /** BatchDocumentsImportConfig autoSplitConfig. */ - public autoSplitConfig?: (google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig|null); - - /** BatchDocumentsImportConfig batchInputConfig. */ - public batchInputConfig?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); - - /** BatchDocumentsImportConfig documentType. */ - public documentType: string; - - /** BatchDocumentsImportConfig splitTypeConfig. */ - public splitTypeConfig?: ("datasetSplit"|"autoSplitConfig"); - - /** - * Creates a new BatchDocumentsImportConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDocumentsImportConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig): google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig; - - /** - * Encodes the specified BatchDocumentsImportConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.verify|verify} messages. - * @param message BatchDocumentsImportConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchDocumentsImportConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.verify|verify} messages. - * @param message BatchDocumentsImportConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchDocumentsImportConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDocumentsImportConfig - * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig; - - /** - * Decodes a BatchDocumentsImportConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDocumentsImportConfig - * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig; - - /** - * Verifies a BatchDocumentsImportConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchDocumentsImportConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDocumentsImportConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig; - - /** - * Creates a plain object from a BatchDocumentsImportConfig message. Also converts values to other types if specified. - * @param message BatchDocumentsImportConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchDocumentsImportConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchDocumentsImportConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BatchDocumentsImportConfig { - - /** Properties of an AutoSplitConfig. */ - interface IAutoSplitConfig { - - /** AutoSplitConfig trainingSplitRatio */ - trainingSplitRatio?: (number|null); - } - - /** Represents an AutoSplitConfig. */ - class AutoSplitConfig implements IAutoSplitConfig { - - /** - * Constructs a new AutoSplitConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig); - - /** AutoSplitConfig trainingSplitRatio. */ - public trainingSplitRatio: number; - - /** - * Creates a new AutoSplitConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoSplitConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig): google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig; - - /** - * Encodes the specified AutoSplitConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.verify|verify} messages. - * @param message AutoSplitConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutoSplitConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.verify|verify} messages. - * @param message AutoSplitConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutoSplitConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoSplitConfig - * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig; - - /** - * Decodes an AutoSplitConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoSplitConfig - * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig; - - /** - * Verifies an AutoSplitConfig message. - * @param message Plain 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 AutoSplitConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoSplitConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig; - - /** - * Creates a plain object from an AutoSplitConfig message. Also converts values to other types if specified. - * @param message AutoSplitConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutoSplitConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutoSplitConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of an ImportDocumentsResponse. */ - interface IImportDocumentsResponse { - } - - /** Represents an ImportDocumentsResponse. */ - class ImportDocumentsResponse implements IImportDocumentsResponse { - - /** - * Constructs a new ImportDocumentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IImportDocumentsResponse); - - /** - * Creates a new ImportDocumentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportDocumentsResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IImportDocumentsResponse): google.cloud.documentai.v1beta3.ImportDocumentsResponse; - - /** - * Encodes the specified ImportDocumentsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsResponse.verify|verify} messages. - * @param message ImportDocumentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IImportDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsResponse.verify|verify} messages. - * @param message ImportDocumentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportDocumentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportDocumentsResponse - * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsResponse; - - /** - * Decodes an ImportDocumentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportDocumentsResponse - * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsResponse; - - /** - * Verifies an ImportDocumentsResponse message. - * @param message Plain 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 ImportDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportDocumentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsResponse; - - /** - * Creates a plain object from an ImportDocumentsResponse message. Also converts values to other types if specified. - * @param message ImportDocumentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportDocumentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportDocumentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportDocumentsMetadata. */ - interface IImportDocumentsMetadata { - - /** ImportDocumentsMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** ImportDocumentsMetadata individualImportStatuses */ - individualImportStatuses?: (google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus[]|null); - - /** ImportDocumentsMetadata importConfigValidationResults */ - importConfigValidationResults?: (google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult[]|null); - - /** ImportDocumentsMetadata totalDocumentCount */ - totalDocumentCount?: (number|null); - } - - /** Represents an ImportDocumentsMetadata. */ - class ImportDocumentsMetadata implements IImportDocumentsMetadata { - - /** - * Constructs a new ImportDocumentsMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IImportDocumentsMetadata); - - /** ImportDocumentsMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** ImportDocumentsMetadata individualImportStatuses. */ - public individualImportStatuses: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus[]; - - /** ImportDocumentsMetadata importConfigValidationResults. */ - public importConfigValidationResults: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult[]; - - /** ImportDocumentsMetadata totalDocumentCount. */ - public totalDocumentCount: number; - - /** - * Creates a new ImportDocumentsMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportDocumentsMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IImportDocumentsMetadata): google.cloud.documentai.v1beta3.ImportDocumentsMetadata; - - /** - * Encodes the specified ImportDocumentsMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.verify|verify} messages. - * @param message ImportDocumentsMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IImportDocumentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.verify|verify} messages. - * @param message ImportDocumentsMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IImportDocumentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportDocumentsMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportDocumentsMetadata - * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsMetadata; - - /** - * Decodes an ImportDocumentsMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportDocumentsMetadata - * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsMetadata; - - /** - * Verifies an ImportDocumentsMetadata message. - * @param message Plain 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 ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportDocumentsMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsMetadata; - - /** - * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. - * @param message ImportDocumentsMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportDocumentsMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportDocumentsMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ImportDocumentsMetadata { - - /** Properties of an IndividualImportStatus. */ - interface IIndividualImportStatus { - - /** IndividualImportStatus inputGcsSource */ - inputGcsSource?: (string|null); - - /** IndividualImportStatus status */ - status?: (google.rpc.IStatus|null); - - /** IndividualImportStatus outputDocumentId */ - outputDocumentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); - } - - /** Represents an IndividualImportStatus. */ - class IndividualImportStatus implements IIndividualImportStatus { - - /** - * Constructs a new IndividualImportStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus); - - /** IndividualImportStatus inputGcsSource. */ - public inputGcsSource: string; - - /** IndividualImportStatus status. */ - public status?: (google.rpc.IStatus|null); - - /** IndividualImportStatus outputDocumentId. */ - public outputDocumentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); - - /** - * Creates a new IndividualImportStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns IndividualImportStatus instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus): google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus; - - /** - * Encodes the specified IndividualImportStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.verify|verify} messages. - * @param message IndividualImportStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IndividualImportStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.verify|verify} messages. - * @param message IndividualImportStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IndividualImportStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndividualImportStatus - * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsMetadata.IndividualImportStatus; - - /** - * Decodes an IndividualImportStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndividualImportStatus - * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsMetadata.IndividualImportStatus; - - /** - * Verifies an IndividualImportStatus message. - * @param message Plain 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 IndividualImportStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndividualImportStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus; - - /** - * Creates a plain object from an IndividualImportStatus message. Also converts values to other types if specified. - * @param message IndividualImportStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndividualImportStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IndividualImportStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportConfigValidationResult. */ - interface IImportConfigValidationResult { - - /** ImportConfigValidationResult inputGcsSource */ - inputGcsSource?: (string|null); - - /** ImportConfigValidationResult status */ - status?: (google.rpc.IStatus|null); - } - - /** Represents an ImportConfigValidationResult. */ - class ImportConfigValidationResult implements IImportConfigValidationResult { - - /** - * Constructs a new ImportConfigValidationResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult); - - /** ImportConfigValidationResult inputGcsSource. */ - public inputGcsSource: string; - - /** ImportConfigValidationResult status. */ - public status?: (google.rpc.IStatus|null); - - /** - * Creates a new ImportConfigValidationResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportConfigValidationResult instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult): google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult; - - /** - * Encodes the specified ImportConfigValidationResult message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.verify|verify} messages. - * @param message ImportConfigValidationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ImportConfigValidationResult message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.verify|verify} messages. - * @param message ImportConfigValidationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ImportConfigValidationResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportConfigValidationResult - * @throws {Error} If the payload is not a 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.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult; - - /** - * Decodes an ImportConfigValidationResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportConfigValidationResult - * @throws {Error} If the payload is 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.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult; - - /** - * Verifies an ImportConfigValidationResult message. - * @param message Plain 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 ImportConfigValidationResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportConfigValidationResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult; - - /** - * Creates a plain object from an ImportConfigValidationResult message. Also converts values to other types if specified. - * @param message ImportConfigValidationResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ImportConfigValidationResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportConfigValidationResult - * @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 dataset */ - dataset?: (string|null); - - /** GetDocumentRequest documentId */ - documentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); - - /** GetDocumentRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); - - /** GetDocumentRequest pageRange */ - pageRange?: (google.cloud.documentai.v1beta3.IDocumentPageRange|null); - } - - /** Represents a GetDocumentRequest. */ - class GetDocumentRequest implements IGetDocumentRequest { - - /** - * Constructs a new GetDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGetDocumentRequest); - - /** GetDocumentRequest dataset. */ - public dataset: string; - - /** GetDocumentRequest documentId. */ - public documentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); - - /** GetDocumentRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); - - /** GetDocumentRequest pageRange. */ - public pageRange?: (google.cloud.documentai.v1beta3.IDocumentPageRange|null); - - /** - * Creates a new GetDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDocumentRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IGetDocumentRequest): google.cloud.documentai.v1beta3.GetDocumentRequest; - - /** - * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.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.documentai.v1beta3.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.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 a GetDocumentResponse. */ - interface IGetDocumentResponse { - - /** GetDocumentResponse document */ - document?: (google.cloud.documentai.v1beta3.IDocument|null); - } - - /** Represents a GetDocumentResponse. */ - class GetDocumentResponse implements IGetDocumentResponse { - - /** - * Constructs a new GetDocumentResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGetDocumentResponse); - - /** GetDocumentResponse document. */ - public document?: (google.cloud.documentai.v1beta3.IDocument|null); - - /** - * Creates a new GetDocumentResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDocumentResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IGetDocumentResponse): google.cloud.documentai.v1beta3.GetDocumentResponse; - - /** - * Encodes the specified GetDocumentResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDocumentResponse.verify|verify} messages. - * @param message GetDocumentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IGetDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDocumentResponse.verify|verify} messages. - * @param message GetDocumentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGetDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDocumentResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDocumentResponse - * @throws {Error} If the payload is not a 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.v1beta3.GetDocumentResponse; - - /** - * Decodes a GetDocumentResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDocumentResponse - * @throws {Error} If the payload is 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.v1beta3.GetDocumentResponse; - - /** - * Verifies a GetDocumentResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDocumentResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDocumentResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GetDocumentResponse; - - /** - * Creates a plain object from a GetDocumentResponse message. Also converts values to other types if specified. - * @param message GetDocumentResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.GetDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDocumentResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDocumentResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDocumentsRequest. */ - interface IListDocumentsRequest { - - /** ListDocumentsRequest dataset */ - dataset?: (string|null); - - /** ListDocumentsRequest pageSize */ - pageSize?: (number|null); - - /** ListDocumentsRequest pageToken */ - pageToken?: (string|null); - - /** ListDocumentsRequest filter */ - filter?: (string|null); - - /** ListDocumentsRequest returnTotalSize */ - returnTotalSize?: (boolean|null); - - /** ListDocumentsRequest skip */ - skip?: (number|null); - } - - /** Represents a ListDocumentsRequest. */ - class ListDocumentsRequest implements IListDocumentsRequest { - - /** - * Constructs a new ListDocumentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IListDocumentsRequest); - - /** ListDocumentsRequest dataset. */ - public dataset: string; - - /** ListDocumentsRequest pageSize. */ - public pageSize: number; - - /** ListDocumentsRequest pageToken. */ - public pageToken: string; - - /** ListDocumentsRequest filter. */ - public filter: string; - - /** ListDocumentsRequest returnTotalSize. */ - public returnTotalSize: boolean; - - /** ListDocumentsRequest skip. */ - public skip: number; - - /** - * Creates a new ListDocumentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDocumentsRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IListDocumentsRequest): google.cloud.documentai.v1beta3.ListDocumentsRequest; - - /** - * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsRequest.verify|verify} messages. - * @param message ListDocumentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsRequest.verify|verify} messages. - * @param message ListDocumentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDocumentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDocumentsRequest - * @throws {Error} If the payload is not a 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.v1beta3.ListDocumentsRequest; - - /** - * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDocumentsRequest - * @throws {Error} If the payload is 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.v1beta3.ListDocumentsRequest; - - /** - * Verifies a ListDocumentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDocumentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListDocumentsRequest; - - /** - * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. - * @param message ListDocumentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ListDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDocumentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDocumentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDocumentsResponse. */ - interface IListDocumentsResponse { - - /** ListDocumentsResponse documentMetadata */ - documentMetadata?: (google.cloud.documentai.v1beta3.IDocumentMetadata[]|null); - - /** ListDocumentsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListDocumentsResponse totalSize */ - totalSize?: (number|null); - } - - /** Represents a ListDocumentsResponse. */ - class ListDocumentsResponse implements IListDocumentsResponse { - - /** - * Constructs a new ListDocumentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IListDocumentsResponse); - - /** ListDocumentsResponse documentMetadata. */ - public documentMetadata: google.cloud.documentai.v1beta3.IDocumentMetadata[]; - - /** ListDocumentsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListDocumentsResponse totalSize. */ - public totalSize: number; - - /** - * Creates a new ListDocumentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDocumentsResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IListDocumentsResponse): google.cloud.documentai.v1beta3.ListDocumentsResponse; - - /** - * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsResponse.verify|verify} messages. - * @param message ListDocumentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsResponse.verify|verify} messages. - * @param message ListDocumentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDocumentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDocumentsResponse - * @throws {Error} If the payload is not a 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.v1beta3.ListDocumentsResponse; - - /** - * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDocumentsResponse - * @throws {Error} If the payload is 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.v1beta3.ListDocumentsResponse; - - /** - * Verifies a ListDocumentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDocumentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.ListDocumentsResponse; - - /** - * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. - * @param message ListDocumentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.ListDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDocumentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDocumentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchDeleteDocumentsRequest. */ - interface IBatchDeleteDocumentsRequest { - - /** BatchDeleteDocumentsRequest dataset */ - dataset?: (string|null); - - /** BatchDeleteDocumentsRequest datasetDocuments */ - datasetDocuments?: (google.cloud.documentai.v1beta3.IBatchDatasetDocuments|null); - } - - /** Represents a BatchDeleteDocumentsRequest. */ - class BatchDeleteDocumentsRequest implements IBatchDeleteDocumentsRequest { - - /** - * Constructs a new BatchDeleteDocumentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest); - - /** BatchDeleteDocumentsRequest dataset. */ - public dataset: string; - - /** BatchDeleteDocumentsRequest datasetDocuments. */ - public datasetDocuments?: (google.cloud.documentai.v1beta3.IBatchDatasetDocuments|null); - - /** - * Creates a new BatchDeleteDocumentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDeleteDocumentsRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest): google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest; - - /** - * Encodes the specified BatchDeleteDocumentsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest.verify|verify} messages. - * @param message BatchDeleteDocumentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchDeleteDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest.verify|verify} messages. - * @param message BatchDeleteDocumentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchDeleteDocumentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDeleteDocumentsRequest - * @throws {Error} If the payload is not a 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.v1beta3.BatchDeleteDocumentsRequest; - - /** - * Decodes a BatchDeleteDocumentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDeleteDocumentsRequest - * @throws {Error} If the payload is 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.v1beta3.BatchDeleteDocumentsRequest; - - /** - * Verifies a BatchDeleteDocumentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchDeleteDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDeleteDocumentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest; - - /** - * Creates a plain object from a BatchDeleteDocumentsRequest message. Also converts values to other types if specified. - * @param message BatchDeleteDocumentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchDeleteDocumentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchDeleteDocumentsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchDeleteDocumentsResponse. */ - interface IBatchDeleteDocumentsResponse { - } - - /** Represents a BatchDeleteDocumentsResponse. */ - class BatchDeleteDocumentsResponse implements IBatchDeleteDocumentsResponse { - - /** - * Constructs a new BatchDeleteDocumentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse); - - /** - * Creates a new BatchDeleteDocumentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDeleteDocumentsResponse instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse): google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse; - - /** - * Encodes the specified BatchDeleteDocumentsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse.verify|verify} messages. - * @param message BatchDeleteDocumentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchDeleteDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse.verify|verify} messages. - * @param message BatchDeleteDocumentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchDeleteDocumentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDeleteDocumentsResponse - * @throws {Error} If the payload is not a 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.v1beta3.BatchDeleteDocumentsResponse; - - /** - * Decodes a BatchDeleteDocumentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDeleteDocumentsResponse - * @throws {Error} If the payload is 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.v1beta3.BatchDeleteDocumentsResponse; - - /** - * Verifies a BatchDeleteDocumentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchDeleteDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDeleteDocumentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse; - - /** - * Creates a plain object from a BatchDeleteDocumentsResponse message. Also converts values to other types if specified. - * @param message BatchDeleteDocumentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchDeleteDocumentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchDeleteDocumentsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BatchDeleteDocumentsMetadata. */ - interface IBatchDeleteDocumentsMetadata { - - /** BatchDeleteDocumentsMetadata commonMetadata */ - commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** BatchDeleteDocumentsMetadata individualBatchDeleteStatuses */ - individualBatchDeleteStatuses?: (google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus[]|null); - - /** BatchDeleteDocumentsMetadata totalDocumentCount */ - totalDocumentCount?: (number|null); - - /** BatchDeleteDocumentsMetadata errorDocumentCount */ - errorDocumentCount?: (number|null); - } - - /** Represents a BatchDeleteDocumentsMetadata. */ - class BatchDeleteDocumentsMetadata implements IBatchDeleteDocumentsMetadata { - - /** - * Constructs a new BatchDeleteDocumentsMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata); - - /** BatchDeleteDocumentsMetadata commonMetadata. */ - public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); - - /** BatchDeleteDocumentsMetadata individualBatchDeleteStatuses. */ - public individualBatchDeleteStatuses: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus[]; - - /** BatchDeleteDocumentsMetadata totalDocumentCount. */ - public totalDocumentCount: number; - - /** BatchDeleteDocumentsMetadata errorDocumentCount. */ - public errorDocumentCount: number; - - /** - * Creates a new BatchDeleteDocumentsMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDeleteDocumentsMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata): google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata; - - /** - * Encodes the specified BatchDeleteDocumentsMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.verify|verify} messages. - * @param message BatchDeleteDocumentsMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchDeleteDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.verify|verify} messages. - * @param message BatchDeleteDocumentsMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchDeleteDocumentsMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDeleteDocumentsMetadata - * @throws {Error} If the payload is not a 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.v1beta3.BatchDeleteDocumentsMetadata; - - /** - * Decodes a BatchDeleteDocumentsMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDeleteDocumentsMetadata - * @throws {Error} If the payload is 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.v1beta3.BatchDeleteDocumentsMetadata; - - /** - * Verifies a BatchDeleteDocumentsMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchDeleteDocumentsMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDeleteDocumentsMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata; - - /** - * Creates a plain object from a BatchDeleteDocumentsMetadata message. Also converts values to other types if specified. - * @param message BatchDeleteDocumentsMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchDeleteDocumentsMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchDeleteDocumentsMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BatchDeleteDocumentsMetadata { - - /** Properties of an IndividualBatchDeleteStatus. */ - interface IIndividualBatchDeleteStatus { - - /** IndividualBatchDeleteStatus documentId */ - documentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); - - /** IndividualBatchDeleteStatus status */ - status?: (google.rpc.IStatus|null); - } - - /** Represents an IndividualBatchDeleteStatus. */ - class IndividualBatchDeleteStatus implements IIndividualBatchDeleteStatus { - - /** - * Constructs a new IndividualBatchDeleteStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus); - - /** IndividualBatchDeleteStatus documentId. */ - public documentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); - - /** IndividualBatchDeleteStatus status. */ - public status?: (google.rpc.IStatus|null); - - /** - * Creates a new IndividualBatchDeleteStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns IndividualBatchDeleteStatus instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus): google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus; - - /** - * Encodes the specified IndividualBatchDeleteStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.verify|verify} messages. - * @param message IndividualBatchDeleteStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IndividualBatchDeleteStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.verify|verify} messages. - * @param message IndividualBatchDeleteStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IndividualBatchDeleteStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndividualBatchDeleteStatus - * @throws {Error} If the payload is not a 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.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus; - - /** - * Decodes an IndividualBatchDeleteStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndividualBatchDeleteStatus - * @throws {Error} If the payload is 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.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus; - - /** - * Verifies an IndividualBatchDeleteStatus message. - * @param message Plain 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 IndividualBatchDeleteStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndividualBatchDeleteStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus; - - /** - * Creates a plain object from an IndividualBatchDeleteStatus message. Also converts values to other types if specified. - * @param message IndividualBatchDeleteStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IndividualBatchDeleteStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IndividualBatchDeleteStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GetDatasetSchemaRequest. */ - interface IGetDatasetSchemaRequest { - - /** GetDatasetSchemaRequest name */ - name?: (string|null); - - /** GetDatasetSchemaRequest visibleFieldsOnly */ - visibleFieldsOnly?: (boolean|null); - } - - /** Represents a GetDatasetSchemaRequest. */ - class GetDatasetSchemaRequest implements IGetDatasetSchemaRequest { - - /** - * Constructs a new GetDatasetSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest); - - /** GetDatasetSchemaRequest name. */ - public name: string; - - /** GetDatasetSchemaRequest visibleFieldsOnly. */ - public visibleFieldsOnly: boolean; - - /** - * Creates a new GetDatasetSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDatasetSchemaRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest): google.cloud.documentai.v1beta3.GetDatasetSchemaRequest; - - /** - * Encodes the specified GetDatasetSchemaRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDatasetSchemaRequest.verify|verify} messages. - * @param message GetDatasetSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDatasetSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDatasetSchemaRequest.verify|verify} messages. - * @param message GetDatasetSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDatasetSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDatasetSchemaRequest - * @throws {Error} If the payload is not a 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.v1beta3.GetDatasetSchemaRequest; - - /** - * Decodes a GetDatasetSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDatasetSchemaRequest - * @throws {Error} If the payload is 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.v1beta3.GetDatasetSchemaRequest; - - /** - * Verifies a GetDatasetSchemaRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDatasetSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDatasetSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.GetDatasetSchemaRequest; - - /** - * Creates a plain object from a GetDatasetSchemaRequest message. Also converts values to other types if specified. - * @param message GetDatasetSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.GetDatasetSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDatasetSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDatasetSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDatasetSchemaRequest. */ - interface IUpdateDatasetSchemaRequest { - - /** UpdateDatasetSchemaRequest datasetSchema */ - datasetSchema?: (google.cloud.documentai.v1beta3.IDatasetSchema|null); - - /** UpdateDatasetSchemaRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateDatasetSchemaRequest. */ - class UpdateDatasetSchemaRequest implements IUpdateDatasetSchemaRequest { - - /** - * Constructs a new UpdateDatasetSchemaRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest); - - /** UpdateDatasetSchemaRequest datasetSchema. */ - public datasetSchema?: (google.cloud.documentai.v1beta3.IDatasetSchema|null); - - /** UpdateDatasetSchemaRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateDatasetSchemaRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDatasetSchemaRequest instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest): google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest; - - /** - * Encodes the specified UpdateDatasetSchemaRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.verify|verify} messages. - * @param message UpdateDatasetSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDatasetSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.verify|verify} messages. - * @param message UpdateDatasetSchemaRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDatasetSchemaRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDatasetSchemaRequest - * @throws {Error} If the payload is not a 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.v1beta3.UpdateDatasetSchemaRequest; - - /** - * Decodes an UpdateDatasetSchemaRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDatasetSchemaRequest - * @throws {Error} If the payload is 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.v1beta3.UpdateDatasetSchemaRequest; - - /** - * Verifies an UpdateDatasetSchemaRequest message. - * @param message Plain 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 UpdateDatasetSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDatasetSchemaRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest; - - /** - * Creates a plain object from an UpdateDatasetSchemaRequest message. Also converts values to other types if specified. - * @param message UpdateDatasetSchemaRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDatasetSchemaRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDatasetSchemaRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DocumentPageRange. */ - interface IDocumentPageRange { - - /** DocumentPageRange start */ - start?: (number|null); - - /** DocumentPageRange end */ - end?: (number|null); - } - - /** Represents a DocumentPageRange. */ - class DocumentPageRange implements IDocumentPageRange { - - /** - * Constructs a new DocumentPageRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDocumentPageRange); - - /** DocumentPageRange start. */ - public start: number; - - /** DocumentPageRange end. */ - public end: number; - - /** - * Creates a new DocumentPageRange instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentPageRange instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDocumentPageRange): google.cloud.documentai.v1beta3.DocumentPageRange; - - /** - * Encodes the specified DocumentPageRange message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentPageRange.verify|verify} messages. - * @param message DocumentPageRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDocumentPageRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentPageRange message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentPageRange.verify|verify} messages. - * @param message DocumentPageRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDocumentPageRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DocumentPageRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DocumentPageRange - * @throws {Error} If the payload is not a 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.v1beta3.DocumentPageRange; - - /** - * Decodes a DocumentPageRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DocumentPageRange - * @throws {Error} If the payload is 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.v1beta3.DocumentPageRange; - - /** - * Verifies a DocumentPageRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DocumentPageRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentPageRange - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentPageRange; - - /** - * Creates a plain object from a DocumentPageRange message. Also converts values to other types if specified. - * @param message DocumentPageRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DocumentPageRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentPageRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DocumentPageRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DocumentMetadata. */ - interface IDocumentMetadata { - - /** DocumentMetadata documentId */ - documentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); - - /** DocumentMetadata pageCount */ - pageCount?: (number|null); - - /** DocumentMetadata datasetType */ - datasetType?: (google.cloud.documentai.v1beta3.DatasetSplitType|keyof typeof google.cloud.documentai.v1beta3.DatasetSplitType|null); - - /** DocumentMetadata labelingState */ - labelingState?: (google.cloud.documentai.v1beta3.DocumentLabelingState|keyof typeof google.cloud.documentai.v1beta3.DocumentLabelingState|null); - - /** DocumentMetadata displayName */ - displayName?: (string|null); - } - - /** Represents a DocumentMetadata. */ - class DocumentMetadata implements IDocumentMetadata { - - /** - * Constructs a new DocumentMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.IDocumentMetadata); - - /** DocumentMetadata documentId. */ - public documentId?: (google.cloud.documentai.v1beta3.IDocumentId|null); - - /** DocumentMetadata pageCount. */ - public pageCount: number; - - /** DocumentMetadata datasetType. */ - public datasetType: (google.cloud.documentai.v1beta3.DatasetSplitType|keyof typeof google.cloud.documentai.v1beta3.DatasetSplitType); - - /** DocumentMetadata labelingState. */ - public labelingState: (google.cloud.documentai.v1beta3.DocumentLabelingState|keyof typeof google.cloud.documentai.v1beta3.DocumentLabelingState); - - /** DocumentMetadata displayName. */ - public displayName: string; - - /** - * Creates a new DocumentMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DocumentMetadata instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.IDocumentMetadata): google.cloud.documentai.v1beta3.DocumentMetadata; - - /** - * Encodes the specified DocumentMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentMetadata.verify|verify} messages. - * @param message DocumentMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.IDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentMetadata.verify|verify} messages. - * @param message DocumentMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDocumentMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DocumentMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DocumentMetadata - * @throws {Error} If the payload is not a 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.v1beta3.DocumentMetadata; - - /** - * Decodes a DocumentMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DocumentMetadata - * @throws {Error} If the payload is 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.v1beta3.DocumentMetadata; - - /** - * Verifies a DocumentMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DocumentMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DocumentMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.DocumentMetadata; - - /** - * Creates a plain object from a DocumentMetadata message. Also converts values to other types if specified. - * @param message DocumentMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.DocumentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DocumentMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DocumentMetadata - * @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 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 - } - - /** 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; - } - } - - /** 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 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 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 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; - } - } - - /** 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-documentai/protos/protos.js b/owl-bot-staging/google-cloud-documentai/protos/protos.js deleted file mode 100644 index 3ff43c29245..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/protos.js +++ /dev/null @@ -1,124847 +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_documentai_protos || ($protobuf.roots._google_cloud_documentai_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.documentai = (function() { - - /** - * Namespace documentai. - * @memberof google.cloud - * @namespace - */ - var documentai = {}; - - documentai.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.cloud.documentai - * @namespace - */ - var v1 = {}; - - 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.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.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; - })(); - - v1.RawDocument = (function() { - - /** - * Properties of a RawDocument. - * @memberof google.cloud.documentai.v1 - * @interface IRawDocument - * @property {Uint8Array|null} [content] RawDocument content - * @property {string|null} [mimeType] RawDocument mimeType - * @property {string|null} [displayName] RawDocument displayName - */ - - /** - * Constructs a new RawDocument. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a RawDocument. - * @implements IRawDocument - * @constructor - * @param {google.cloud.documentai.v1.IRawDocument=} [properties] Properties to set - */ - function RawDocument(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RawDocument content. - * @member {Uint8Array} content - * @memberof google.cloud.documentai.v1.RawDocument - * @instance - */ - RawDocument.prototype.content = $util.newBuffer([]); - - /** - * RawDocument mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1.RawDocument - * @instance - */ - RawDocument.prototype.mimeType = ""; - - /** - * RawDocument displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1.RawDocument - * @instance - */ - RawDocument.prototype.displayName = ""; - - /** - * Creates a new RawDocument instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.RawDocument - * @static - * @param {google.cloud.documentai.v1.IRawDocument=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.RawDocument} RawDocument instance - */ - RawDocument.create = function create(properties) { - return new RawDocument(properties); - }; - - /** - * Encodes the specified RawDocument message. Does not implicitly {@link google.cloud.documentai.v1.RawDocument.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.RawDocument - * @static - * @param {google.cloud.documentai.v1.IRawDocument} message RawDocument message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RawDocument.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified RawDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.RawDocument.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.RawDocument - * @static - * @param {google.cloud.documentai.v1.IRawDocument} message RawDocument message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RawDocument.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RawDocument message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.RawDocument - * @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.RawDocument} RawDocument - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RawDocument.decode = function decode(reader, 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.RawDocument(); - 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.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RawDocument message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.RawDocument - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.RawDocument} RawDocument - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RawDocument.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RawDocument message. - * @function verify - * @memberof google.cloud.documentai.v1.RawDocument - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RawDocument.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates a RawDocument message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.RawDocument - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.RawDocument} RawDocument - */ - RawDocument.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.RawDocument) - return object; - var message = new $root.google.cloud.documentai.v1.RawDocument(); - 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.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from a RawDocument message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.RawDocument - * @static - * @param {google.cloud.documentai.v1.RawDocument} message RawDocument - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RawDocument.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.displayName = ""; - } - 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.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this RawDocument to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.RawDocument - * @instance - * @returns {Object.} JSON object - */ - RawDocument.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RawDocument - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.RawDocument - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RawDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.RawDocument"; - }; - - return RawDocument; - })(); - - v1.GcsDocument = (function() { - - /** - * Properties of a GcsDocument. - * @memberof google.cloud.documentai.v1 - * @interface IGcsDocument - * @property {string|null} [gcsUri] GcsDocument gcsUri - * @property {string|null} [mimeType] GcsDocument mimeType - */ - - /** - * Constructs a new GcsDocument. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a GcsDocument. - * @implements IGcsDocument - * @constructor - * @param {google.cloud.documentai.v1.IGcsDocument=} [properties] Properties to set - */ - function GcsDocument(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GcsDocument gcsUri. - * @member {string} gcsUri - * @memberof google.cloud.documentai.v1.GcsDocument - * @instance - */ - GcsDocument.prototype.gcsUri = ""; - - /** - * GcsDocument mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1.GcsDocument - * @instance - */ - GcsDocument.prototype.mimeType = ""; - - /** - * Creates a new GcsDocument instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.GcsDocument - * @static - * @param {google.cloud.documentai.v1.IGcsDocument=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.GcsDocument} GcsDocument instance - */ - GcsDocument.create = function create(properties) { - return new GcsDocument(properties); - }; - - /** - * Encodes the specified GcsDocument message. Does not implicitly {@link google.cloud.documentai.v1.GcsDocument.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.GcsDocument - * @static - * @param {google.cloud.documentai.v1.IGcsDocument} message GcsDocument message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDocument.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - return writer; - }; - - /** - * Encodes the specified GcsDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GcsDocument.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.GcsDocument - * @static - * @param {google.cloud.documentai.v1.IGcsDocument} message GcsDocument message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDocument.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsDocument message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.GcsDocument - * @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.GcsDocument} GcsDocument - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDocument.decode = function decode(reader, 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.GcsDocument(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsUri = reader.string(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsDocument message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.GcsDocument - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.GcsDocument} GcsDocument - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDocument.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsDocument message. - * @function verify - * @memberof google.cloud.documentai.v1.GcsDocument - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsDocument.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - return null; - }; - - /** - * Creates a GcsDocument message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.GcsDocument - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.GcsDocument} GcsDocument - */ - GcsDocument.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.GcsDocument) - return object; - var message = new $root.google.cloud.documentai.v1.GcsDocument(); - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - return message; - }; - - /** - * Creates a plain object from a GcsDocument message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.GcsDocument - * @static - * @param {google.cloud.documentai.v1.GcsDocument} message GcsDocument - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsDocument.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcsUri = ""; - object.mimeType = ""; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - object.gcsUri = message.gcsUri; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - return object; - }; - - /** - * Converts this GcsDocument to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.GcsDocument - * @instance - * @returns {Object.} JSON object - */ - GcsDocument.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsDocument - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.GcsDocument - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.GcsDocument"; - }; - - return GcsDocument; - })(); - - v1.GcsDocuments = (function() { - - /** - * Properties of a GcsDocuments. - * @memberof google.cloud.documentai.v1 - * @interface IGcsDocuments - * @property {Array.|null} [documents] GcsDocuments documents - */ - - /** - * Constructs a new GcsDocuments. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a GcsDocuments. - * @implements IGcsDocuments - * @constructor - * @param {google.cloud.documentai.v1.IGcsDocuments=} [properties] Properties to set - */ - function GcsDocuments(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]]; - } - - /** - * GcsDocuments documents. - * @member {Array.} documents - * @memberof google.cloud.documentai.v1.GcsDocuments - * @instance - */ - GcsDocuments.prototype.documents = $util.emptyArray; - - /** - * Creates a new GcsDocuments instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.GcsDocuments - * @static - * @param {google.cloud.documentai.v1.IGcsDocuments=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.GcsDocuments} GcsDocuments instance - */ - GcsDocuments.create = function create(properties) { - return new GcsDocuments(properties); - }; - - /** - * Encodes the specified GcsDocuments message. Does not implicitly {@link google.cloud.documentai.v1.GcsDocuments.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.GcsDocuments - * @static - * @param {google.cloud.documentai.v1.IGcsDocuments} message GcsDocuments message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDocuments.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) - $root.google.cloud.documentai.v1.GcsDocument.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GcsDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GcsDocuments.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.GcsDocuments - * @static - * @param {google.cloud.documentai.v1.IGcsDocuments} message GcsDocuments message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDocuments.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsDocuments message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.GcsDocuments - * @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.GcsDocuments} GcsDocuments - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDocuments.decode = function decode(reader, 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.GcsDocuments(); - 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($root.google.cloud.documentai.v1.GcsDocument.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsDocuments message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.GcsDocuments - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.GcsDocuments} GcsDocuments - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDocuments.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsDocuments message. - * @function verify - * @memberof google.cloud.documentai.v1.GcsDocuments - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsDocuments.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) { - var error = $root.google.cloud.documentai.v1.GcsDocument.verify(message.documents[i]); - if (error) - return "documents." + error; - } - } - return null; - }; - - /** - * Creates a GcsDocuments message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.GcsDocuments - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.GcsDocuments} GcsDocuments - */ - GcsDocuments.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.GcsDocuments) - return object; - var message = new $root.google.cloud.documentai.v1.GcsDocuments(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".google.cloud.documentai.v1.GcsDocuments.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) { - if (typeof object.documents[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.GcsDocuments.documents: object expected"); - message.documents[i] = $root.google.cloud.documentai.v1.GcsDocument.fromObject(object.documents[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GcsDocuments message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.GcsDocuments - * @static - * @param {google.cloud.documentai.v1.GcsDocuments} message GcsDocuments - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsDocuments.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = $root.google.cloud.documentai.v1.GcsDocument.toObject(message.documents[j], options); - } - return object; - }; - - /** - * Converts this GcsDocuments to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.GcsDocuments - * @instance - * @returns {Object.} JSON object - */ - GcsDocuments.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsDocuments - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.GcsDocuments - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsDocuments.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.GcsDocuments"; - }; - - return GcsDocuments; - })(); - - v1.GcsPrefix = (function() { - - /** - * Properties of a GcsPrefix. - * @memberof google.cloud.documentai.v1 - * @interface IGcsPrefix - * @property {string|null} [gcsUriPrefix] GcsPrefix gcsUriPrefix - */ - - /** - * Constructs a new GcsPrefix. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a GcsPrefix. - * @implements IGcsPrefix - * @constructor - * @param {google.cloud.documentai.v1.IGcsPrefix=} [properties] Properties to set - */ - function GcsPrefix(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GcsPrefix gcsUriPrefix. - * @member {string} gcsUriPrefix - * @memberof google.cloud.documentai.v1.GcsPrefix - * @instance - */ - GcsPrefix.prototype.gcsUriPrefix = ""; - - /** - * Creates a new GcsPrefix instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.GcsPrefix - * @static - * @param {google.cloud.documentai.v1.IGcsPrefix=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.GcsPrefix} GcsPrefix instance - */ - GcsPrefix.create = function create(properties) { - return new GcsPrefix(properties); - }; - - /** - * Encodes the specified GcsPrefix message. Does not implicitly {@link google.cloud.documentai.v1.GcsPrefix.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.GcsPrefix - * @static - * @param {google.cloud.documentai.v1.IGcsPrefix} message GcsPrefix message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsPrefix.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsUriPrefix != null && Object.hasOwnProperty.call(message, "gcsUriPrefix")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUriPrefix); - return writer; - }; - - /** - * Encodes the specified GcsPrefix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GcsPrefix.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.GcsPrefix - * @static - * @param {google.cloud.documentai.v1.IGcsPrefix} message GcsPrefix message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsPrefix.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsPrefix message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.GcsPrefix - * @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.GcsPrefix} GcsPrefix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsPrefix.decode = function decode(reader, 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.GcsPrefix(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsUriPrefix = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsPrefix message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.GcsPrefix - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.GcsPrefix} GcsPrefix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsPrefix.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsPrefix message. - * @function verify - * @memberof google.cloud.documentai.v1.GcsPrefix - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsPrefix.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsUriPrefix != null && message.hasOwnProperty("gcsUriPrefix")) - if (!$util.isString(message.gcsUriPrefix)) - return "gcsUriPrefix: string expected"; - return null; - }; - - /** - * Creates a GcsPrefix message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.GcsPrefix - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.GcsPrefix} GcsPrefix - */ - GcsPrefix.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.GcsPrefix) - return object; - var message = new $root.google.cloud.documentai.v1.GcsPrefix(); - if (object.gcsUriPrefix != null) - message.gcsUriPrefix = String(object.gcsUriPrefix); - return message; - }; - - /** - * Creates a plain object from a GcsPrefix message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.GcsPrefix - * @static - * @param {google.cloud.documentai.v1.GcsPrefix} message GcsPrefix - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsPrefix.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.gcsUriPrefix = ""; - if (message.gcsUriPrefix != null && message.hasOwnProperty("gcsUriPrefix")) - object.gcsUriPrefix = message.gcsUriPrefix; - return object; - }; - - /** - * Converts this GcsPrefix to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.GcsPrefix - * @instance - * @returns {Object.} JSON object - */ - GcsPrefix.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsPrefix - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.GcsPrefix - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsPrefix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.GcsPrefix"; - }; - - return GcsPrefix; - })(); - - v1.BatchDocumentsInputConfig = (function() { - - /** - * Properties of a BatchDocumentsInputConfig. - * @memberof google.cloud.documentai.v1 - * @interface IBatchDocumentsInputConfig - * @property {google.cloud.documentai.v1.IGcsPrefix|null} [gcsPrefix] BatchDocumentsInputConfig gcsPrefix - * @property {google.cloud.documentai.v1.IGcsDocuments|null} [gcsDocuments] BatchDocumentsInputConfig gcsDocuments - */ - - /** - * Constructs a new BatchDocumentsInputConfig. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a BatchDocumentsInputConfig. - * @implements IBatchDocumentsInputConfig - * @constructor - * @param {google.cloud.documentai.v1.IBatchDocumentsInputConfig=} [properties] Properties to set - */ - function BatchDocumentsInputConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDocumentsInputConfig gcsPrefix. - * @member {google.cloud.documentai.v1.IGcsPrefix|null|undefined} gcsPrefix - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @instance - */ - BatchDocumentsInputConfig.prototype.gcsPrefix = null; - - /** - * BatchDocumentsInputConfig gcsDocuments. - * @member {google.cloud.documentai.v1.IGcsDocuments|null|undefined} gcsDocuments - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @instance - */ - BatchDocumentsInputConfig.prototype.gcsDocuments = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BatchDocumentsInputConfig source. - * @member {"gcsPrefix"|"gcsDocuments"|undefined} source - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @instance - */ - Object.defineProperty(BatchDocumentsInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["gcsPrefix", "gcsDocuments"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BatchDocumentsInputConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @static - * @param {google.cloud.documentai.v1.IBatchDocumentsInputConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.BatchDocumentsInputConfig} BatchDocumentsInputConfig instance - */ - BatchDocumentsInputConfig.create = function create(properties) { - return new BatchDocumentsInputConfig(properties); - }; - - /** - * Encodes the specified BatchDocumentsInputConfig message. Does not implicitly {@link google.cloud.documentai.v1.BatchDocumentsInputConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @static - * @param {google.cloud.documentai.v1.IBatchDocumentsInputConfig} message BatchDocumentsInputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDocumentsInputConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) - $root.google.cloud.documentai.v1.GcsPrefix.encode(message.gcsPrefix, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.gcsDocuments != null && Object.hasOwnProperty.call(message, "gcsDocuments")) - $root.google.cloud.documentai.v1.GcsDocuments.encode(message.gcsDocuments, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchDocumentsInputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchDocumentsInputConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @static - * @param {google.cloud.documentai.v1.IBatchDocumentsInputConfig} message BatchDocumentsInputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDocumentsInputConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @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.BatchDocumentsInputConfig} BatchDocumentsInputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDocumentsInputConfig.decode = function decode(reader, 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.BatchDocumentsInputConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsPrefix = $root.google.cloud.documentai.v1.GcsPrefix.decode(reader, reader.uint32()); - break; - } - case 2: { - message.gcsDocuments = $root.google.cloud.documentai.v1.GcsDocuments.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.BatchDocumentsInputConfig} BatchDocumentsInputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDocumentsInputConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchDocumentsInputConfig message. - * @function verify - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDocumentsInputConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1.GcsPrefix.verify(message.gcsPrefix); - if (error) - return "gcsPrefix." + error; - } - } - if (message.gcsDocuments != null && message.hasOwnProperty("gcsDocuments")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1.GcsDocuments.verify(message.gcsDocuments); - if (error) - return "gcsDocuments." + error; - } - } - return null; - }; - - /** - * Creates a BatchDocumentsInputConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.BatchDocumentsInputConfig} BatchDocumentsInputConfig - */ - BatchDocumentsInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.BatchDocumentsInputConfig) - return object; - var message = new $root.google.cloud.documentai.v1.BatchDocumentsInputConfig(); - if (object.gcsPrefix != null) { - if (typeof object.gcsPrefix !== "object") - throw TypeError(".google.cloud.documentai.v1.BatchDocumentsInputConfig.gcsPrefix: object expected"); - message.gcsPrefix = $root.google.cloud.documentai.v1.GcsPrefix.fromObject(object.gcsPrefix); - } - if (object.gcsDocuments != null) { - if (typeof object.gcsDocuments !== "object") - throw TypeError(".google.cloud.documentai.v1.BatchDocumentsInputConfig.gcsDocuments: object expected"); - message.gcsDocuments = $root.google.cloud.documentai.v1.GcsDocuments.fromObject(object.gcsDocuments); - } - return message; - }; - - /** - * Creates a plain object from a BatchDocumentsInputConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @static - * @param {google.cloud.documentai.v1.BatchDocumentsInputConfig} message BatchDocumentsInputConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDocumentsInputConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - object.gcsPrefix = $root.google.cloud.documentai.v1.GcsPrefix.toObject(message.gcsPrefix, options); - if (options.oneofs) - object.source = "gcsPrefix"; - } - if (message.gcsDocuments != null && message.hasOwnProperty("gcsDocuments")) { - object.gcsDocuments = $root.google.cloud.documentai.v1.GcsDocuments.toObject(message.gcsDocuments, options); - if (options.oneofs) - object.source = "gcsDocuments"; - } - return object; - }; - - /** - * Converts this BatchDocumentsInputConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @instance - * @returns {Object.} JSON object - */ - BatchDocumentsInputConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchDocumentsInputConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.BatchDocumentsInputConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchDocumentsInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.BatchDocumentsInputConfig"; - }; - - return BatchDocumentsInputConfig; - })(); - - v1.DocumentOutputConfig = (function() { - - /** - * Properties of a DocumentOutputConfig. - * @memberof google.cloud.documentai.v1 - * @interface IDocumentOutputConfig - * @property {google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig|null} [gcsOutputConfig] DocumentOutputConfig gcsOutputConfig - */ - - /** - * Constructs a new DocumentOutputConfig. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DocumentOutputConfig. - * @implements IDocumentOutputConfig - * @constructor - * @param {google.cloud.documentai.v1.IDocumentOutputConfig=} [properties] Properties to set - */ - function DocumentOutputConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DocumentOutputConfig gcsOutputConfig. - * @member {google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig|null|undefined} gcsOutputConfig - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @instance - */ - DocumentOutputConfig.prototype.gcsOutputConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DocumentOutputConfig destination. - * @member {"gcsOutputConfig"|undefined} destination - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @instance - */ - Object.defineProperty(DocumentOutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsOutputConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DocumentOutputConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @static - * @param {google.cloud.documentai.v1.IDocumentOutputConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DocumentOutputConfig} DocumentOutputConfig instance - */ - DocumentOutputConfig.create = function create(properties) { - return new DocumentOutputConfig(properties); - }; - - /** - * Encodes the specified DocumentOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @static - * @param {google.cloud.documentai.v1.IDocumentOutputConfig} message DocumentOutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentOutputConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsOutputConfig != null && Object.hasOwnProperty.call(message, "gcsOutputConfig")) - $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.encode(message.gcsOutputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @static - * @param {google.cloud.documentai.v1.IDocumentOutputConfig} message DocumentOutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentOutputConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @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.DocumentOutputConfig} DocumentOutputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentOutputConfig.decode = function decode(reader, 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.DocumentOutputConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsOutputConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentOutputConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DocumentOutputConfig} DocumentOutputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentOutputConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentOutputConfig message. - * @function verify - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentOutputConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsOutputConfig != null && message.hasOwnProperty("gcsOutputConfig")) { - properties.destination = 1; - { - var error = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.verify(message.gcsOutputConfig); - if (error) - return "gcsOutputConfig." + error; - } - } - return null; - }; - - /** - * Creates a DocumentOutputConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DocumentOutputConfig} DocumentOutputConfig - */ - DocumentOutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DocumentOutputConfig) - return object; - var message = new $root.google.cloud.documentai.v1.DocumentOutputConfig(); - if (object.gcsOutputConfig != null) { - if (typeof object.gcsOutputConfig !== "object") - throw TypeError(".google.cloud.documentai.v1.DocumentOutputConfig.gcsOutputConfig: object expected"); - message.gcsOutputConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.fromObject(object.gcsOutputConfig); - } - return message; - }; - - /** - * Creates a plain object from a DocumentOutputConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @static - * @param {google.cloud.documentai.v1.DocumentOutputConfig} message DocumentOutputConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentOutputConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.gcsOutputConfig != null && message.hasOwnProperty("gcsOutputConfig")) { - object.gcsOutputConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.toObject(message.gcsOutputConfig, options); - if (options.oneofs) - object.destination = "gcsOutputConfig"; - } - return object; - }; - - /** - * Converts this DocumentOutputConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @instance - * @returns {Object.} JSON object - */ - DocumentOutputConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentOutputConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DocumentOutputConfig"; - }; - - DocumentOutputConfig.GcsOutputConfig = (function() { - - /** - * Properties of a GcsOutputConfig. - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @interface IGcsOutputConfig - * @property {string|null} [gcsUri] GcsOutputConfig gcsUri - * @property {google.protobuf.IFieldMask|null} [fieldMask] GcsOutputConfig fieldMask - * @property {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null} [shardingConfig] GcsOutputConfig shardingConfig - */ - - /** - * Constructs a new GcsOutputConfig. - * @memberof google.cloud.documentai.v1.DocumentOutputConfig - * @classdesc Represents a GcsOutputConfig. - * @implements IGcsOutputConfig - * @constructor - * @param {google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig=} [properties] Properties to set - */ - function GcsOutputConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GcsOutputConfig gcsUri. - * @member {string} gcsUri - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @instance - */ - GcsOutputConfig.prototype.gcsUri = ""; - - /** - * GcsOutputConfig fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @instance - */ - GcsOutputConfig.prototype.fieldMask = null; - - /** - * GcsOutputConfig shardingConfig. - * @member {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null|undefined} shardingConfig - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @instance - */ - GcsOutputConfig.prototype.shardingConfig = null; - - /** - * Creates a new GcsOutputConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig instance - */ - GcsOutputConfig.create = function create(properties) { - return new GcsOutputConfig(properties); - }; - - /** - * Encodes the specified GcsOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig} message GcsOutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsOutputConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); - if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.shardingConfig != null && Object.hasOwnProperty.call(message, "shardingConfig")) - $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.encode(message.shardingConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GcsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {google.cloud.documentai.v1.DocumentOutputConfig.IGcsOutputConfig} message GcsOutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsOutputConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @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.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsOutputConfig.decode = function decode(reader, 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.DocumentOutputConfig.GcsOutputConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsUri = reader.string(); - break; - } - case 2: { - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.shardingConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsOutputConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsOutputConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsOutputConfig message. - * @function verify - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsOutputConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); - if (error) - return "fieldMask." + error; - } - if (message.shardingConfig != null && message.hasOwnProperty("shardingConfig")) { - var error = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify(message.shardingConfig); - if (error) - return "shardingConfig." + error; - } - return null; - }; - - /** - * Creates a GcsOutputConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig - */ - GcsOutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig) - return object; - var message = new $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig(); - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); - } - if (object.shardingConfig != null) { - if (typeof object.shardingConfig !== "object") - throw TypeError(".google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.shardingConfig: object expected"); - message.shardingConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.fromObject(object.shardingConfig); - } - return message; - }; - - /** - * Creates a plain object from a GcsOutputConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig} message GcsOutputConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsOutputConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcsUri = ""; - object.fieldMask = null; - object.shardingConfig = null; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - object.gcsUri = message.gcsUri; - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - if (message.shardingConfig != null && message.hasOwnProperty("shardingConfig")) - object.shardingConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.toObject(message.shardingConfig, options); - return object; - }; - - /** - * Converts this GcsOutputConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @instance - * @returns {Object.} JSON object - */ - GcsOutputConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsOutputConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig"; - }; - - GcsOutputConfig.ShardingConfig = (function() { - - /** - * Properties of a ShardingConfig. - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @interface IShardingConfig - * @property {number|null} [pagesPerShard] ShardingConfig pagesPerShard - * @property {number|null} [pagesOverlap] ShardingConfig pagesOverlap - */ - - /** - * Constructs a new ShardingConfig. - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig - * @classdesc Represents a ShardingConfig. - * @implements IShardingConfig - * @constructor - * @param {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig=} [properties] Properties to set - */ - function ShardingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ShardingConfig pagesPerShard. - * @member {number} pagesPerShard - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @instance - */ - ShardingConfig.prototype.pagesPerShard = 0; - - /** - * ShardingConfig pagesOverlap. - * @member {number} pagesOverlap - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @instance - */ - ShardingConfig.prototype.pagesOverlap = 0; - - /** - * Creates a new ShardingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig instance - */ - ShardingConfig.create = function create(properties) { - return new ShardingConfig(properties); - }; - - /** - * Encodes the specified ShardingConfig message. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig} message ShardingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShardingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagesPerShard != null && Object.hasOwnProperty.call(message, "pagesPerShard")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pagesPerShard); - if (message.pagesOverlap != null && Object.hasOwnProperty.call(message, "pagesOverlap")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pagesOverlap); - return writer; - }; - - /** - * Encodes the specified ShardingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.IShardingConfig} message ShardingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShardingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ShardingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @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.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShardingConfig.decode = function decode(reader, 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.DocumentOutputConfig.GcsOutputConfig.ShardingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pagesPerShard = reader.int32(); - break; - } - case 2: { - message.pagesOverlap = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ShardingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShardingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ShardingConfig message. - * @function verify - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ShardingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagesPerShard != null && message.hasOwnProperty("pagesPerShard")) - if (!$util.isInteger(message.pagesPerShard)) - return "pagesPerShard: integer expected"; - if (message.pagesOverlap != null && message.hasOwnProperty("pagesOverlap")) - if (!$util.isInteger(message.pagesOverlap)) - return "pagesOverlap: integer expected"; - return null; - }; - - /** - * Creates a ShardingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig - */ - ShardingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig) - return object; - var message = new $root.google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig(); - if (object.pagesPerShard != null) - message.pagesPerShard = object.pagesPerShard | 0; - if (object.pagesOverlap != null) - message.pagesOverlap = object.pagesOverlap | 0; - return message; - }; - - /** - * Creates a plain object from a ShardingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} message ShardingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ShardingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pagesPerShard = 0; - object.pagesOverlap = 0; - } - if (message.pagesPerShard != null && message.hasOwnProperty("pagesPerShard")) - object.pagesPerShard = message.pagesPerShard; - if (message.pagesOverlap != null && message.hasOwnProperty("pagesOverlap")) - object.pagesOverlap = message.pagesOverlap; - return object; - }; - - /** - * Converts this ShardingConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @instance - * @returns {Object.} JSON object - */ - ShardingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ShardingConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ShardingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig.ShardingConfig"; - }; - - return ShardingConfig; - })(); - - return GcsOutputConfig; - })(); - - return DocumentOutputConfig; - })(); - - v1.OcrConfig = (function() { - - /** - * Properties of an OcrConfig. - * @memberof google.cloud.documentai.v1 - * @interface IOcrConfig - * @property {google.cloud.documentai.v1.OcrConfig.IHints|null} [hints] OcrConfig hints - * @property {boolean|null} [enableNativePdfParsing] OcrConfig enableNativePdfParsing - * @property {boolean|null} [enableImageQualityScores] OcrConfig enableImageQualityScores - * @property {Array.|null} [advancedOcrOptions] OcrConfig advancedOcrOptions - * @property {boolean|null} [enableSymbol] OcrConfig enableSymbol - * @property {boolean|null} [computeStyleInfo] OcrConfig computeStyleInfo - * @property {boolean|null} [disableCharacterBoxesDetection] OcrConfig disableCharacterBoxesDetection - * @property {google.cloud.documentai.v1.OcrConfig.IPremiumFeatures|null} [premiumFeatures] OcrConfig premiumFeatures - */ - - /** - * Constructs a new OcrConfig. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents an OcrConfig. - * @implements IOcrConfig - * @constructor - * @param {google.cloud.documentai.v1.IOcrConfig=} [properties] Properties to set - */ - function OcrConfig(properties) { - this.advancedOcrOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OcrConfig hints. - * @member {google.cloud.documentai.v1.OcrConfig.IHints|null|undefined} hints - * @memberof google.cloud.documentai.v1.OcrConfig - * @instance - */ - OcrConfig.prototype.hints = null; - - /** - * OcrConfig enableNativePdfParsing. - * @member {boolean} enableNativePdfParsing - * @memberof google.cloud.documentai.v1.OcrConfig - * @instance - */ - OcrConfig.prototype.enableNativePdfParsing = false; - - /** - * OcrConfig enableImageQualityScores. - * @member {boolean} enableImageQualityScores - * @memberof google.cloud.documentai.v1.OcrConfig - * @instance - */ - OcrConfig.prototype.enableImageQualityScores = false; - - /** - * OcrConfig advancedOcrOptions. - * @member {Array.} advancedOcrOptions - * @memberof google.cloud.documentai.v1.OcrConfig - * @instance - */ - OcrConfig.prototype.advancedOcrOptions = $util.emptyArray; - - /** - * OcrConfig enableSymbol. - * @member {boolean} enableSymbol - * @memberof google.cloud.documentai.v1.OcrConfig - * @instance - */ - OcrConfig.prototype.enableSymbol = false; - - /** - * OcrConfig computeStyleInfo. - * @member {boolean} computeStyleInfo - * @memberof google.cloud.documentai.v1.OcrConfig - * @instance - */ - OcrConfig.prototype.computeStyleInfo = false; - - /** - * OcrConfig disableCharacterBoxesDetection. - * @member {boolean} disableCharacterBoxesDetection - * @memberof google.cloud.documentai.v1.OcrConfig - * @instance - */ - OcrConfig.prototype.disableCharacterBoxesDetection = false; - - /** - * OcrConfig premiumFeatures. - * @member {google.cloud.documentai.v1.OcrConfig.IPremiumFeatures|null|undefined} premiumFeatures - * @memberof google.cloud.documentai.v1.OcrConfig - * @instance - */ - OcrConfig.prototype.premiumFeatures = null; - - /** - * Creates a new OcrConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.OcrConfig - * @static - * @param {google.cloud.documentai.v1.IOcrConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.OcrConfig} OcrConfig instance - */ - OcrConfig.create = function create(properties) { - return new OcrConfig(properties); - }; - - /** - * Encodes the specified OcrConfig message. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.OcrConfig - * @static - * @param {google.cloud.documentai.v1.IOcrConfig} message OcrConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OcrConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hints != null && Object.hasOwnProperty.call(message, "hints")) - $root.google.cloud.documentai.v1.OcrConfig.Hints.encode(message.hints, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.enableNativePdfParsing != null && Object.hasOwnProperty.call(message, "enableNativePdfParsing")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableNativePdfParsing); - if (message.enableImageQualityScores != null && Object.hasOwnProperty.call(message, "enableImageQualityScores")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableImageQualityScores); - if (message.advancedOcrOptions != null && message.advancedOcrOptions.length) - for (var i = 0; i < message.advancedOcrOptions.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.advancedOcrOptions[i]); - if (message.enableSymbol != null && Object.hasOwnProperty.call(message, "enableSymbol")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableSymbol); - if (message.computeStyleInfo != null && Object.hasOwnProperty.call(message, "computeStyleInfo")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.computeStyleInfo); - if (message.disableCharacterBoxesDetection != null && Object.hasOwnProperty.call(message, "disableCharacterBoxesDetection")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.disableCharacterBoxesDetection); - if (message.premiumFeatures != null && Object.hasOwnProperty.call(message, "premiumFeatures")) - $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures.encode(message.premiumFeatures, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OcrConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.OcrConfig - * @static - * @param {google.cloud.documentai.v1.IOcrConfig} message OcrConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OcrConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OcrConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.OcrConfig - * @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.OcrConfig} OcrConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OcrConfig.decode = function decode(reader, 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.OcrConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.hints = $root.google.cloud.documentai.v1.OcrConfig.Hints.decode(reader, reader.uint32()); - break; - } - case 3: { - message.enableNativePdfParsing = reader.bool(); - break; - } - case 4: { - message.enableImageQualityScores = reader.bool(); - break; - } - case 5: { - if (!(message.advancedOcrOptions && message.advancedOcrOptions.length)) - message.advancedOcrOptions = []; - message.advancedOcrOptions.push(reader.string()); - break; - } - case 6: { - message.enableSymbol = reader.bool(); - break; - } - case 8: { - message.computeStyleInfo = reader.bool(); - break; - } - case 10: { - message.disableCharacterBoxesDetection = reader.bool(); - break; - } - case 11: { - message.premiumFeatures = $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OcrConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.OcrConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.OcrConfig} OcrConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OcrConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OcrConfig message. - * @function verify - * @memberof google.cloud.documentai.v1.OcrConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OcrConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hints != null && message.hasOwnProperty("hints")) { - var error = $root.google.cloud.documentai.v1.OcrConfig.Hints.verify(message.hints); - if (error) - return "hints." + error; - } - if (message.enableNativePdfParsing != null && message.hasOwnProperty("enableNativePdfParsing")) - if (typeof message.enableNativePdfParsing !== "boolean") - return "enableNativePdfParsing: boolean expected"; - if (message.enableImageQualityScores != null && message.hasOwnProperty("enableImageQualityScores")) - if (typeof message.enableImageQualityScores !== "boolean") - return "enableImageQualityScores: boolean expected"; - if (message.advancedOcrOptions != null && message.hasOwnProperty("advancedOcrOptions")) { - if (!Array.isArray(message.advancedOcrOptions)) - return "advancedOcrOptions: array expected"; - for (var i = 0; i < message.advancedOcrOptions.length; ++i) - if (!$util.isString(message.advancedOcrOptions[i])) - return "advancedOcrOptions: string[] expected"; - } - if (message.enableSymbol != null && message.hasOwnProperty("enableSymbol")) - if (typeof message.enableSymbol !== "boolean") - return "enableSymbol: boolean expected"; - if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) - if (typeof message.computeStyleInfo !== "boolean") - return "computeStyleInfo: boolean expected"; - if (message.disableCharacterBoxesDetection != null && message.hasOwnProperty("disableCharacterBoxesDetection")) - if (typeof message.disableCharacterBoxesDetection !== "boolean") - return "disableCharacterBoxesDetection: boolean expected"; - if (message.premiumFeatures != null && message.hasOwnProperty("premiumFeatures")) { - var error = $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures.verify(message.premiumFeatures); - if (error) - return "premiumFeatures." + error; - } - return null; - }; - - /** - * Creates an OcrConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.OcrConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.OcrConfig} OcrConfig - */ - OcrConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.OcrConfig) - return object; - var message = new $root.google.cloud.documentai.v1.OcrConfig(); - if (object.hints != null) { - if (typeof object.hints !== "object") - throw TypeError(".google.cloud.documentai.v1.OcrConfig.hints: object expected"); - message.hints = $root.google.cloud.documentai.v1.OcrConfig.Hints.fromObject(object.hints); - } - if (object.enableNativePdfParsing != null) - message.enableNativePdfParsing = Boolean(object.enableNativePdfParsing); - if (object.enableImageQualityScores != null) - message.enableImageQualityScores = Boolean(object.enableImageQualityScores); - if (object.advancedOcrOptions) { - if (!Array.isArray(object.advancedOcrOptions)) - throw TypeError(".google.cloud.documentai.v1.OcrConfig.advancedOcrOptions: array expected"); - message.advancedOcrOptions = []; - for (var i = 0; i < object.advancedOcrOptions.length; ++i) - message.advancedOcrOptions[i] = String(object.advancedOcrOptions[i]); - } - if (object.enableSymbol != null) - message.enableSymbol = Boolean(object.enableSymbol); - if (object.computeStyleInfo != null) - message.computeStyleInfo = Boolean(object.computeStyleInfo); - if (object.disableCharacterBoxesDetection != null) - message.disableCharacterBoxesDetection = Boolean(object.disableCharacterBoxesDetection); - if (object.premiumFeatures != null) { - if (typeof object.premiumFeatures !== "object") - throw TypeError(".google.cloud.documentai.v1.OcrConfig.premiumFeatures: object expected"); - message.premiumFeatures = $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures.fromObject(object.premiumFeatures); - } - return message; - }; - - /** - * Creates a plain object from an OcrConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.OcrConfig - * @static - * @param {google.cloud.documentai.v1.OcrConfig} message OcrConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OcrConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.advancedOcrOptions = []; - if (options.defaults) { - object.hints = null; - object.enableNativePdfParsing = false; - object.enableImageQualityScores = false; - object.enableSymbol = false; - object.computeStyleInfo = false; - object.disableCharacterBoxesDetection = false; - object.premiumFeatures = null; - } - if (message.hints != null && message.hasOwnProperty("hints")) - object.hints = $root.google.cloud.documentai.v1.OcrConfig.Hints.toObject(message.hints, options); - if (message.enableNativePdfParsing != null && message.hasOwnProperty("enableNativePdfParsing")) - object.enableNativePdfParsing = message.enableNativePdfParsing; - if (message.enableImageQualityScores != null && message.hasOwnProperty("enableImageQualityScores")) - object.enableImageQualityScores = message.enableImageQualityScores; - if (message.advancedOcrOptions && message.advancedOcrOptions.length) { - object.advancedOcrOptions = []; - for (var j = 0; j < message.advancedOcrOptions.length; ++j) - object.advancedOcrOptions[j] = message.advancedOcrOptions[j]; - } - if (message.enableSymbol != null && message.hasOwnProperty("enableSymbol")) - object.enableSymbol = message.enableSymbol; - if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) - object.computeStyleInfo = message.computeStyleInfo; - if (message.disableCharacterBoxesDetection != null && message.hasOwnProperty("disableCharacterBoxesDetection")) - object.disableCharacterBoxesDetection = message.disableCharacterBoxesDetection; - if (message.premiumFeatures != null && message.hasOwnProperty("premiumFeatures")) - object.premiumFeatures = $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures.toObject(message.premiumFeatures, options); - return object; - }; - - /** - * Converts this OcrConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.OcrConfig - * @instance - * @returns {Object.} JSON object - */ - OcrConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OcrConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.OcrConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OcrConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.OcrConfig"; - }; - - OcrConfig.Hints = (function() { - - /** - * Properties of a Hints. - * @memberof google.cloud.documentai.v1.OcrConfig - * @interface IHints - * @property {Array.|null} [languageHints] Hints languageHints - */ - - /** - * Constructs a new Hints. - * @memberof google.cloud.documentai.v1.OcrConfig - * @classdesc Represents a Hints. - * @implements IHints - * @constructor - * @param {google.cloud.documentai.v1.OcrConfig.IHints=} [properties] Properties to set - */ - function Hints(properties) { - this.languageHints = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Hints languageHints. - * @member {Array.} languageHints - * @memberof google.cloud.documentai.v1.OcrConfig.Hints - * @instance - */ - Hints.prototype.languageHints = $util.emptyArray; - - /** - * Creates a new Hints instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.OcrConfig.Hints - * @static - * @param {google.cloud.documentai.v1.OcrConfig.IHints=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.OcrConfig.Hints} Hints instance - */ - Hints.create = function create(properties) { - return new Hints(properties); - }; - - /** - * Encodes the specified Hints message. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.Hints.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.OcrConfig.Hints - * @static - * @param {google.cloud.documentai.v1.OcrConfig.IHints} message Hints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Hints.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.languageHints != null && message.languageHints.length) - for (var i = 0; i < message.languageHints.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageHints[i]); - return writer; - }; - - /** - * Encodes the specified Hints message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.Hints.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.OcrConfig.Hints - * @static - * @param {google.cloud.documentai.v1.OcrConfig.IHints} message Hints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Hints.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Hints message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.OcrConfig.Hints - * @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.OcrConfig.Hints} Hints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Hints.decode = function decode(reader, 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.OcrConfig.Hints(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.languageHints && message.languageHints.length)) - message.languageHints = []; - message.languageHints.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Hints message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.OcrConfig.Hints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.OcrConfig.Hints} Hints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Hints.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Hints message. - * @function verify - * @memberof google.cloud.documentai.v1.OcrConfig.Hints - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Hints.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.languageHints != null && message.hasOwnProperty("languageHints")) { - if (!Array.isArray(message.languageHints)) - return "languageHints: array expected"; - for (var i = 0; i < message.languageHints.length; ++i) - if (!$util.isString(message.languageHints[i])) - return "languageHints: string[] expected"; - } - return null; - }; - - /** - * Creates a Hints message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.OcrConfig.Hints - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.OcrConfig.Hints} Hints - */ - Hints.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.OcrConfig.Hints) - return object; - var message = new $root.google.cloud.documentai.v1.OcrConfig.Hints(); - if (object.languageHints) { - if (!Array.isArray(object.languageHints)) - throw TypeError(".google.cloud.documentai.v1.OcrConfig.Hints.languageHints: array expected"); - message.languageHints = []; - for (var i = 0; i < object.languageHints.length; ++i) - message.languageHints[i] = String(object.languageHints[i]); - } - return message; - }; - - /** - * Creates a plain object from a Hints message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.OcrConfig.Hints - * @static - * @param {google.cloud.documentai.v1.OcrConfig.Hints} message Hints - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Hints.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.languageHints = []; - if (message.languageHints && message.languageHints.length) { - object.languageHints = []; - for (var j = 0; j < message.languageHints.length; ++j) - object.languageHints[j] = message.languageHints[j]; - } - return object; - }; - - /** - * Converts this Hints to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.OcrConfig.Hints - * @instance - * @returns {Object.} JSON object - */ - Hints.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Hints - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.OcrConfig.Hints - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Hints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.OcrConfig.Hints"; - }; - - return Hints; - })(); - - OcrConfig.PremiumFeatures = (function() { - - /** - * Properties of a PremiumFeatures. - * @memberof google.cloud.documentai.v1.OcrConfig - * @interface IPremiumFeatures - * @property {boolean|null} [enableSelectionMarkDetection] PremiumFeatures enableSelectionMarkDetection - * @property {boolean|null} [computeStyleInfo] PremiumFeatures computeStyleInfo - * @property {boolean|null} [enableMathOcr] PremiumFeatures enableMathOcr - */ - - /** - * Constructs a new PremiumFeatures. - * @memberof google.cloud.documentai.v1.OcrConfig - * @classdesc Represents a PremiumFeatures. - * @implements IPremiumFeatures - * @constructor - * @param {google.cloud.documentai.v1.OcrConfig.IPremiumFeatures=} [properties] Properties to set - */ - function PremiumFeatures(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PremiumFeatures enableSelectionMarkDetection. - * @member {boolean} enableSelectionMarkDetection - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @instance - */ - PremiumFeatures.prototype.enableSelectionMarkDetection = false; - - /** - * PremiumFeatures computeStyleInfo. - * @member {boolean} computeStyleInfo - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @instance - */ - PremiumFeatures.prototype.computeStyleInfo = false; - - /** - * PremiumFeatures enableMathOcr. - * @member {boolean} enableMathOcr - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @instance - */ - PremiumFeatures.prototype.enableMathOcr = false; - - /** - * Creates a new PremiumFeatures instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @static - * @param {google.cloud.documentai.v1.OcrConfig.IPremiumFeatures=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.OcrConfig.PremiumFeatures} PremiumFeatures instance - */ - PremiumFeatures.create = function create(properties) { - return new PremiumFeatures(properties); - }; - - /** - * Encodes the specified PremiumFeatures message. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.PremiumFeatures.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @static - * @param {google.cloud.documentai.v1.OcrConfig.IPremiumFeatures} message PremiumFeatures message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PremiumFeatures.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableSelectionMarkDetection != null && Object.hasOwnProperty.call(message, "enableSelectionMarkDetection")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableSelectionMarkDetection); - if (message.computeStyleInfo != null && Object.hasOwnProperty.call(message, "computeStyleInfo")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.computeStyleInfo); - if (message.enableMathOcr != null && Object.hasOwnProperty.call(message, "enableMathOcr")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableMathOcr); - return writer; - }; - - /** - * Encodes the specified PremiumFeatures message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.OcrConfig.PremiumFeatures.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @static - * @param {google.cloud.documentai.v1.OcrConfig.IPremiumFeatures} message PremiumFeatures message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PremiumFeatures.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PremiumFeatures message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @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.OcrConfig.PremiumFeatures} PremiumFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PremiumFeatures.decode = function decode(reader, 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.OcrConfig.PremiumFeatures(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.enableSelectionMarkDetection = reader.bool(); - break; - } - case 4: { - message.computeStyleInfo = reader.bool(); - break; - } - case 5: { - message.enableMathOcr = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PremiumFeatures message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.OcrConfig.PremiumFeatures} PremiumFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PremiumFeatures.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PremiumFeatures message. - * @function verify - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PremiumFeatures.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enableSelectionMarkDetection != null && message.hasOwnProperty("enableSelectionMarkDetection")) - if (typeof message.enableSelectionMarkDetection !== "boolean") - return "enableSelectionMarkDetection: boolean expected"; - if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) - if (typeof message.computeStyleInfo !== "boolean") - return "computeStyleInfo: boolean expected"; - if (message.enableMathOcr != null && message.hasOwnProperty("enableMathOcr")) - if (typeof message.enableMathOcr !== "boolean") - return "enableMathOcr: boolean expected"; - return null; - }; - - /** - * Creates a PremiumFeatures message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.OcrConfig.PremiumFeatures} PremiumFeatures - */ - PremiumFeatures.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures) - return object; - var message = new $root.google.cloud.documentai.v1.OcrConfig.PremiumFeatures(); - if (object.enableSelectionMarkDetection != null) - message.enableSelectionMarkDetection = Boolean(object.enableSelectionMarkDetection); - if (object.computeStyleInfo != null) - message.computeStyleInfo = Boolean(object.computeStyleInfo); - if (object.enableMathOcr != null) - message.enableMathOcr = Boolean(object.enableMathOcr); - return message; - }; - - /** - * Creates a plain object from a PremiumFeatures message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @static - * @param {google.cloud.documentai.v1.OcrConfig.PremiumFeatures} message PremiumFeatures - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PremiumFeatures.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.enableSelectionMarkDetection = false; - object.computeStyleInfo = false; - object.enableMathOcr = false; - } - if (message.enableSelectionMarkDetection != null && message.hasOwnProperty("enableSelectionMarkDetection")) - object.enableSelectionMarkDetection = message.enableSelectionMarkDetection; - if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) - object.computeStyleInfo = message.computeStyleInfo; - if (message.enableMathOcr != null && message.hasOwnProperty("enableMathOcr")) - object.enableMathOcr = message.enableMathOcr; - return object; - }; - - /** - * Converts this PremiumFeatures to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @instance - * @returns {Object.} JSON object - */ - PremiumFeatures.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PremiumFeatures - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.OcrConfig.PremiumFeatures - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PremiumFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.OcrConfig.PremiumFeatures"; - }; - - return PremiumFeatures; - })(); - - return OcrConfig; - })(); - - v1.DocumentProcessorService = (function() { - - /** - * Constructs a new DocumentProcessorService service. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DocumentProcessorService - * @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 DocumentProcessorService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (DocumentProcessorService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DocumentProcessorService; - - /** - * Creates new DocumentProcessorService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @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 {DocumentProcessorService} RPC service. Useful where requests and/or responses are streamed. - */ - DocumentProcessorService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|processDocument}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef ProcessDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1.ProcessResponse} [response] ProcessResponse - */ - - /** - * Calls ProcessDocument. - * @function processDocument - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IProcessRequest} request ProcessRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.ProcessDocumentCallback} callback Node-style callback called with the error, if any, and ProcessResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.processDocument = function processDocument(request, callback) { - return this.rpcCall(processDocument, $root.google.cloud.documentai.v1.ProcessRequest, $root.google.cloud.documentai.v1.ProcessResponse, request, callback); - }, "name", { value: "ProcessDocument" }); - - /** - * Calls ProcessDocument. - * @function processDocument - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IProcessRequest} request ProcessRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|batchProcessDocuments}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef BatchProcessDocumentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchProcessDocuments. - * @function batchProcessDocuments - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IBatchProcessRequest} request BatchProcessRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocumentsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.batchProcessDocuments = function batchProcessDocuments(request, callback) { - return this.rpcCall(batchProcessDocuments, $root.google.cloud.documentai.v1.BatchProcessRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchProcessDocuments" }); - - /** - * Calls BatchProcessDocuments. - * @function batchProcessDocuments - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IBatchProcessRequest} request BatchProcessRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|fetchProcessorTypes}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef FetchProcessorTypesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1.FetchProcessorTypesResponse} [response] FetchProcessorTypesResponse - */ - - /** - * Calls FetchProcessorTypes. - * @function fetchProcessorTypes - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IFetchProcessorTypesRequest} request FetchProcessorTypesRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypesCallback} callback Node-style callback called with the error, if any, and FetchProcessorTypesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.fetchProcessorTypes = function fetchProcessorTypes(request, callback) { - return this.rpcCall(fetchProcessorTypes, $root.google.cloud.documentai.v1.FetchProcessorTypesRequest, $root.google.cloud.documentai.v1.FetchProcessorTypesResponse, request, callback); - }, "name", { value: "FetchProcessorTypes" }); - - /** - * Calls FetchProcessorTypes. - * @function fetchProcessorTypes - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IFetchProcessorTypesRequest} request FetchProcessorTypesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listProcessorTypes}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef ListProcessorTypesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1.ListProcessorTypesResponse} [response] ListProcessorTypesResponse - */ - - /** - * Calls ListProcessorTypes. - * @function listProcessorTypes - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IListProcessorTypesRequest} request ListProcessorTypesRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypesCallback} callback Node-style callback called with the error, if any, and ListProcessorTypesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.listProcessorTypes = function listProcessorTypes(request, callback) { - return this.rpcCall(listProcessorTypes, $root.google.cloud.documentai.v1.ListProcessorTypesRequest, $root.google.cloud.documentai.v1.ListProcessorTypesResponse, request, callback); - }, "name", { value: "ListProcessorTypes" }); - - /** - * Calls ListProcessorTypes. - * @function listProcessorTypes - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IListProcessorTypesRequest} request ListProcessorTypesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getProcessorType}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef GetProcessorTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1.ProcessorType} [response] ProcessorType - */ - - /** - * Calls GetProcessorType. - * @function getProcessorType - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IGetProcessorTypeRequest} request GetProcessorTypeRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.GetProcessorTypeCallback} callback Node-style callback called with the error, if any, and ProcessorType - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.getProcessorType = function getProcessorType(request, callback) { - return this.rpcCall(getProcessorType, $root.google.cloud.documentai.v1.GetProcessorTypeRequest, $root.google.cloud.documentai.v1.ProcessorType, request, callback); - }, "name", { value: "GetProcessorType" }); - - /** - * Calls GetProcessorType. - * @function getProcessorType - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IGetProcessorTypeRequest} request GetProcessorTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listProcessors}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef ListProcessorsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1.ListProcessorsResponse} [response] ListProcessorsResponse - */ - - /** - * Calls ListProcessors. - * @function listProcessors - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IListProcessorsRequest} request ListProcessorsRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.ListProcessorsCallback} callback Node-style callback called with the error, if any, and ListProcessorsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.listProcessors = function listProcessors(request, callback) { - return this.rpcCall(listProcessors, $root.google.cloud.documentai.v1.ListProcessorsRequest, $root.google.cloud.documentai.v1.ListProcessorsResponse, request, callback); - }, "name", { value: "ListProcessors" }); - - /** - * Calls ListProcessors. - * @function listProcessors - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IListProcessorsRequest} request ListProcessorsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getProcessor}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef GetProcessorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1.Processor} [response] Processor - */ - - /** - * Calls GetProcessor. - * @function getProcessor - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IGetProcessorRequest} request GetProcessorRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.GetProcessorCallback} callback Node-style callback called with the error, if any, and Processor - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.getProcessor = function getProcessor(request, callback) { - return this.rpcCall(getProcessor, $root.google.cloud.documentai.v1.GetProcessorRequest, $root.google.cloud.documentai.v1.Processor, request, callback); - }, "name", { value: "GetProcessor" }); - - /** - * Calls GetProcessor. - * @function getProcessor - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IGetProcessorRequest} request GetProcessorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|trainProcessorVersion}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef TrainProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls TrainProcessorVersion. - * @function trainProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.ITrainProcessorVersionRequest} request TrainProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.trainProcessorVersion = function trainProcessorVersion(request, callback) { - return this.rpcCall(trainProcessorVersion, $root.google.cloud.documentai.v1.TrainProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "TrainProcessorVersion" }); - - /** - * Calls TrainProcessorVersion. - * @function trainProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.ITrainProcessorVersionRequest} request TrainProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getProcessorVersion}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef GetProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1.ProcessorVersion} [response] ProcessorVersion - */ - - /** - * Calls GetProcessorVersion. - * @function getProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IGetProcessorVersionRequest} request GetProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersionCallback} callback Node-style callback called with the error, if any, and ProcessorVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.getProcessorVersion = function getProcessorVersion(request, callback) { - return this.rpcCall(getProcessorVersion, $root.google.cloud.documentai.v1.GetProcessorVersionRequest, $root.google.cloud.documentai.v1.ProcessorVersion, request, callback); - }, "name", { value: "GetProcessorVersion" }); - - /** - * Calls GetProcessorVersion. - * @function getProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IGetProcessorVersionRequest} request GetProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listProcessorVersions}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef ListProcessorVersionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1.ListProcessorVersionsResponse} [response] ListProcessorVersionsResponse - */ - - /** - * Calls ListProcessorVersions. - * @function listProcessorVersions - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IListProcessorVersionsRequest} request ListProcessorVersionsRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersionsCallback} callback Node-style callback called with the error, if any, and ListProcessorVersionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.listProcessorVersions = function listProcessorVersions(request, callback) { - return this.rpcCall(listProcessorVersions, $root.google.cloud.documentai.v1.ListProcessorVersionsRequest, $root.google.cloud.documentai.v1.ListProcessorVersionsResponse, request, callback); - }, "name", { value: "ListProcessorVersions" }); - - /** - * Calls ListProcessorVersions. - * @function listProcessorVersions - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IListProcessorVersionsRequest} request ListProcessorVersionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|deleteProcessorVersion}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef DeleteProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteProcessorVersion. - * @function deleteProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IDeleteProcessorVersionRequest} request DeleteProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.deleteProcessorVersion = function deleteProcessorVersion(request, callback) { - return this.rpcCall(deleteProcessorVersion, $root.google.cloud.documentai.v1.DeleteProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteProcessorVersion" }); - - /** - * Calls DeleteProcessorVersion. - * @function deleteProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IDeleteProcessorVersionRequest} request DeleteProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|deployProcessorVersion}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef DeployProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeployProcessorVersion. - * @function deployProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IDeployProcessorVersionRequest} request DeployProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.deployProcessorVersion = function deployProcessorVersion(request, callback) { - return this.rpcCall(deployProcessorVersion, $root.google.cloud.documentai.v1.DeployProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeployProcessorVersion" }); - - /** - * Calls DeployProcessorVersion. - * @function deployProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IDeployProcessorVersionRequest} request DeployProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|undeployProcessorVersion}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef UndeployProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UndeployProcessorVersion. - * @function undeployProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionRequest} request UndeployProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.undeployProcessorVersion = function undeployProcessorVersion(request, callback) { - return this.rpcCall(undeployProcessorVersion, $root.google.cloud.documentai.v1.UndeployProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UndeployProcessorVersion" }); - - /** - * Calls UndeployProcessorVersion. - * @function undeployProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionRequest} request UndeployProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|createProcessor}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef CreateProcessorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1.Processor} [response] Processor - */ - - /** - * Calls CreateProcessor. - * @function createProcessor - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.ICreateProcessorRequest} request CreateProcessorRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.CreateProcessorCallback} callback Node-style callback called with the error, if any, and Processor - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.createProcessor = function createProcessor(request, callback) { - return this.rpcCall(createProcessor, $root.google.cloud.documentai.v1.CreateProcessorRequest, $root.google.cloud.documentai.v1.Processor, request, callback); - }, "name", { value: "CreateProcessor" }); - - /** - * Calls CreateProcessor. - * @function createProcessor - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.ICreateProcessorRequest} request CreateProcessorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|deleteProcessor}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef DeleteProcessorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteProcessor. - * @function deleteProcessor - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IDeleteProcessorRequest} request DeleteProcessorRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.deleteProcessor = function deleteProcessor(request, callback) { - return this.rpcCall(deleteProcessor, $root.google.cloud.documentai.v1.DeleteProcessorRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteProcessor" }); - - /** - * Calls DeleteProcessor. - * @function deleteProcessor - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IDeleteProcessorRequest} request DeleteProcessorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|enableProcessor}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef EnableProcessorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls EnableProcessor. - * @function enableProcessor - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IEnableProcessorRequest} request EnableProcessorRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.EnableProcessorCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.enableProcessor = function enableProcessor(request, callback) { - return this.rpcCall(enableProcessor, $root.google.cloud.documentai.v1.EnableProcessorRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "EnableProcessor" }); - - /** - * Calls EnableProcessor. - * @function enableProcessor - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IEnableProcessorRequest} request EnableProcessorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|disableProcessor}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef DisableProcessorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DisableProcessor. - * @function disableProcessor - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IDisableProcessorRequest} request DisableProcessorRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.DisableProcessorCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.disableProcessor = function disableProcessor(request, callback) { - return this.rpcCall(disableProcessor, $root.google.cloud.documentai.v1.DisableProcessorRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DisableProcessor" }); - - /** - * Calls DisableProcessor. - * @function disableProcessor - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IDisableProcessorRequest} request DisableProcessorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|setDefaultProcessorVersion}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef SetDefaultProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls SetDefaultProcessorVersion. - * @function setDefaultProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest} request SetDefaultProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.setDefaultProcessorVersion = function setDefaultProcessorVersion(request, callback) { - return this.rpcCall(setDefaultProcessorVersion, $root.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "SetDefaultProcessorVersion" }); - - /** - * Calls SetDefaultProcessorVersion. - * @function setDefaultProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest} request SetDefaultProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|reviewDocument}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef ReviewDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ReviewDocument. - * @function reviewDocument - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IReviewDocumentRequest} request ReviewDocumentRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.ReviewDocumentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.reviewDocument = function reviewDocument(request, callback) { - return this.rpcCall(reviewDocument, $root.google.cloud.documentai.v1.ReviewDocumentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ReviewDocument" }); - - /** - * Calls ReviewDocument. - * @function reviewDocument - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IReviewDocumentRequest} request ReviewDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|evaluateProcessorVersion}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef EvaluateProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls EvaluateProcessorVersion. - * @function evaluateProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionRequest} request EvaluateProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.evaluateProcessorVersion = function evaluateProcessorVersion(request, callback) { - return this.rpcCall(evaluateProcessorVersion, $root.google.cloud.documentai.v1.EvaluateProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "EvaluateProcessorVersion" }); - - /** - * Calls EvaluateProcessorVersion. - * @function evaluateProcessorVersion - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionRequest} request EvaluateProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|getEvaluation}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef GetEvaluationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1.Evaluation} [response] Evaluation - */ - - /** - * Calls GetEvaluation. - * @function getEvaluation - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IGetEvaluationRequest} request GetEvaluationRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.GetEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.getEvaluation = function getEvaluation(request, callback) { - return this.rpcCall(getEvaluation, $root.google.cloud.documentai.v1.GetEvaluationRequest, $root.google.cloud.documentai.v1.Evaluation, request, callback); - }, "name", { value: "GetEvaluation" }); - - /** - * Calls GetEvaluation. - * @function getEvaluation - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IGetEvaluationRequest} request GetEvaluationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1.DocumentProcessorService|listEvaluations}. - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @typedef ListEvaluationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1.ListEvaluationsResponse} [response] ListEvaluationsResponse - */ - - /** - * Calls ListEvaluations. - * @function listEvaluations - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object - * @param {google.cloud.documentai.v1.DocumentProcessorService.ListEvaluationsCallback} callback Node-style callback called with the error, if any, and ListEvaluationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.listEvaluations = function listEvaluations(request, callback) { - return this.rpcCall(listEvaluations, $root.google.cloud.documentai.v1.ListEvaluationsRequest, $root.google.cloud.documentai.v1.ListEvaluationsResponse, request, callback); - }, "name", { value: "ListEvaluations" }); - - /** - * Calls ListEvaluations. - * @function listEvaluations - * @memberof google.cloud.documentai.v1.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return DocumentProcessorService; - })(); - - v1.ProcessOptions = (function() { - - /** - * Properties of a ProcessOptions. - * @memberof google.cloud.documentai.v1 - * @interface IProcessOptions - * @property {google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector|null} [individualPageSelector] ProcessOptions individualPageSelector - * @property {number|null} [fromStart] ProcessOptions fromStart - * @property {number|null} [fromEnd] ProcessOptions fromEnd - * @property {google.cloud.documentai.v1.IOcrConfig|null} [ocrConfig] ProcessOptions ocrConfig - * @property {google.cloud.documentai.v1.ProcessOptions.ILayoutConfig|null} [layoutConfig] ProcessOptions layoutConfig - * @property {google.cloud.documentai.v1.IDocumentSchema|null} [schemaOverride] ProcessOptions schemaOverride - */ - - /** - * Constructs a new ProcessOptions. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ProcessOptions. - * @implements IProcessOptions - * @constructor - * @param {google.cloud.documentai.v1.IProcessOptions=} [properties] Properties to set - */ - function ProcessOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProcessOptions individualPageSelector. - * @member {google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector|null|undefined} individualPageSelector - * @memberof google.cloud.documentai.v1.ProcessOptions - * @instance - */ - ProcessOptions.prototype.individualPageSelector = null; - - /** - * ProcessOptions fromStart. - * @member {number|null|undefined} fromStart - * @memberof google.cloud.documentai.v1.ProcessOptions - * @instance - */ - ProcessOptions.prototype.fromStart = null; - - /** - * ProcessOptions fromEnd. - * @member {number|null|undefined} fromEnd - * @memberof google.cloud.documentai.v1.ProcessOptions - * @instance - */ - ProcessOptions.prototype.fromEnd = null; - - /** - * ProcessOptions ocrConfig. - * @member {google.cloud.documentai.v1.IOcrConfig|null|undefined} ocrConfig - * @memberof google.cloud.documentai.v1.ProcessOptions - * @instance - */ - ProcessOptions.prototype.ocrConfig = null; - - /** - * ProcessOptions layoutConfig. - * @member {google.cloud.documentai.v1.ProcessOptions.ILayoutConfig|null|undefined} layoutConfig - * @memberof google.cloud.documentai.v1.ProcessOptions - * @instance - */ - ProcessOptions.prototype.layoutConfig = null; - - /** - * ProcessOptions schemaOverride. - * @member {google.cloud.documentai.v1.IDocumentSchema|null|undefined} schemaOverride - * @memberof google.cloud.documentai.v1.ProcessOptions - * @instance - */ - ProcessOptions.prototype.schemaOverride = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ProcessOptions pageRange. - * @member {"individualPageSelector"|"fromStart"|"fromEnd"|undefined} pageRange - * @memberof google.cloud.documentai.v1.ProcessOptions - * @instance - */ - Object.defineProperty(ProcessOptions.prototype, "pageRange", { - get: $util.oneOfGetter($oneOfFields = ["individualPageSelector", "fromStart", "fromEnd"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ProcessOptions instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessOptions - * @static - * @param {google.cloud.documentai.v1.IProcessOptions=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessOptions} ProcessOptions instance - */ - ProcessOptions.create = function create(properties) { - return new ProcessOptions(properties); - }; - - /** - * Encodes the specified ProcessOptions message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessOptions - * @static - * @param {google.cloud.documentai.v1.IProcessOptions} message ProcessOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ocrConfig != null && Object.hasOwnProperty.call(message, "ocrConfig")) - $root.google.cloud.documentai.v1.OcrConfig.encode(message.ocrConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.individualPageSelector != null && Object.hasOwnProperty.call(message, "individualPageSelector")) - $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.encode(message.individualPageSelector, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.fromStart != null && Object.hasOwnProperty.call(message, "fromStart")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.fromStart); - if (message.fromEnd != null && Object.hasOwnProperty.call(message, "fromEnd")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.fromEnd); - if (message.schemaOverride != null && Object.hasOwnProperty.call(message, "schemaOverride")) - $root.google.cloud.documentai.v1.DocumentSchema.encode(message.schemaOverride, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.layoutConfig != null && Object.hasOwnProperty.call(message, "layoutConfig")) - $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.encode(message.layoutConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ProcessOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessOptions - * @static - * @param {google.cloud.documentai.v1.IProcessOptions} message ProcessOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessOptions - * @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.ProcessOptions} ProcessOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessOptions.decode = function decode(reader, 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.ProcessOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.individualPageSelector = $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.decode(reader, reader.uint32()); - break; - } - case 6: { - message.fromStart = reader.int32(); - break; - } - case 7: { - message.fromEnd = reader.int32(); - break; - } - case 1: { - message.ocrConfig = $root.google.cloud.documentai.v1.OcrConfig.decode(reader, reader.uint32()); - break; - } - case 9: { - message.layoutConfig = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - message.schemaOverride = $root.google.cloud.documentai.v1.DocumentSchema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessOptions} ProcessOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessOptions message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.individualPageSelector != null && message.hasOwnProperty("individualPageSelector")) { - properties.pageRange = 1; - { - var error = $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.verify(message.individualPageSelector); - if (error) - return "individualPageSelector." + error; - } - } - if (message.fromStart != null && message.hasOwnProperty("fromStart")) { - if (properties.pageRange === 1) - return "pageRange: multiple values"; - properties.pageRange = 1; - if (!$util.isInteger(message.fromStart)) - return "fromStart: integer expected"; - } - if (message.fromEnd != null && message.hasOwnProperty("fromEnd")) { - if (properties.pageRange === 1) - return "pageRange: multiple values"; - properties.pageRange = 1; - if (!$util.isInteger(message.fromEnd)) - return "fromEnd: integer expected"; - } - if (message.ocrConfig != null && message.hasOwnProperty("ocrConfig")) { - var error = $root.google.cloud.documentai.v1.OcrConfig.verify(message.ocrConfig); - if (error) - return "ocrConfig." + error; - } - if (message.layoutConfig != null && message.hasOwnProperty("layoutConfig")) { - var error = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.verify(message.layoutConfig); - if (error) - return "layoutConfig." + error; - } - if (message.schemaOverride != null && message.hasOwnProperty("schemaOverride")) { - var error = $root.google.cloud.documentai.v1.DocumentSchema.verify(message.schemaOverride); - if (error) - return "schemaOverride." + error; - } - return null; - }; - - /** - * Creates a ProcessOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessOptions} ProcessOptions - */ - ProcessOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessOptions) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessOptions(); - if (object.individualPageSelector != null) { - if (typeof object.individualPageSelector !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessOptions.individualPageSelector: object expected"); - message.individualPageSelector = $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.fromObject(object.individualPageSelector); - } - if (object.fromStart != null) - message.fromStart = object.fromStart | 0; - if (object.fromEnd != null) - message.fromEnd = object.fromEnd | 0; - if (object.ocrConfig != null) { - if (typeof object.ocrConfig !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessOptions.ocrConfig: object expected"); - message.ocrConfig = $root.google.cloud.documentai.v1.OcrConfig.fromObject(object.ocrConfig); - } - if (object.layoutConfig != null) { - if (typeof object.layoutConfig !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessOptions.layoutConfig: object expected"); - message.layoutConfig = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.fromObject(object.layoutConfig); - } - if (object.schemaOverride != null) { - if (typeof object.schemaOverride !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessOptions.schemaOverride: object expected"); - message.schemaOverride = $root.google.cloud.documentai.v1.DocumentSchema.fromObject(object.schemaOverride); - } - return message; - }; - - /** - * Creates a plain object from a ProcessOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessOptions - * @static - * @param {google.cloud.documentai.v1.ProcessOptions} message ProcessOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ocrConfig = null; - object.schemaOverride = null; - object.layoutConfig = null; - } - if (message.ocrConfig != null && message.hasOwnProperty("ocrConfig")) - object.ocrConfig = $root.google.cloud.documentai.v1.OcrConfig.toObject(message.ocrConfig, options); - if (message.individualPageSelector != null && message.hasOwnProperty("individualPageSelector")) { - object.individualPageSelector = $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.toObject(message.individualPageSelector, options); - if (options.oneofs) - object.pageRange = "individualPageSelector"; - } - if (message.fromStart != null && message.hasOwnProperty("fromStart")) { - object.fromStart = message.fromStart; - if (options.oneofs) - object.pageRange = "fromStart"; - } - if (message.fromEnd != null && message.hasOwnProperty("fromEnd")) { - object.fromEnd = message.fromEnd; - if (options.oneofs) - object.pageRange = "fromEnd"; - } - if (message.schemaOverride != null && message.hasOwnProperty("schemaOverride")) - object.schemaOverride = $root.google.cloud.documentai.v1.DocumentSchema.toObject(message.schemaOverride, options); - if (message.layoutConfig != null && message.hasOwnProperty("layoutConfig")) - object.layoutConfig = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.toObject(message.layoutConfig, options); - return object; - }; - - /** - * Converts this ProcessOptions to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessOptions - * @instance - * @returns {Object.} JSON object - */ - ProcessOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessOptions - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessOptions"; - }; - - ProcessOptions.LayoutConfig = (function() { - - /** - * Properties of a LayoutConfig. - * @memberof google.cloud.documentai.v1.ProcessOptions - * @interface ILayoutConfig - * @property {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig|null} [chunkingConfig] LayoutConfig chunkingConfig - * @property {boolean|null} [returnImages] LayoutConfig returnImages - * @property {boolean|null} [returnBoundingBoxes] LayoutConfig returnBoundingBoxes - */ - - /** - * Constructs a new LayoutConfig. - * @memberof google.cloud.documentai.v1.ProcessOptions - * @classdesc Represents a LayoutConfig. - * @implements ILayoutConfig - * @constructor - * @param {google.cloud.documentai.v1.ProcessOptions.ILayoutConfig=} [properties] Properties to set - */ - function LayoutConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LayoutConfig chunkingConfig. - * @member {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig|null|undefined} chunkingConfig - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @instance - */ - LayoutConfig.prototype.chunkingConfig = null; - - /** - * LayoutConfig returnImages. - * @member {boolean} returnImages - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @instance - */ - LayoutConfig.prototype.returnImages = false; - - /** - * LayoutConfig returnBoundingBoxes. - * @member {boolean} returnBoundingBoxes - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @instance - */ - LayoutConfig.prototype.returnBoundingBoxes = false; - - /** - * Creates a new LayoutConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @static - * @param {google.cloud.documentai.v1.ProcessOptions.ILayoutConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessOptions.LayoutConfig} LayoutConfig instance - */ - LayoutConfig.create = function create(properties) { - return new LayoutConfig(properties); - }; - - /** - * Encodes the specified LayoutConfig message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @static - * @param {google.cloud.documentai.v1.ProcessOptions.ILayoutConfig} message LayoutConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chunkingConfig != null && Object.hasOwnProperty.call(message, "chunkingConfig")) - $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.encode(message.chunkingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.returnImages != null && Object.hasOwnProperty.call(message, "returnImages")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.returnImages); - if (message.returnBoundingBoxes != null && Object.hasOwnProperty.call(message, "returnBoundingBoxes")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.returnBoundingBoxes); - return writer; - }; - - /** - * Encodes the specified LayoutConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @static - * @param {google.cloud.documentai.v1.ProcessOptions.ILayoutConfig} message LayoutConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LayoutConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @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.ProcessOptions.LayoutConfig} LayoutConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutConfig.decode = function decode(reader, 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.ProcessOptions.LayoutConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.chunkingConfig = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.returnImages = reader.bool(); - break; - } - case 3: { - message.returnBoundingBoxes = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LayoutConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessOptions.LayoutConfig} LayoutConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LayoutConfig message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LayoutConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chunkingConfig != null && message.hasOwnProperty("chunkingConfig")) { - var error = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.verify(message.chunkingConfig); - if (error) - return "chunkingConfig." + error; - } - if (message.returnImages != null && message.hasOwnProperty("returnImages")) - if (typeof message.returnImages !== "boolean") - return "returnImages: boolean expected"; - if (message.returnBoundingBoxes != null && message.hasOwnProperty("returnBoundingBoxes")) - if (typeof message.returnBoundingBoxes !== "boolean") - return "returnBoundingBoxes: boolean expected"; - return null; - }; - - /** - * Creates a LayoutConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessOptions.LayoutConfig} LayoutConfig - */ - LayoutConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig(); - if (object.chunkingConfig != null) { - if (typeof object.chunkingConfig !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessOptions.LayoutConfig.chunkingConfig: object expected"); - message.chunkingConfig = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.fromObject(object.chunkingConfig); - } - if (object.returnImages != null) - message.returnImages = Boolean(object.returnImages); - if (object.returnBoundingBoxes != null) - message.returnBoundingBoxes = Boolean(object.returnBoundingBoxes); - return message; - }; - - /** - * Creates a plain object from a LayoutConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @static - * @param {google.cloud.documentai.v1.ProcessOptions.LayoutConfig} message LayoutConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LayoutConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.chunkingConfig = null; - object.returnImages = false; - object.returnBoundingBoxes = false; - } - if (message.chunkingConfig != null && message.hasOwnProperty("chunkingConfig")) - object.chunkingConfig = $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.toObject(message.chunkingConfig, options); - if (message.returnImages != null && message.hasOwnProperty("returnImages")) - object.returnImages = message.returnImages; - if (message.returnBoundingBoxes != null && message.hasOwnProperty("returnBoundingBoxes")) - object.returnBoundingBoxes = message.returnBoundingBoxes; - return object; - }; - - /** - * Converts this LayoutConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @instance - * @returns {Object.} JSON object - */ - LayoutConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LayoutConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LayoutConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessOptions.LayoutConfig"; - }; - - LayoutConfig.ChunkingConfig = (function() { - - /** - * Properties of a ChunkingConfig. - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @interface IChunkingConfig - * @property {number|null} [chunkSize] ChunkingConfig chunkSize - * @property {boolean|null} [includeAncestorHeadings] ChunkingConfig includeAncestorHeadings - */ - - /** - * Constructs a new ChunkingConfig. - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig - * @classdesc Represents a ChunkingConfig. - * @implements IChunkingConfig - * @constructor - * @param {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig=} [properties] Properties to set - */ - function ChunkingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChunkingConfig chunkSize. - * @member {number} chunkSize - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - * @instance - */ - ChunkingConfig.prototype.chunkSize = 0; - - /** - * ChunkingConfig includeAncestorHeadings. - * @member {boolean} includeAncestorHeadings - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - * @instance - */ - ChunkingConfig.prototype.includeAncestorHeadings = false; - - /** - * Creates a new ChunkingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig instance - */ - ChunkingConfig.create = function create(properties) { - return new ChunkingConfig(properties); - }; - - /** - * Encodes the specified ChunkingConfig message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig} message ChunkingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chunkSize != null && Object.hasOwnProperty.call(message, "chunkSize")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.chunkSize); - if (message.includeAncestorHeadings != null && Object.hasOwnProperty.call(message, "includeAncestorHeadings")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeAncestorHeadings); - return writer; - }; - - /** - * Encodes the specified ChunkingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.IChunkingConfig} message ChunkingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChunkingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - * @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.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkingConfig.decode = function decode(reader, 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.ProcessOptions.LayoutConfig.ChunkingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.chunkSize = reader.int32(); - break; - } - case 2: { - message.includeAncestorHeadings = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChunkingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChunkingConfig message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChunkingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) - if (!$util.isInteger(message.chunkSize)) - return "chunkSize: integer expected"; - if (message.includeAncestorHeadings != null && message.hasOwnProperty("includeAncestorHeadings")) - if (typeof message.includeAncestorHeadings !== "boolean") - return "includeAncestorHeadings: boolean expected"; - return null; - }; - - /** - * Creates a ChunkingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig - */ - ChunkingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig(); - if (object.chunkSize != null) - message.chunkSize = object.chunkSize | 0; - if (object.includeAncestorHeadings != null) - message.includeAncestorHeadings = Boolean(object.includeAncestorHeadings); - return message; - }; - - /** - * Creates a plain object from a ChunkingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig} message ChunkingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChunkingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.chunkSize = 0; - object.includeAncestorHeadings = false; - } - if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) - object.chunkSize = message.chunkSize; - if (message.includeAncestorHeadings != null && message.hasOwnProperty("includeAncestorHeadings")) - object.includeAncestorHeadings = message.includeAncestorHeadings; - return object; - }; - - /** - * Converts this ChunkingConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - * @instance - * @returns {Object.} JSON object - */ - ChunkingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChunkingConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChunkingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessOptions.LayoutConfig.ChunkingConfig"; - }; - - return ChunkingConfig; - })(); - - return LayoutConfig; - })(); - - ProcessOptions.IndividualPageSelector = (function() { - - /** - * Properties of an IndividualPageSelector. - * @memberof google.cloud.documentai.v1.ProcessOptions - * @interface IIndividualPageSelector - * @property {Array.|null} [pages] IndividualPageSelector pages - */ - - /** - * Constructs a new IndividualPageSelector. - * @memberof google.cloud.documentai.v1.ProcessOptions - * @classdesc Represents an IndividualPageSelector. - * @implements IIndividualPageSelector - * @constructor - * @param {google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector=} [properties] Properties to set - */ - function IndividualPageSelector(properties) { - this.pages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IndividualPageSelector pages. - * @member {Array.} pages - * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector - * @instance - */ - IndividualPageSelector.prototype.pages = $util.emptyArray; - - /** - * Creates a new IndividualPageSelector instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector - * @static - * @param {google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector} IndividualPageSelector instance - */ - IndividualPageSelector.create = function create(properties) { - return new IndividualPageSelector(properties); - }; - - /** - * Encodes the specified IndividualPageSelector message. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector - * @static - * @param {google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector} message IndividualPageSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualPageSelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pages != null && message.pages.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.pages.length; ++i) - writer.int32(message.pages[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified IndividualPageSelector message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector - * @static - * @param {google.cloud.documentai.v1.ProcessOptions.IIndividualPageSelector} message IndividualPageSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualPageSelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IndividualPageSelector message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector - * @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.ProcessOptions.IndividualPageSelector} IndividualPageSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualPageSelector.decode = function decode(reader, 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.ProcessOptions.IndividualPageSelector(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.pages && message.pages.length)) - message.pages = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.pages.push(reader.int32()); - } else - message.pages.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IndividualPageSelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector} IndividualPageSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualPageSelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IndividualPageSelector message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndividualPageSelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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) - if (!$util.isInteger(message.pages[i])) - return "pages: integer[] expected"; - } - return null; - }; - - /** - * Creates an IndividualPageSelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector} IndividualPageSelector - */ - IndividualPageSelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector(); - if (object.pages) { - if (!Array.isArray(object.pages)) - throw TypeError(".google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector.pages: array expected"); - message.pages = []; - for (var i = 0; i < object.pages.length; ++i) - message.pages[i] = object.pages[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from an IndividualPageSelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector - * @static - * @param {google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector} message IndividualPageSelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndividualPageSelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pages = []; - if (message.pages && message.pages.length) { - object.pages = []; - for (var j = 0; j < message.pages.length; ++j) - object.pages[j] = message.pages[j]; - } - return object; - }; - - /** - * Converts this IndividualPageSelector to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector - * @instance - * @returns {Object.} JSON object - */ - IndividualPageSelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IndividualPageSelector - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndividualPageSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessOptions.IndividualPageSelector"; - }; - - return IndividualPageSelector; - })(); - - return ProcessOptions; - })(); - - v1.ProcessRequest = (function() { - - /** - * Properties of a ProcessRequest. - * @memberof google.cloud.documentai.v1 - * @interface IProcessRequest - * @property {google.cloud.documentai.v1.IDocument|null} [inlineDocument] ProcessRequest inlineDocument - * @property {google.cloud.documentai.v1.IRawDocument|null} [rawDocument] ProcessRequest rawDocument - * @property {google.cloud.documentai.v1.IGcsDocument|null} [gcsDocument] ProcessRequest gcsDocument - * @property {string|null} [name] ProcessRequest name - * @property {boolean|null} [skipHumanReview] ProcessRequest skipHumanReview - * @property {google.protobuf.IFieldMask|null} [fieldMask] ProcessRequest fieldMask - * @property {google.cloud.documentai.v1.IProcessOptions|null} [processOptions] ProcessRequest processOptions - * @property {Object.|null} [labels] ProcessRequest labels - * @property {boolean|null} [imagelessMode] ProcessRequest imagelessMode - */ - - /** - * Constructs a new ProcessRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ProcessRequest. - * @implements IProcessRequest - * @constructor - * @param {google.cloud.documentai.v1.IProcessRequest=} [properties] Properties to set - */ - function ProcessRequest(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProcessRequest inlineDocument. - * @member {google.cloud.documentai.v1.IDocument|null|undefined} inlineDocument - * @memberof google.cloud.documentai.v1.ProcessRequest - * @instance - */ - ProcessRequest.prototype.inlineDocument = null; - - /** - * ProcessRequest rawDocument. - * @member {google.cloud.documentai.v1.IRawDocument|null|undefined} rawDocument - * @memberof google.cloud.documentai.v1.ProcessRequest - * @instance - */ - ProcessRequest.prototype.rawDocument = null; - - /** - * ProcessRequest gcsDocument. - * @member {google.cloud.documentai.v1.IGcsDocument|null|undefined} gcsDocument - * @memberof google.cloud.documentai.v1.ProcessRequest - * @instance - */ - ProcessRequest.prototype.gcsDocument = null; - - /** - * ProcessRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1.ProcessRequest - * @instance - */ - ProcessRequest.prototype.name = ""; - - /** - * ProcessRequest skipHumanReview. - * @member {boolean} skipHumanReview - * @memberof google.cloud.documentai.v1.ProcessRequest - * @instance - */ - ProcessRequest.prototype.skipHumanReview = false; - - /** - * ProcessRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.documentai.v1.ProcessRequest - * @instance - */ - ProcessRequest.prototype.fieldMask = null; - - /** - * ProcessRequest processOptions. - * @member {google.cloud.documentai.v1.IProcessOptions|null|undefined} processOptions - * @memberof google.cloud.documentai.v1.ProcessRequest - * @instance - */ - ProcessRequest.prototype.processOptions = null; - - /** - * ProcessRequest labels. - * @member {Object.} labels - * @memberof google.cloud.documentai.v1.ProcessRequest - * @instance - */ - ProcessRequest.prototype.labels = $util.emptyObject; - - /** - * ProcessRequest imagelessMode. - * @member {boolean} imagelessMode - * @memberof google.cloud.documentai.v1.ProcessRequest - * @instance - */ - ProcessRequest.prototype.imagelessMode = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ProcessRequest source. - * @member {"inlineDocument"|"rawDocument"|"gcsDocument"|undefined} source - * @memberof google.cloud.documentai.v1.ProcessRequest - * @instance - */ - Object.defineProperty(ProcessRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["inlineDocument", "rawDocument", "gcsDocument"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ProcessRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessRequest - * @static - * @param {google.cloud.documentai.v1.IProcessRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessRequest} ProcessRequest instance - */ - ProcessRequest.create = function create(properties) { - return new ProcessRequest(properties); - }; - - /** - * Encodes the specified ProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1.ProcessRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessRequest - * @static - * @param {google.cloud.documentai.v1.IProcessRequest} message ProcessRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessRequest.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.skipHumanReview != null && Object.hasOwnProperty.call(message, "skipHumanReview")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skipHumanReview); - if (message.inlineDocument != null && Object.hasOwnProperty.call(message, "inlineDocument")) - $root.google.cloud.documentai.v1.Document.encode(message.inlineDocument, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.rawDocument != null && Object.hasOwnProperty.call(message, "rawDocument")) - $root.google.cloud.documentai.v1.RawDocument.encode(message.rawDocument, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.processOptions != null && Object.hasOwnProperty.call(message, "processOptions")) - $root.google.cloud.documentai.v1.ProcessOptions.encode(message.processOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.gcsDocument != null && Object.hasOwnProperty.call(message, "gcsDocument")) - $root.google.cloud.documentai.v1.GcsDocument.encode(message.gcsDocument, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.imagelessMode != null && Object.hasOwnProperty.call(message, "imagelessMode")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.imagelessMode); - return writer; - }; - - /** - * Encodes the specified ProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessRequest - * @static - * @param {google.cloud.documentai.v1.IProcessRequest} message ProcessRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessRequest - * @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.ProcessRequest} ProcessRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessRequest.decode = function decode(reader, 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.ProcessRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.inlineDocument = $root.google.cloud.documentai.v1.Document.decode(reader, reader.uint32()); - break; - } - case 5: { - message.rawDocument = $root.google.cloud.documentai.v1.RawDocument.decode(reader, reader.uint32()); - break; - } - case 8: { - message.gcsDocument = $root.google.cloud.documentai.v1.GcsDocument.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.skipHumanReview = reader.bool(); - break; - } - case 6: { - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 7: { - message.processOptions = $root.google.cloud.documentai.v1.ProcessOptions.decode(reader, reader.uint32()); - break; - } - case 10: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 11: { - message.imagelessMode = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessRequest} ProcessRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1.Document.verify(message.inlineDocument); - if (error) - return "inlineDocument." + error; - } - } - if (message.rawDocument != null && message.hasOwnProperty("rawDocument")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1.RawDocument.verify(message.rawDocument); - if (error) - return "rawDocument." + error; - } - } - if (message.gcsDocument != null && message.hasOwnProperty("gcsDocument")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1.GcsDocument.verify(message.gcsDocument); - if (error) - return "gcsDocument." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) - if (typeof message.skipHumanReview !== "boolean") - return "skipHumanReview: boolean expected"; - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); - if (error) - return "fieldMask." + error; - } - if (message.processOptions != null && message.hasOwnProperty("processOptions")) { - var error = $root.google.cloud.documentai.v1.ProcessOptions.verify(message.processOptions); - if (error) - return "processOptions." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.imagelessMode != null && message.hasOwnProperty("imagelessMode")) - if (typeof message.imagelessMode !== "boolean") - return "imagelessMode: boolean expected"; - return null; - }; - - /** - * Creates a ProcessRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessRequest} ProcessRequest - */ - ProcessRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessRequest) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessRequest(); - if (object.inlineDocument != null) { - if (typeof object.inlineDocument !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessRequest.inlineDocument: object expected"); - message.inlineDocument = $root.google.cloud.documentai.v1.Document.fromObject(object.inlineDocument); - } - if (object.rawDocument != null) { - if (typeof object.rawDocument !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessRequest.rawDocument: object expected"); - message.rawDocument = $root.google.cloud.documentai.v1.RawDocument.fromObject(object.rawDocument); - } - if (object.gcsDocument != null) { - if (typeof object.gcsDocument !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessRequest.gcsDocument: object expected"); - message.gcsDocument = $root.google.cloud.documentai.v1.GcsDocument.fromObject(object.gcsDocument); - } - if (object.name != null) - message.name = String(object.name); - if (object.skipHumanReview != null) - message.skipHumanReview = Boolean(object.skipHumanReview); - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); - } - if (object.processOptions != null) { - if (typeof object.processOptions !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessRequest.processOptions: object expected"); - message.processOptions = $root.google.cloud.documentai.v1.ProcessOptions.fromObject(object.processOptions); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessRequest.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.imagelessMode != null) - message.imagelessMode = Boolean(object.imagelessMode); - return message; - }; - - /** - * Creates a plain object from a ProcessRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessRequest - * @static - * @param {google.cloud.documentai.v1.ProcessRequest} message ProcessRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.skipHumanReview = false; - object.fieldMask = null; - object.processOptions = null; - object.imagelessMode = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) - object.skipHumanReview = message.skipHumanReview; - if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { - object.inlineDocument = $root.google.cloud.documentai.v1.Document.toObject(message.inlineDocument, options); - if (options.oneofs) - object.source = "inlineDocument"; - } - if (message.rawDocument != null && message.hasOwnProperty("rawDocument")) { - object.rawDocument = $root.google.cloud.documentai.v1.RawDocument.toObject(message.rawDocument, options); - if (options.oneofs) - object.source = "rawDocument"; - } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - if (message.processOptions != null && message.hasOwnProperty("processOptions")) - object.processOptions = $root.google.cloud.documentai.v1.ProcessOptions.toObject(message.processOptions, options); - if (message.gcsDocument != null && message.hasOwnProperty("gcsDocument")) { - object.gcsDocument = $root.google.cloud.documentai.v1.GcsDocument.toObject(message.gcsDocument, options); - if (options.oneofs) - object.source = "gcsDocument"; - } - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.imagelessMode != null && message.hasOwnProperty("imagelessMode")) - object.imagelessMode = message.imagelessMode; - return object; - }; - - /** - * Converts this ProcessRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessRequest - * @instance - * @returns {Object.} JSON object - */ - ProcessRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessRequest"; - }; - - return ProcessRequest; - })(); - - v1.HumanReviewStatus = (function() { - - /** - * Properties of a HumanReviewStatus. - * @memberof google.cloud.documentai.v1 - * @interface IHumanReviewStatus - * @property {google.cloud.documentai.v1.HumanReviewStatus.State|null} [state] HumanReviewStatus state - * @property {string|null} [stateMessage] HumanReviewStatus stateMessage - * @property {string|null} [humanReviewOperation] HumanReviewStatus humanReviewOperation - */ - - /** - * Constructs a new HumanReviewStatus. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a HumanReviewStatus. - * @implements IHumanReviewStatus - * @constructor - * @param {google.cloud.documentai.v1.IHumanReviewStatus=} [properties] Properties to set - */ - function HumanReviewStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HumanReviewStatus state. - * @member {google.cloud.documentai.v1.HumanReviewStatus.State} state - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @instance - */ - HumanReviewStatus.prototype.state = 0; - - /** - * HumanReviewStatus stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @instance - */ - HumanReviewStatus.prototype.stateMessage = ""; - - /** - * HumanReviewStatus humanReviewOperation. - * @member {string} humanReviewOperation - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @instance - */ - HumanReviewStatus.prototype.humanReviewOperation = ""; - - /** - * Creates a new HumanReviewStatus instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @static - * @param {google.cloud.documentai.v1.IHumanReviewStatus=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.HumanReviewStatus} HumanReviewStatus instance - */ - HumanReviewStatus.create = function create(properties) { - return new HumanReviewStatus(properties); - }; - - /** - * Encodes the specified HumanReviewStatus message. Does not implicitly {@link google.cloud.documentai.v1.HumanReviewStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @static - * @param {google.cloud.documentai.v1.IHumanReviewStatus} message HumanReviewStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HumanReviewStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); - if (message.humanReviewOperation != null && Object.hasOwnProperty.call(message, "humanReviewOperation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.humanReviewOperation); - return writer; - }; - - /** - * Encodes the specified HumanReviewStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.HumanReviewStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @static - * @param {google.cloud.documentai.v1.IHumanReviewStatus} message HumanReviewStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HumanReviewStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HumanReviewStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @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.HumanReviewStatus} HumanReviewStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HumanReviewStatus.decode = function decode(reader, 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.HumanReviewStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.stateMessage = reader.string(); - break; - } - case 3: { - message.humanReviewOperation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HumanReviewStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.HumanReviewStatus} HumanReviewStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HumanReviewStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HumanReviewStatus message. - * @function verify - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HumanReviewStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) - if (!$util.isString(message.humanReviewOperation)) - return "humanReviewOperation: string expected"; - return null; - }; - - /** - * Creates a HumanReviewStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.HumanReviewStatus} HumanReviewStatus - */ - HumanReviewStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.HumanReviewStatus) - return object; - var message = new $root.google.cloud.documentai.v1.HumanReviewStatus(); - 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 "SKIPPED": - case 1: - message.state = 1; - break; - case "VALIDATION_PASSED": - case 2: - message.state = 2; - break; - case "IN_PROGRESS": - case 3: - message.state = 3; - break; - case "ERROR": - case 4: - message.state = 4; - break; - } - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.humanReviewOperation != null) - message.humanReviewOperation = String(object.humanReviewOperation); - return message; - }; - - /** - * Creates a plain object from a HumanReviewStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @static - * @param {google.cloud.documentai.v1.HumanReviewStatus} message HumanReviewStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HumanReviewStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; - object.humanReviewOperation = ""; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1.HumanReviewStatus.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.HumanReviewStatus.State[message.state] : message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) - object.humanReviewOperation = message.humanReviewOperation; - return object; - }; - - /** - * Converts this HumanReviewStatus to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @instance - * @returns {Object.} JSON object - */ - HumanReviewStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HumanReviewStatus - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.HumanReviewStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HumanReviewStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.HumanReviewStatus"; - }; - - /** - * State enum. - * @name google.cloud.documentai.v1.HumanReviewStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} SKIPPED=1 SKIPPED value - * @property {number} VALIDATION_PASSED=2 VALIDATION_PASSED value - * @property {number} IN_PROGRESS=3 IN_PROGRESS value - * @property {number} ERROR=4 ERROR value - */ - HumanReviewStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SKIPPED"] = 1; - values[valuesById[2] = "VALIDATION_PASSED"] = 2; - values[valuesById[3] = "IN_PROGRESS"] = 3; - values[valuesById[4] = "ERROR"] = 4; - return values; - })(); - - return HumanReviewStatus; - })(); - - v1.ProcessResponse = (function() { - - /** - * Properties of a ProcessResponse. - * @memberof google.cloud.documentai.v1 - * @interface IProcessResponse - * @property {google.cloud.documentai.v1.IDocument|null} [document] ProcessResponse document - * @property {google.cloud.documentai.v1.IHumanReviewStatus|null} [humanReviewStatus] ProcessResponse humanReviewStatus - */ - - /** - * Constructs a new ProcessResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ProcessResponse. - * @implements IProcessResponse - * @constructor - * @param {google.cloud.documentai.v1.IProcessResponse=} [properties] Properties to set - */ - function ProcessResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProcessResponse document. - * @member {google.cloud.documentai.v1.IDocument|null|undefined} document - * @memberof google.cloud.documentai.v1.ProcessResponse - * @instance - */ - ProcessResponse.prototype.document = null; - - /** - * ProcessResponse humanReviewStatus. - * @member {google.cloud.documentai.v1.IHumanReviewStatus|null|undefined} humanReviewStatus - * @memberof google.cloud.documentai.v1.ProcessResponse - * @instance - */ - ProcessResponse.prototype.humanReviewStatus = null; - - /** - * Creates a new ProcessResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessResponse - * @static - * @param {google.cloud.documentai.v1.IProcessResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessResponse} ProcessResponse instance - */ - ProcessResponse.create = function create(properties) { - return new ProcessResponse(properties); - }; - - /** - * Encodes the specified ProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1.ProcessResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessResponse - * @static - * @param {google.cloud.documentai.v1.IProcessResponse} message ProcessResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.document != null && Object.hasOwnProperty.call(message, "document")) - $root.google.cloud.documentai.v1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.humanReviewStatus != null && Object.hasOwnProperty.call(message, "humanReviewStatus")) - $root.google.cloud.documentai.v1.HumanReviewStatus.encode(message.humanReviewStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessResponse - * @static - * @param {google.cloud.documentai.v1.IProcessResponse} message ProcessResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessResponse - * @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.ProcessResponse} ProcessResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessResponse.decode = function decode(reader, 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.ProcessResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.document = $root.google.cloud.documentai.v1.Document.decode(reader, reader.uint32()); - break; - } - case 3: { - message.humanReviewStatus = $root.google.cloud.documentai.v1.HumanReviewStatus.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessResponse} ProcessResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessResponse.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.documentai.v1.Document.verify(message.document); - if (error) - return "document." + error; - } - if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) { - var error = $root.google.cloud.documentai.v1.HumanReviewStatus.verify(message.humanReviewStatus); - if (error) - return "humanReviewStatus." + error; - } - return null; - }; - - /** - * Creates a ProcessResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessResponse} ProcessResponse - */ - ProcessResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessResponse) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessResponse(); - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessResponse.document: object expected"); - message.document = $root.google.cloud.documentai.v1.Document.fromObject(object.document); - } - if (object.humanReviewStatus != null) { - if (typeof object.humanReviewStatus !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessResponse.humanReviewStatus: object expected"); - message.humanReviewStatus = $root.google.cloud.documentai.v1.HumanReviewStatus.fromObject(object.humanReviewStatus); - } - return message; - }; - - /** - * Creates a plain object from a ProcessResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessResponse - * @static - * @param {google.cloud.documentai.v1.ProcessResponse} message ProcessResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.document = null; - object.humanReviewStatus = null; - } - if (message.document != null && message.hasOwnProperty("document")) - object.document = $root.google.cloud.documentai.v1.Document.toObject(message.document, options); - if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) - object.humanReviewStatus = $root.google.cloud.documentai.v1.HumanReviewStatus.toObject(message.humanReviewStatus, options); - return object; - }; - - /** - * Converts this ProcessResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessResponse - * @instance - * @returns {Object.} JSON object - */ - ProcessResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessResponse"; - }; - - return ProcessResponse; - })(); - - v1.BatchProcessRequest = (function() { - - /** - * Properties of a BatchProcessRequest. - * @memberof google.cloud.documentai.v1 - * @interface IBatchProcessRequest - * @property {string|null} [name] BatchProcessRequest name - * @property {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null} [inputDocuments] BatchProcessRequest inputDocuments - * @property {google.cloud.documentai.v1.IDocumentOutputConfig|null} [documentOutputConfig] BatchProcessRequest documentOutputConfig - * @property {boolean|null} [skipHumanReview] BatchProcessRequest skipHumanReview - * @property {google.cloud.documentai.v1.IProcessOptions|null} [processOptions] BatchProcessRequest processOptions - * @property {Object.|null} [labels] BatchProcessRequest labels - */ - - /** - * Constructs a new BatchProcessRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a BatchProcessRequest. - * @implements IBatchProcessRequest - * @constructor - * @param {google.cloud.documentai.v1.IBatchProcessRequest=} [properties] Properties to set - */ - function BatchProcessRequest(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchProcessRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.name = ""; - - /** - * BatchProcessRequest inputDocuments. - * @member {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null|undefined} inputDocuments - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.inputDocuments = null; - - /** - * BatchProcessRequest documentOutputConfig. - * @member {google.cloud.documentai.v1.IDocumentOutputConfig|null|undefined} documentOutputConfig - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.documentOutputConfig = null; - - /** - * BatchProcessRequest skipHumanReview. - * @member {boolean} skipHumanReview - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.skipHumanReview = false; - - /** - * BatchProcessRequest processOptions. - * @member {google.cloud.documentai.v1.IProcessOptions|null|undefined} processOptions - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.processOptions = null; - - /** - * BatchProcessRequest labels. - * @member {Object.} labels - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.labels = $util.emptyObject; - - /** - * Creates a new BatchProcessRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @static - * @param {google.cloud.documentai.v1.IBatchProcessRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.BatchProcessRequest} BatchProcessRequest instance - */ - BatchProcessRequest.create = function create(properties) { - return new BatchProcessRequest(properties); - }; - - /** - * Encodes the specified BatchProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @static - * @param {google.cloud.documentai.v1.IBatchProcessRequest} message BatchProcessRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProcessRequest.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.skipHumanReview != null && Object.hasOwnProperty.call(message, "skipHumanReview")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipHumanReview); - if (message.inputDocuments != null && Object.hasOwnProperty.call(message, "inputDocuments")) - $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.encode(message.inputDocuments, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.documentOutputConfig != null && Object.hasOwnProperty.call(message, "documentOutputConfig")) - $root.google.cloud.documentai.v1.DocumentOutputConfig.encode(message.documentOutputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.processOptions != null && Object.hasOwnProperty.call(message, "processOptions")) - $root.google.cloud.documentai.v1.ProcessOptions.encode(message.processOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @static - * @param {google.cloud.documentai.v1.IBatchProcessRequest} message BatchProcessRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProcessRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchProcessRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @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.BatchProcessRequest} BatchProcessRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProcessRequest.decode = function decode(reader, 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.BatchProcessRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 5: { - message.inputDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.documentOutputConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.skipHumanReview = reader.bool(); - break; - } - case 7: { - message.processOptions = $root.google.cloud.documentai.v1.ProcessOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchProcessRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.BatchProcessRequest} BatchProcessRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProcessRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchProcessRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchProcessRequest.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.inputDocuments != null && message.hasOwnProperty("inputDocuments")) { - var error = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.verify(message.inputDocuments); - if (error) - return "inputDocuments." + error; - } - if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) { - var error = $root.google.cloud.documentai.v1.DocumentOutputConfig.verify(message.documentOutputConfig); - if (error) - return "documentOutputConfig." + error; - } - if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) - if (typeof message.skipHumanReview !== "boolean") - return "skipHumanReview: boolean expected"; - if (message.processOptions != null && message.hasOwnProperty("processOptions")) { - var error = $root.google.cloud.documentai.v1.ProcessOptions.verify(message.processOptions); - if (error) - return "processOptions." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a BatchProcessRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.BatchProcessRequest} BatchProcessRequest - */ - BatchProcessRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.BatchProcessRequest) - return object; - var message = new $root.google.cloud.documentai.v1.BatchProcessRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.inputDocuments != null) { - if (typeof object.inputDocuments !== "object") - throw TypeError(".google.cloud.documentai.v1.BatchProcessRequest.inputDocuments: object expected"); - message.inputDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.fromObject(object.inputDocuments); - } - if (object.documentOutputConfig != null) { - if (typeof object.documentOutputConfig !== "object") - throw TypeError(".google.cloud.documentai.v1.BatchProcessRequest.documentOutputConfig: object expected"); - message.documentOutputConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.fromObject(object.documentOutputConfig); - } - if (object.skipHumanReview != null) - message.skipHumanReview = Boolean(object.skipHumanReview); - if (object.processOptions != null) { - if (typeof object.processOptions !== "object") - throw TypeError(".google.cloud.documentai.v1.BatchProcessRequest.processOptions: object expected"); - message.processOptions = $root.google.cloud.documentai.v1.ProcessOptions.fromObject(object.processOptions); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.documentai.v1.BatchProcessRequest.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a BatchProcessRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @static - * @param {google.cloud.documentai.v1.BatchProcessRequest} message BatchProcessRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchProcessRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.skipHumanReview = false; - object.inputDocuments = null; - object.documentOutputConfig = null; - object.processOptions = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) - object.skipHumanReview = message.skipHumanReview; - if (message.inputDocuments != null && message.hasOwnProperty("inputDocuments")) - object.inputDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.toObject(message.inputDocuments, options); - if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) - object.documentOutputConfig = $root.google.cloud.documentai.v1.DocumentOutputConfig.toObject(message.documentOutputConfig, options); - if (message.processOptions != null && message.hasOwnProperty("processOptions")) - object.processOptions = $root.google.cloud.documentai.v1.ProcessOptions.toObject(message.processOptions, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - return object; - }; - - /** - * Converts this BatchProcessRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @instance - * @returns {Object.} JSON object - */ - BatchProcessRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchProcessRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.BatchProcessRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchProcessRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.BatchProcessRequest"; - }; - - return BatchProcessRequest; - })(); - - v1.BatchProcessResponse = (function() { - - /** - * Properties of a BatchProcessResponse. - * @memberof google.cloud.documentai.v1 - * @interface IBatchProcessResponse - */ - - /** - * Constructs a new BatchProcessResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a BatchProcessResponse. - * @implements IBatchProcessResponse - * @constructor - * @param {google.cloud.documentai.v1.IBatchProcessResponse=} [properties] Properties to set - */ - function BatchProcessResponse(properties) { - if (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 BatchProcessResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.BatchProcessResponse - * @static - * @param {google.cloud.documentai.v1.IBatchProcessResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.BatchProcessResponse} BatchProcessResponse instance - */ - BatchProcessResponse.create = function create(properties) { - return new BatchProcessResponse(properties); - }; - - /** - * Encodes the specified BatchProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.BatchProcessResponse - * @static - * @param {google.cloud.documentai.v1.IBatchProcessResponse} message BatchProcessResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProcessResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified BatchProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.BatchProcessResponse - * @static - * @param {google.cloud.documentai.v1.IBatchProcessResponse} message BatchProcessResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProcessResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchProcessResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.BatchProcessResponse - * @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.BatchProcessResponse} BatchProcessResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProcessResponse.decode = function decode(reader, 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.BatchProcessResponse(); - 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 BatchProcessResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.BatchProcessResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.BatchProcessResponse} BatchProcessResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProcessResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchProcessResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.BatchProcessResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchProcessResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a BatchProcessResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.BatchProcessResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.BatchProcessResponse} BatchProcessResponse - */ - BatchProcessResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.BatchProcessResponse) - return object; - return new $root.google.cloud.documentai.v1.BatchProcessResponse(); - }; - - /** - * Creates a plain object from a BatchProcessResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.BatchProcessResponse - * @static - * @param {google.cloud.documentai.v1.BatchProcessResponse} message BatchProcessResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchProcessResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this BatchProcessResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.BatchProcessResponse - * @instance - * @returns {Object.} JSON object - */ - BatchProcessResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchProcessResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.BatchProcessResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchProcessResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.BatchProcessResponse"; - }; - - return BatchProcessResponse; - })(); - - v1.BatchProcessMetadata = (function() { - - /** - * Properties of a BatchProcessMetadata. - * @memberof google.cloud.documentai.v1 - * @interface IBatchProcessMetadata - * @property {google.cloud.documentai.v1.BatchProcessMetadata.State|null} [state] BatchProcessMetadata state - * @property {string|null} [stateMessage] BatchProcessMetadata stateMessage - * @property {google.protobuf.ITimestamp|null} [createTime] BatchProcessMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] BatchProcessMetadata updateTime - * @property {Array.|null} [individualProcessStatuses] BatchProcessMetadata individualProcessStatuses - */ - - /** - * Constructs a new BatchProcessMetadata. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a BatchProcessMetadata. - * @implements IBatchProcessMetadata - * @constructor - * @param {google.cloud.documentai.v1.IBatchProcessMetadata=} [properties] Properties to set - */ - function BatchProcessMetadata(properties) { - this.individualProcessStatuses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchProcessMetadata state. - * @member {google.cloud.documentai.v1.BatchProcessMetadata.State} state - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @instance - */ - BatchProcessMetadata.prototype.state = 0; - - /** - * BatchProcessMetadata stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @instance - */ - BatchProcessMetadata.prototype.stateMessage = ""; - - /** - * BatchProcessMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @instance - */ - BatchProcessMetadata.prototype.createTime = null; - - /** - * BatchProcessMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @instance - */ - BatchProcessMetadata.prototype.updateTime = null; - - /** - * BatchProcessMetadata individualProcessStatuses. - * @member {Array.} individualProcessStatuses - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @instance - */ - BatchProcessMetadata.prototype.individualProcessStatuses = $util.emptyArray; - - /** - * Creates a new BatchProcessMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @static - * @param {google.cloud.documentai.v1.IBatchProcessMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.BatchProcessMetadata} BatchProcessMetadata instance - */ - BatchProcessMetadata.create = function create(properties) { - return new BatchProcessMetadata(properties); - }; - - /** - * Encodes the specified BatchProcessMetadata message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @static - * @param {google.cloud.documentai.v1.IBatchProcessMetadata} message BatchProcessMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProcessMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); - 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.individualProcessStatuses != null && message.individualProcessStatuses.length) - for (var i = 0; i < message.individualProcessStatuses.length; ++i) - $root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.encode(message.individualProcessStatuses[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchProcessMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @static - * @param {google.cloud.documentai.v1.IBatchProcessMetadata} message BatchProcessMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProcessMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchProcessMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @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.BatchProcessMetadata} BatchProcessMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProcessMetadata.decode = function decode(reader, 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.BatchProcessMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.stateMessage = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - if (!(message.individualProcessStatuses && message.individualProcessStatuses.length)) - message.individualProcessStatuses = []; - message.individualProcessStatuses.push($root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchProcessMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.BatchProcessMetadata} BatchProcessMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProcessMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchProcessMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchProcessMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.individualProcessStatuses != null && message.hasOwnProperty("individualProcessStatuses")) { - if (!Array.isArray(message.individualProcessStatuses)) - return "individualProcessStatuses: array expected"; - for (var i = 0; i < message.individualProcessStatuses.length; ++i) { - var error = $root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.verify(message.individualProcessStatuses[i]); - if (error) - return "individualProcessStatuses." + error; - } - } - return null; - }; - - /** - * Creates a BatchProcessMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.BatchProcessMetadata} BatchProcessMetadata - */ - BatchProcessMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.BatchProcessMetadata) - return object; - var message = new $root.google.cloud.documentai.v1.BatchProcessMetadata(); - 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 "WAITING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "SUCCEEDED": - case 3: - message.state = 3; - break; - case "CANCELLING": - case 4: - message.state = 4; - break; - case "CANCELLED": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - } - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1.BatchProcessMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.documentai.v1.BatchProcessMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.individualProcessStatuses) { - if (!Array.isArray(object.individualProcessStatuses)) - throw TypeError(".google.cloud.documentai.v1.BatchProcessMetadata.individualProcessStatuses: array expected"); - message.individualProcessStatuses = []; - for (var i = 0; i < object.individualProcessStatuses.length; ++i) { - if (typeof object.individualProcessStatuses[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.BatchProcessMetadata.individualProcessStatuses: object expected"); - message.individualProcessStatuses[i] = $root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.fromObject(object.individualProcessStatuses[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchProcessMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @static - * @param {google.cloud.documentai.v1.BatchProcessMetadata} message BatchProcessMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchProcessMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.individualProcessStatuses = []; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; - object.createTime = null; - object.updateTime = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1.BatchProcessMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.BatchProcessMetadata.State[message.state] : message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.individualProcessStatuses && message.individualProcessStatuses.length) { - object.individualProcessStatuses = []; - for (var j = 0; j < message.individualProcessStatuses.length; ++j) - object.individualProcessStatuses[j] = $root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.toObject(message.individualProcessStatuses[j], options); - } - return object; - }; - - /** - * Converts this BatchProcessMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @instance - * @returns {Object.} JSON object - */ - BatchProcessMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchProcessMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchProcessMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.BatchProcessMetadata"; - }; - - BatchProcessMetadata.IndividualProcessStatus = (function() { - - /** - * Properties of an IndividualProcessStatus. - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @interface IIndividualProcessStatus - * @property {string|null} [inputGcsSource] IndividualProcessStatus inputGcsSource - * @property {google.rpc.IStatus|null} [status] IndividualProcessStatus status - * @property {string|null} [outputGcsDestination] IndividualProcessStatus outputGcsDestination - * @property {google.cloud.documentai.v1.IHumanReviewStatus|null} [humanReviewStatus] IndividualProcessStatus humanReviewStatus - */ - - /** - * Constructs a new IndividualProcessStatus. - * @memberof google.cloud.documentai.v1.BatchProcessMetadata - * @classdesc Represents an IndividualProcessStatus. - * @implements IIndividualProcessStatus - * @constructor - * @param {google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus=} [properties] Properties to set - */ - function IndividualProcessStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IndividualProcessStatus inputGcsSource. - * @member {string} inputGcsSource - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @instance - */ - IndividualProcessStatus.prototype.inputGcsSource = ""; - - /** - * IndividualProcessStatus status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @instance - */ - IndividualProcessStatus.prototype.status = null; - - /** - * IndividualProcessStatus outputGcsDestination. - * @member {string} outputGcsDestination - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @instance - */ - IndividualProcessStatus.prototype.outputGcsDestination = ""; - - /** - * IndividualProcessStatus humanReviewStatus. - * @member {google.cloud.documentai.v1.IHumanReviewStatus|null|undefined} humanReviewStatus - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @instance - */ - IndividualProcessStatus.prototype.humanReviewStatus = null; - - /** - * Creates a new IndividualProcessStatus instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus instance - */ - IndividualProcessStatus.create = function create(properties) { - return new IndividualProcessStatus(properties); - }; - - /** - * Encodes the specified IndividualProcessStatus message. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus} message IndividualProcessStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualProcessStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputGcsSource != null && Object.hasOwnProperty.call(message, "inputGcsSource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputGcsSource); - 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(); - if (message.outputGcsDestination != null && Object.hasOwnProperty.call(message, "outputGcsDestination")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputGcsDestination); - if (message.humanReviewStatus != null && Object.hasOwnProperty.call(message, "humanReviewStatus")) - $root.google.cloud.documentai.v1.HumanReviewStatus.encode(message.humanReviewStatus, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IndividualProcessStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {google.cloud.documentai.v1.BatchProcessMetadata.IIndividualProcessStatus} message IndividualProcessStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualProcessStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IndividualProcessStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @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.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualProcessStatus.decode = function decode(reader, 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.BatchProcessMetadata.IndividualProcessStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.inputGcsSource = reader.string(); - break; - } - case 2: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 3: { - message.outputGcsDestination = reader.string(); - break; - } - case 5: { - message.humanReviewStatus = $root.google.cloud.documentai.v1.HumanReviewStatus.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IndividualProcessStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualProcessStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IndividualProcessStatus message. - * @function verify - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndividualProcessStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) - if (!$util.isString(message.inputGcsSource)) - return "inputGcsSource: string expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - if (message.outputGcsDestination != null && message.hasOwnProperty("outputGcsDestination")) - if (!$util.isString(message.outputGcsDestination)) - return "outputGcsDestination: string expected"; - if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) { - var error = $root.google.cloud.documentai.v1.HumanReviewStatus.verify(message.humanReviewStatus); - if (error) - return "humanReviewStatus." + error; - } - return null; - }; - - /** - * Creates an IndividualProcessStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus - */ - IndividualProcessStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus) - return object; - var message = new $root.google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus(); - if (object.inputGcsSource != null) - message.inputGcsSource = String(object.inputGcsSource); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - if (object.outputGcsDestination != null) - message.outputGcsDestination = String(object.outputGcsDestination); - if (object.humanReviewStatus != null) { - if (typeof object.humanReviewStatus !== "object") - throw TypeError(".google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus.humanReviewStatus: object expected"); - message.humanReviewStatus = $root.google.cloud.documentai.v1.HumanReviewStatus.fromObject(object.humanReviewStatus); - } - return message; - }; - - /** - * Creates a plain object from an IndividualProcessStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus} message IndividualProcessStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndividualProcessStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inputGcsSource = ""; - object.status = null; - object.outputGcsDestination = ""; - object.humanReviewStatus = null; - } - if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) - object.inputGcsSource = message.inputGcsSource; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.outputGcsDestination != null && message.hasOwnProperty("outputGcsDestination")) - object.outputGcsDestination = message.outputGcsDestination; - if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) - object.humanReviewStatus = $root.google.cloud.documentai.v1.HumanReviewStatus.toObject(message.humanReviewStatus, options); - return object; - }; - - /** - * Converts this IndividualProcessStatus to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @instance - * @returns {Object.} JSON object - */ - IndividualProcessStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IndividualProcessStatus - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndividualProcessStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.BatchProcessMetadata.IndividualProcessStatus"; - }; - - return IndividualProcessStatus; - })(); - - /** - * State enum. - * @name google.cloud.documentai.v1.BatchProcessMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} WAITING=1 WAITING value - * @property {number} RUNNING=2 RUNNING value - * @property {number} SUCCEEDED=3 SUCCEEDED value - * @property {number} CANCELLING=4 CANCELLING value - * @property {number} CANCELLED=5 CANCELLED value - * @property {number} FAILED=6 FAILED value - */ - BatchProcessMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "WAITING"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "SUCCEEDED"] = 3; - values[valuesById[4] = "CANCELLING"] = 4; - values[valuesById[5] = "CANCELLED"] = 5; - values[valuesById[6] = "FAILED"] = 6; - return values; - })(); - - return BatchProcessMetadata; - })(); - - v1.FetchProcessorTypesRequest = (function() { - - /** - * Properties of a FetchProcessorTypesRequest. - * @memberof google.cloud.documentai.v1 - * @interface IFetchProcessorTypesRequest - * @property {string|null} [parent] FetchProcessorTypesRequest parent - */ - - /** - * Constructs a new FetchProcessorTypesRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a FetchProcessorTypesRequest. - * @implements IFetchProcessorTypesRequest - * @constructor - * @param {google.cloud.documentai.v1.IFetchProcessorTypesRequest=} [properties] Properties to set - */ - function FetchProcessorTypesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchProcessorTypesRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest - * @instance - */ - FetchProcessorTypesRequest.prototype.parent = ""; - - /** - * Creates a new FetchProcessorTypesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1.IFetchProcessorTypesRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.FetchProcessorTypesRequest} FetchProcessorTypesRequest instance - */ - FetchProcessorTypesRequest.create = function create(properties) { - return new FetchProcessorTypesRequest(properties); - }; - - /** - * Encodes the specified FetchProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1.IFetchProcessorTypesRequest} message FetchProcessorTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchProcessorTypesRequest.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); - return writer; - }; - - /** - * Encodes the specified FetchProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1.IFetchProcessorTypesRequest} message FetchProcessorTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchProcessorTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest - * @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.FetchProcessorTypesRequest} FetchProcessorTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchProcessorTypesRequest.decode = function decode(reader, 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.FetchProcessorTypesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.FetchProcessorTypesRequest} FetchProcessorTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchProcessorTypesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchProcessorTypesRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchProcessorTypesRequest.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"; - return null; - }; - - /** - * Creates a FetchProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.FetchProcessorTypesRequest} FetchProcessorTypesRequest - */ - FetchProcessorTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.FetchProcessorTypesRequest) - return object; - var message = new $root.google.cloud.documentai.v1.FetchProcessorTypesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - return message; - }; - - /** - * Creates a plain object from a FetchProcessorTypesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1.FetchProcessorTypesRequest} message FetchProcessorTypesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchProcessorTypesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - return object; - }; - - /** - * Converts this FetchProcessorTypesRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest - * @instance - * @returns {Object.} JSON object - */ - FetchProcessorTypesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchProcessorTypesRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.FetchProcessorTypesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchProcessorTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.FetchProcessorTypesRequest"; - }; - - return FetchProcessorTypesRequest; - })(); - - v1.FetchProcessorTypesResponse = (function() { - - /** - * Properties of a FetchProcessorTypesResponse. - * @memberof google.cloud.documentai.v1 - * @interface IFetchProcessorTypesResponse - * @property {Array.|null} [processorTypes] FetchProcessorTypesResponse processorTypes - */ - - /** - * Constructs a new FetchProcessorTypesResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a FetchProcessorTypesResponse. - * @implements IFetchProcessorTypesResponse - * @constructor - * @param {google.cloud.documentai.v1.IFetchProcessorTypesResponse=} [properties] Properties to set - */ - function FetchProcessorTypesResponse(properties) { - this.processorTypes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchProcessorTypesResponse processorTypes. - * @member {Array.} processorTypes - * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse - * @instance - */ - FetchProcessorTypesResponse.prototype.processorTypes = $util.emptyArray; - - /** - * Creates a new FetchProcessorTypesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1.IFetchProcessorTypesResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.FetchProcessorTypesResponse} FetchProcessorTypesResponse instance - */ - FetchProcessorTypesResponse.create = function create(properties) { - return new FetchProcessorTypesResponse(properties); - }; - - /** - * Encodes the specified FetchProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1.IFetchProcessorTypesResponse} message FetchProcessorTypesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchProcessorTypesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorTypes != null && message.processorTypes.length) - for (var i = 0; i < message.processorTypes.length; ++i) - $root.google.cloud.documentai.v1.ProcessorType.encode(message.processorTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FetchProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.FetchProcessorTypesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1.IFetchProcessorTypesResponse} message FetchProcessorTypesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchProcessorTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse - * @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.FetchProcessorTypesResponse} FetchProcessorTypesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchProcessorTypesResponse.decode = function decode(reader, 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.FetchProcessorTypesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.processorTypes && message.processorTypes.length)) - message.processorTypes = []; - message.processorTypes.push($root.google.cloud.documentai.v1.ProcessorType.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.FetchProcessorTypesResponse} FetchProcessorTypesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchProcessorTypesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchProcessorTypesResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchProcessorTypesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorTypes != null && message.hasOwnProperty("processorTypes")) { - if (!Array.isArray(message.processorTypes)) - return "processorTypes: array expected"; - for (var i = 0; i < message.processorTypes.length; ++i) { - var error = $root.google.cloud.documentai.v1.ProcessorType.verify(message.processorTypes[i]); - if (error) - return "processorTypes." + error; - } - } - return null; - }; - - /** - * Creates a FetchProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.FetchProcessorTypesResponse} FetchProcessorTypesResponse - */ - FetchProcessorTypesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.FetchProcessorTypesResponse) - return object; - var message = new $root.google.cloud.documentai.v1.FetchProcessorTypesResponse(); - if (object.processorTypes) { - if (!Array.isArray(object.processorTypes)) - throw TypeError(".google.cloud.documentai.v1.FetchProcessorTypesResponse.processorTypes: array expected"); - message.processorTypes = []; - for (var i = 0; i < object.processorTypes.length; ++i) { - if (typeof object.processorTypes[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.FetchProcessorTypesResponse.processorTypes: object expected"); - message.processorTypes[i] = $root.google.cloud.documentai.v1.ProcessorType.fromObject(object.processorTypes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FetchProcessorTypesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1.FetchProcessorTypesResponse} message FetchProcessorTypesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchProcessorTypesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.processorTypes = []; - if (message.processorTypes && message.processorTypes.length) { - object.processorTypes = []; - for (var j = 0; j < message.processorTypes.length; ++j) - object.processorTypes[j] = $root.google.cloud.documentai.v1.ProcessorType.toObject(message.processorTypes[j], options); - } - return object; - }; - - /** - * Converts this FetchProcessorTypesResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse - * @instance - * @returns {Object.} JSON object - */ - FetchProcessorTypesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchProcessorTypesResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.FetchProcessorTypesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchProcessorTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.FetchProcessorTypesResponse"; - }; - - return FetchProcessorTypesResponse; - })(); - - v1.ListProcessorTypesRequest = (function() { - - /** - * Properties of a ListProcessorTypesRequest. - * @memberof google.cloud.documentai.v1 - * @interface IListProcessorTypesRequest - * @property {string|null} [parent] ListProcessorTypesRequest parent - * @property {number|null} [pageSize] ListProcessorTypesRequest pageSize - * @property {string|null} [pageToken] ListProcessorTypesRequest pageToken - */ - - /** - * Constructs a new ListProcessorTypesRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ListProcessorTypesRequest. - * @implements IListProcessorTypesRequest - * @constructor - * @param {google.cloud.documentai.v1.IListProcessorTypesRequest=} [properties] Properties to set - */ - function ListProcessorTypesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListProcessorTypesRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @instance - */ - ListProcessorTypesRequest.prototype.parent = ""; - - /** - * ListProcessorTypesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @instance - */ - ListProcessorTypesRequest.prototype.pageSize = 0; - - /** - * ListProcessorTypesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @instance - */ - ListProcessorTypesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListProcessorTypesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1.IListProcessorTypesRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ListProcessorTypesRequest} ListProcessorTypesRequest instance - */ - ListProcessorTypesRequest.create = function create(properties) { - return new ListProcessorTypesRequest(properties); - }; - - /** - * Encodes the specified ListProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1.IListProcessorTypesRequest} message ListProcessorTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorTypesRequest.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 ListProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1.IListProcessorTypesRequest} message ListProcessorTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProcessorTypesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @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.ListProcessorTypesRequest} ListProcessorTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorTypesRequest.decode = function decode(reader, 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.ListProcessorTypesRequest(); - 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 ListProcessorTypesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ListProcessorTypesRequest} ListProcessorTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorTypesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProcessorTypesRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProcessorTypesRequest.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 ListProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ListProcessorTypesRequest} ListProcessorTypesRequest - */ - ListProcessorTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ListProcessorTypesRequest) - return object; - var message = new $root.google.cloud.documentai.v1.ListProcessorTypesRequest(); - 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 ListProcessorTypesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1.ListProcessorTypesRequest} message ListProcessorTypesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProcessorTypesRequest.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 ListProcessorTypesRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @instance - * @returns {Object.} JSON object - */ - ListProcessorTypesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProcessorTypesRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ListProcessorTypesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProcessorTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ListProcessorTypesRequest"; - }; - - return ListProcessorTypesRequest; - })(); - - v1.ListProcessorTypesResponse = (function() { - - /** - * Properties of a ListProcessorTypesResponse. - * @memberof google.cloud.documentai.v1 - * @interface IListProcessorTypesResponse - * @property {Array.|null} [processorTypes] ListProcessorTypesResponse processorTypes - * @property {string|null} [nextPageToken] ListProcessorTypesResponse nextPageToken - */ - - /** - * Constructs a new ListProcessorTypesResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ListProcessorTypesResponse. - * @implements IListProcessorTypesResponse - * @constructor - * @param {google.cloud.documentai.v1.IListProcessorTypesResponse=} [properties] Properties to set - */ - function ListProcessorTypesResponse(properties) { - this.processorTypes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListProcessorTypesResponse processorTypes. - * @member {Array.} processorTypes - * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse - * @instance - */ - ListProcessorTypesResponse.prototype.processorTypes = $util.emptyArray; - - /** - * ListProcessorTypesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse - * @instance - */ - ListProcessorTypesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListProcessorTypesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1.IListProcessorTypesResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ListProcessorTypesResponse} ListProcessorTypesResponse instance - */ - ListProcessorTypesResponse.create = function create(properties) { - return new ListProcessorTypesResponse(properties); - }; - - /** - * Encodes the specified ListProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1.IListProcessorTypesResponse} message ListProcessorTypesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorTypesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorTypes != null && message.processorTypes.length) - for (var i = 0; i < message.processorTypes.length; ++i) - $root.google.cloud.documentai.v1.ProcessorType.encode(message.processorTypes[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 ListProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorTypesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1.IListProcessorTypesResponse} message ListProcessorTypesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProcessorTypesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse - * @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.ListProcessorTypesResponse} ListProcessorTypesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorTypesResponse.decode = function decode(reader, 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.ListProcessorTypesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.processorTypes && message.processorTypes.length)) - message.processorTypes = []; - message.processorTypes.push($root.google.cloud.documentai.v1.ProcessorType.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListProcessorTypesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ListProcessorTypesResponse} ListProcessorTypesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorTypesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProcessorTypesResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProcessorTypesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorTypes != null && message.hasOwnProperty("processorTypes")) { - if (!Array.isArray(message.processorTypes)) - return "processorTypes: array expected"; - for (var i = 0; i < message.processorTypes.length; ++i) { - var error = $root.google.cloud.documentai.v1.ProcessorType.verify(message.processorTypes[i]); - if (error) - return "processorTypes." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ListProcessorTypesResponse} ListProcessorTypesResponse - */ - ListProcessorTypesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ListProcessorTypesResponse) - return object; - var message = new $root.google.cloud.documentai.v1.ListProcessorTypesResponse(); - if (object.processorTypes) { - if (!Array.isArray(object.processorTypes)) - throw TypeError(".google.cloud.documentai.v1.ListProcessorTypesResponse.processorTypes: array expected"); - message.processorTypes = []; - for (var i = 0; i < object.processorTypes.length; ++i) { - if (typeof object.processorTypes[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.ListProcessorTypesResponse.processorTypes: object expected"); - message.processorTypes[i] = $root.google.cloud.documentai.v1.ProcessorType.fromObject(object.processorTypes[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListProcessorTypesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1.ListProcessorTypesResponse} message ListProcessorTypesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProcessorTypesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.processorTypes = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.processorTypes && message.processorTypes.length) { - object.processorTypes = []; - for (var j = 0; j < message.processorTypes.length; ++j) - object.processorTypes[j] = $root.google.cloud.documentai.v1.ProcessorType.toObject(message.processorTypes[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListProcessorTypesResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse - * @instance - * @returns {Object.} JSON object - */ - ListProcessorTypesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProcessorTypesResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ListProcessorTypesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProcessorTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ListProcessorTypesResponse"; - }; - - return ListProcessorTypesResponse; - })(); - - v1.ListProcessorsRequest = (function() { - - /** - * Properties of a ListProcessorsRequest. - * @memberof google.cloud.documentai.v1 - * @interface IListProcessorsRequest - * @property {string|null} [parent] ListProcessorsRequest parent - * @property {number|null} [pageSize] ListProcessorsRequest pageSize - * @property {string|null} [pageToken] ListProcessorsRequest pageToken - */ - - /** - * Constructs a new ListProcessorsRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ListProcessorsRequest. - * @implements IListProcessorsRequest - * @constructor - * @param {google.cloud.documentai.v1.IListProcessorsRequest=} [properties] Properties to set - */ - function ListProcessorsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListProcessorsRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @instance - */ - ListProcessorsRequest.prototype.parent = ""; - - /** - * ListProcessorsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @instance - */ - ListProcessorsRequest.prototype.pageSize = 0; - - /** - * ListProcessorsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @instance - */ - ListProcessorsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListProcessorsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @static - * @param {google.cloud.documentai.v1.IListProcessorsRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ListProcessorsRequest} ListProcessorsRequest instance - */ - ListProcessorsRequest.create = function create(properties) { - return new ListProcessorsRequest(properties); - }; - - /** - * Encodes the specified ListProcessorsRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @static - * @param {google.cloud.documentai.v1.IListProcessorsRequest} message ListProcessorsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorsRequest.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 ListProcessorsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @static - * @param {google.cloud.documentai.v1.IListProcessorsRequest} message ListProcessorsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProcessorsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @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.ListProcessorsRequest} ListProcessorsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorsRequest.decode = function decode(reader, 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.ListProcessorsRequest(); - 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 ListProcessorsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ListProcessorsRequest} ListProcessorsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProcessorsRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProcessorsRequest.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 ListProcessorsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ListProcessorsRequest} ListProcessorsRequest - */ - ListProcessorsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ListProcessorsRequest) - return object; - var message = new $root.google.cloud.documentai.v1.ListProcessorsRequest(); - 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 ListProcessorsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @static - * @param {google.cloud.documentai.v1.ListProcessorsRequest} message ListProcessorsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProcessorsRequest.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 ListProcessorsRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @instance - * @returns {Object.} JSON object - */ - ListProcessorsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProcessorsRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ListProcessorsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProcessorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ListProcessorsRequest"; - }; - - return ListProcessorsRequest; - })(); - - v1.ListProcessorsResponse = (function() { - - /** - * Properties of a ListProcessorsResponse. - * @memberof google.cloud.documentai.v1 - * @interface IListProcessorsResponse - * @property {Array.|null} [processors] ListProcessorsResponse processors - * @property {string|null} [nextPageToken] ListProcessorsResponse nextPageToken - */ - - /** - * Constructs a new ListProcessorsResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ListProcessorsResponse. - * @implements IListProcessorsResponse - * @constructor - * @param {google.cloud.documentai.v1.IListProcessorsResponse=} [properties] Properties to set - */ - function ListProcessorsResponse(properties) { - this.processors = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListProcessorsResponse processors. - * @member {Array.} processors - * @memberof google.cloud.documentai.v1.ListProcessorsResponse - * @instance - */ - ListProcessorsResponse.prototype.processors = $util.emptyArray; - - /** - * ListProcessorsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.documentai.v1.ListProcessorsResponse - * @instance - */ - ListProcessorsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListProcessorsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ListProcessorsResponse - * @static - * @param {google.cloud.documentai.v1.IListProcessorsResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ListProcessorsResponse} ListProcessorsResponse instance - */ - ListProcessorsResponse.create = function create(properties) { - return new ListProcessorsResponse(properties); - }; - - /** - * Encodes the specified ListProcessorsResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ListProcessorsResponse - * @static - * @param {google.cloud.documentai.v1.IListProcessorsResponse} message ListProcessorsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processors != null && message.processors.length) - for (var i = 0; i < message.processors.length; ++i) - $root.google.cloud.documentai.v1.Processor.encode(message.processors[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 ListProcessorsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ListProcessorsResponse - * @static - * @param {google.cloud.documentai.v1.IListProcessorsResponse} message ListProcessorsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProcessorsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ListProcessorsResponse - * @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.ListProcessorsResponse} ListProcessorsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorsResponse.decode = function decode(reader, 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.ListProcessorsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.processors && message.processors.length)) - message.processors = []; - message.processors.push($root.google.cloud.documentai.v1.Processor.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListProcessorsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ListProcessorsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ListProcessorsResponse} ListProcessorsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProcessorsResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.ListProcessorsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProcessorsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processors != null && message.hasOwnProperty("processors")) { - if (!Array.isArray(message.processors)) - return "processors: array expected"; - for (var i = 0; i < message.processors.length; ++i) { - var error = $root.google.cloud.documentai.v1.Processor.verify(message.processors[i]); - if (error) - return "processors." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListProcessorsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ListProcessorsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ListProcessorsResponse} ListProcessorsResponse - */ - ListProcessorsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ListProcessorsResponse) - return object; - var message = new $root.google.cloud.documentai.v1.ListProcessorsResponse(); - if (object.processors) { - if (!Array.isArray(object.processors)) - throw TypeError(".google.cloud.documentai.v1.ListProcessorsResponse.processors: array expected"); - message.processors = []; - for (var i = 0; i < object.processors.length; ++i) { - if (typeof object.processors[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.ListProcessorsResponse.processors: object expected"); - message.processors[i] = $root.google.cloud.documentai.v1.Processor.fromObject(object.processors[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListProcessorsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ListProcessorsResponse - * @static - * @param {google.cloud.documentai.v1.ListProcessorsResponse} message ListProcessorsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProcessorsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.processors = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.processors && message.processors.length) { - object.processors = []; - for (var j = 0; j < message.processors.length; ++j) - object.processors[j] = $root.google.cloud.documentai.v1.Processor.toObject(message.processors[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListProcessorsResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ListProcessorsResponse - * @instance - * @returns {Object.} JSON object - */ - ListProcessorsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProcessorsResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ListProcessorsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProcessorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ListProcessorsResponse"; - }; - - return ListProcessorsResponse; - })(); - - v1.GetProcessorTypeRequest = (function() { - - /** - * Properties of a GetProcessorTypeRequest. - * @memberof google.cloud.documentai.v1 - * @interface IGetProcessorTypeRequest - * @property {string|null} [name] GetProcessorTypeRequest name - */ - - /** - * Constructs a new GetProcessorTypeRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a GetProcessorTypeRequest. - * @implements IGetProcessorTypeRequest - * @constructor - * @param {google.cloud.documentai.v1.IGetProcessorTypeRequest=} [properties] Properties to set - */ - function GetProcessorTypeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProcessorTypeRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest - * @instance - */ - GetProcessorTypeRequest.prototype.name = ""; - - /** - * Creates a new GetProcessorTypeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest - * @static - * @param {google.cloud.documentai.v1.IGetProcessorTypeRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.GetProcessorTypeRequest} GetProcessorTypeRequest instance - */ - GetProcessorTypeRequest.create = function create(properties) { - return new GetProcessorTypeRequest(properties); - }; - - /** - * Encodes the specified GetProcessorTypeRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorTypeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest - * @static - * @param {google.cloud.documentai.v1.IGetProcessorTypeRequest} message GetProcessorTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProcessorTypeRequest.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 GetProcessorTypeRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorTypeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest - * @static - * @param {google.cloud.documentai.v1.IGetProcessorTypeRequest} message GetProcessorTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProcessorTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProcessorTypeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest - * @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.GetProcessorTypeRequest} GetProcessorTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProcessorTypeRequest.decode = function decode(reader, 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.GetProcessorTypeRequest(); - 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 GetProcessorTypeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.GetProcessorTypeRequest} GetProcessorTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProcessorTypeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProcessorTypeRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProcessorTypeRequest.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 GetProcessorTypeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.GetProcessorTypeRequest} GetProcessorTypeRequest - */ - GetProcessorTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.GetProcessorTypeRequest) - return object; - var message = new $root.google.cloud.documentai.v1.GetProcessorTypeRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetProcessorTypeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest - * @static - * @param {google.cloud.documentai.v1.GetProcessorTypeRequest} message GetProcessorTypeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProcessorTypeRequest.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 GetProcessorTypeRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest - * @instance - * @returns {Object.} JSON object - */ - GetProcessorTypeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetProcessorTypeRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.GetProcessorTypeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetProcessorTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.GetProcessorTypeRequest"; - }; - - return GetProcessorTypeRequest; - })(); - - v1.GetProcessorRequest = (function() { - - /** - * Properties of a GetProcessorRequest. - * @memberof google.cloud.documentai.v1 - * @interface IGetProcessorRequest - * @property {string|null} [name] GetProcessorRequest name - */ - - /** - * Constructs a new GetProcessorRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a GetProcessorRequest. - * @implements IGetProcessorRequest - * @constructor - * @param {google.cloud.documentai.v1.IGetProcessorRequest=} [properties] Properties to set - */ - function GetProcessorRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProcessorRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1.GetProcessorRequest - * @instance - */ - GetProcessorRequest.prototype.name = ""; - - /** - * Creates a new GetProcessorRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.GetProcessorRequest - * @static - * @param {google.cloud.documentai.v1.IGetProcessorRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.GetProcessorRequest} GetProcessorRequest instance - */ - GetProcessorRequest.create = function create(properties) { - return new GetProcessorRequest(properties); - }; - - /** - * Encodes the specified GetProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.GetProcessorRequest - * @static - * @param {google.cloud.documentai.v1.IGetProcessorRequest} message GetProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProcessorRequest.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 GetProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.GetProcessorRequest - * @static - * @param {google.cloud.documentai.v1.IGetProcessorRequest} message GetProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProcessorRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.GetProcessorRequest - * @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.GetProcessorRequest} GetProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProcessorRequest.decode = function decode(reader, 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.GetProcessorRequest(); - 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 GetProcessorRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.GetProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.GetProcessorRequest} GetProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProcessorRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProcessorRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.GetProcessorRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProcessorRequest.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 GetProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.GetProcessorRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.GetProcessorRequest} GetProcessorRequest - */ - GetProcessorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.GetProcessorRequest) - return object; - var message = new $root.google.cloud.documentai.v1.GetProcessorRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetProcessorRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.GetProcessorRequest - * @static - * @param {google.cloud.documentai.v1.GetProcessorRequest} message GetProcessorRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProcessorRequest.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 GetProcessorRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.GetProcessorRequest - * @instance - * @returns {Object.} JSON object - */ - GetProcessorRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetProcessorRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.GetProcessorRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.GetProcessorRequest"; - }; - - return GetProcessorRequest; - })(); - - v1.GetProcessorVersionRequest = (function() { - - /** - * Properties of a GetProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @interface IGetProcessorVersionRequest - * @property {string|null} [name] GetProcessorVersionRequest name - */ - - /** - * Constructs a new GetProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a GetProcessorVersionRequest. - * @implements IGetProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1.IGetProcessorVersionRequest=} [properties] Properties to set - */ - function GetProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProcessorVersionRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest - * @instance - */ - GetProcessorVersionRequest.prototype.name = ""; - - /** - * Creates a new GetProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IGetProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.GetProcessorVersionRequest} GetProcessorVersionRequest instance - */ - GetProcessorVersionRequest.create = function create(properties) { - return new GetProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified GetProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IGetProcessorVersionRequest} message GetProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProcessorVersionRequest.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 GetProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IGetProcessorVersionRequest} message GetProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest - * @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.GetProcessorVersionRequest} GetProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProcessorVersionRequest.decode = function decode(reader, 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.GetProcessorVersionRequest(); - 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 GetProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.GetProcessorVersionRequest} GetProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProcessorVersionRequest.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 GetProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.GetProcessorVersionRequest} GetProcessorVersionRequest - */ - GetProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.GetProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1.GetProcessorVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.GetProcessorVersionRequest} message GetProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProcessorVersionRequest.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 GetProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - GetProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.GetProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.GetProcessorVersionRequest"; - }; - - return GetProcessorVersionRequest; - })(); - - v1.ListProcessorVersionsRequest = (function() { - - /** - * Properties of a ListProcessorVersionsRequest. - * @memberof google.cloud.documentai.v1 - * @interface IListProcessorVersionsRequest - * @property {string|null} [parent] ListProcessorVersionsRequest parent - * @property {number|null} [pageSize] ListProcessorVersionsRequest pageSize - * @property {string|null} [pageToken] ListProcessorVersionsRequest pageToken - */ - - /** - * Constructs a new ListProcessorVersionsRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ListProcessorVersionsRequest. - * @implements IListProcessorVersionsRequest - * @constructor - * @param {google.cloud.documentai.v1.IListProcessorVersionsRequest=} [properties] Properties to set - */ - function ListProcessorVersionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListProcessorVersionsRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @instance - */ - ListProcessorVersionsRequest.prototype.parent = ""; - - /** - * ListProcessorVersionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @instance - */ - ListProcessorVersionsRequest.prototype.pageSize = 0; - - /** - * ListProcessorVersionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @instance - */ - ListProcessorVersionsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListProcessorVersionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @static - * @param {google.cloud.documentai.v1.IListProcessorVersionsRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ListProcessorVersionsRequest} ListProcessorVersionsRequest instance - */ - ListProcessorVersionsRequest.create = function create(properties) { - return new ListProcessorVersionsRequest(properties); - }; - - /** - * Encodes the specified ListProcessorVersionsRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @static - * @param {google.cloud.documentai.v1.IListProcessorVersionsRequest} message ListProcessorVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorVersionsRequest.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 ListProcessorVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @static - * @param {google.cloud.documentai.v1.IListProcessorVersionsRequest} message ListProcessorVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProcessorVersionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @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.ListProcessorVersionsRequest} ListProcessorVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorVersionsRequest.decode = function decode(reader, 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.ListProcessorVersionsRequest(); - 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 ListProcessorVersionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ListProcessorVersionsRequest} ListProcessorVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorVersionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProcessorVersionsRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProcessorVersionsRequest.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 ListProcessorVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ListProcessorVersionsRequest} ListProcessorVersionsRequest - */ - ListProcessorVersionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ListProcessorVersionsRequest) - return object; - var message = new $root.google.cloud.documentai.v1.ListProcessorVersionsRequest(); - 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 ListProcessorVersionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @static - * @param {google.cloud.documentai.v1.ListProcessorVersionsRequest} message ListProcessorVersionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProcessorVersionsRequest.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 ListProcessorVersionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListProcessorVersionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProcessorVersionsRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ListProcessorVersionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProcessorVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ListProcessorVersionsRequest"; - }; - - return ListProcessorVersionsRequest; - })(); - - v1.ListProcessorVersionsResponse = (function() { - - /** - * Properties of a ListProcessorVersionsResponse. - * @memberof google.cloud.documentai.v1 - * @interface IListProcessorVersionsResponse - * @property {Array.|null} [processorVersions] ListProcessorVersionsResponse processorVersions - * @property {string|null} [nextPageToken] ListProcessorVersionsResponse nextPageToken - */ - - /** - * Constructs a new ListProcessorVersionsResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ListProcessorVersionsResponse. - * @implements IListProcessorVersionsResponse - * @constructor - * @param {google.cloud.documentai.v1.IListProcessorVersionsResponse=} [properties] Properties to set - */ - function ListProcessorVersionsResponse(properties) { - this.processorVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListProcessorVersionsResponse processorVersions. - * @member {Array.} processorVersions - * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse - * @instance - */ - ListProcessorVersionsResponse.prototype.processorVersions = $util.emptyArray; - - /** - * ListProcessorVersionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse - * @instance - */ - ListProcessorVersionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListProcessorVersionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse - * @static - * @param {google.cloud.documentai.v1.IListProcessorVersionsResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ListProcessorVersionsResponse} ListProcessorVersionsResponse instance - */ - ListProcessorVersionsResponse.create = function create(properties) { - return new ListProcessorVersionsResponse(properties); - }; - - /** - * Encodes the specified ListProcessorVersionsResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse - * @static - * @param {google.cloud.documentai.v1.IListProcessorVersionsResponse} message ListProcessorVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorVersionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorVersions != null && message.processorVersions.length) - for (var i = 0; i < message.processorVersions.length; ++i) - $root.google.cloud.documentai.v1.ProcessorVersion.encode(message.processorVersions[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 ListProcessorVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListProcessorVersionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse - * @static - * @param {google.cloud.documentai.v1.IListProcessorVersionsResponse} message ListProcessorVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse - * @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.ListProcessorVersionsResponse} ListProcessorVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorVersionsResponse.decode = function decode(reader, 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.ListProcessorVersionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.processorVersions && message.processorVersions.length)) - message.processorVersions = []; - message.processorVersions.push($root.google.cloud.documentai.v1.ProcessorVersion.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ListProcessorVersionsResponse} ListProcessorVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorVersionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProcessorVersionsResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProcessorVersionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorVersions != null && message.hasOwnProperty("processorVersions")) { - if (!Array.isArray(message.processorVersions)) - return "processorVersions: array expected"; - for (var i = 0; i < message.processorVersions.length; ++i) { - var error = $root.google.cloud.documentai.v1.ProcessorVersion.verify(message.processorVersions[i]); - if (error) - return "processorVersions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListProcessorVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ListProcessorVersionsResponse} ListProcessorVersionsResponse - */ - ListProcessorVersionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ListProcessorVersionsResponse) - return object; - var message = new $root.google.cloud.documentai.v1.ListProcessorVersionsResponse(); - if (object.processorVersions) { - if (!Array.isArray(object.processorVersions)) - throw TypeError(".google.cloud.documentai.v1.ListProcessorVersionsResponse.processorVersions: array expected"); - message.processorVersions = []; - for (var i = 0; i < object.processorVersions.length; ++i) { - if (typeof object.processorVersions[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.ListProcessorVersionsResponse.processorVersions: object expected"); - message.processorVersions[i] = $root.google.cloud.documentai.v1.ProcessorVersion.fromObject(object.processorVersions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListProcessorVersionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse - * @static - * @param {google.cloud.documentai.v1.ListProcessorVersionsResponse} message ListProcessorVersionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProcessorVersionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.processorVersions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.processorVersions && message.processorVersions.length) { - object.processorVersions = []; - for (var j = 0; j < message.processorVersions.length; ++j) - object.processorVersions[j] = $root.google.cloud.documentai.v1.ProcessorVersion.toObject(message.processorVersions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListProcessorVersionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListProcessorVersionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProcessorVersionsResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ListProcessorVersionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProcessorVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ListProcessorVersionsResponse"; - }; - - return ListProcessorVersionsResponse; - })(); - - v1.DeleteProcessorVersionRequest = (function() { - - /** - * Properties of a DeleteProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @interface IDeleteProcessorVersionRequest - * @property {string|null} [name] DeleteProcessorVersionRequest name - */ - - /** - * Constructs a new DeleteProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DeleteProcessorVersionRequest. - * @implements IDeleteProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1.IDeleteProcessorVersionRequest=} [properties] Properties to set - */ - function DeleteProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteProcessorVersionRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest - * @instance - */ - DeleteProcessorVersionRequest.prototype.name = ""; - - /** - * Creates a new DeleteProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IDeleteProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest instance - */ - DeleteProcessorVersionRequest.create = function create(properties) { - return new DeleteProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified DeleteProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IDeleteProcessorVersionRequest} message DeleteProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorVersionRequest.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 DeleteProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IDeleteProcessorVersionRequest} message DeleteProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest - * @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.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorVersionRequest.decode = function decode(reader, 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.DeleteProcessorVersionRequest(); - 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 DeleteProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteProcessorVersionRequest.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 DeleteProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest - */ - DeleteProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DeleteProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1.DeleteProcessorVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.DeleteProcessorVersionRequest} message DeleteProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteProcessorVersionRequest.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 DeleteProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DeleteProcessorVersionRequest"; - }; - - return DeleteProcessorVersionRequest; - })(); - - v1.DeleteProcessorVersionMetadata = (function() { - - /** - * Properties of a DeleteProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1 - * @interface IDeleteProcessorVersionMetadata - * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] DeleteProcessorVersionMetadata commonMetadata - */ - - /** - * Constructs a new DeleteProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DeleteProcessorVersionMetadata. - * @implements IDeleteProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1.IDeleteProcessorVersionMetadata=} [properties] Properties to set - */ - function DeleteProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata - * @instance - */ - DeleteProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * Creates a new DeleteProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.IDeleteProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata instance - */ - DeleteProcessorVersionMetadata.create = function create(properties) { - return new DeleteProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified DeleteProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.IDeleteProcessorVersionMetadata} message DeleteProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DeleteProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.IDeleteProcessorVersionMetadata} message DeleteProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata - * @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.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorVersionMetadata.decode = function decode(reader, 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.DeleteProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates a DeleteProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata - */ - DeleteProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DeleteProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1.DeleteProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1.DeleteProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from a DeleteProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.DeleteProcessorVersionMetadata} message DeleteProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this DeleteProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - DeleteProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DeleteProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DeleteProcessorVersionMetadata"; - }; - - return DeleteProcessorVersionMetadata; - })(); - - v1.DeployProcessorVersionRequest = (function() { - - /** - * Properties of a DeployProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @interface IDeployProcessorVersionRequest - * @property {string|null} [name] DeployProcessorVersionRequest name - */ - - /** - * Constructs a new DeployProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DeployProcessorVersionRequest. - * @implements IDeployProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1.IDeployProcessorVersionRequest=} [properties] Properties to set - */ - function DeployProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeployProcessorVersionRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest - * @instance - */ - DeployProcessorVersionRequest.prototype.name = ""; - - /** - * Creates a new DeployProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IDeployProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DeployProcessorVersionRequest} DeployProcessorVersionRequest instance - */ - DeployProcessorVersionRequest.create = function create(properties) { - return new DeployProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified DeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IDeployProcessorVersionRequest} message DeployProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployProcessorVersionRequest.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 DeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IDeployProcessorVersionRequest} message DeployProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeployProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest - * @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.DeployProcessorVersionRequest} DeployProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployProcessorVersionRequest.decode = function decode(reader, 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.DeployProcessorVersionRequest(); - 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 DeployProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DeployProcessorVersionRequest} DeployProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeployProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeployProcessorVersionRequest.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 DeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DeployProcessorVersionRequest} DeployProcessorVersionRequest - */ - DeployProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DeployProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1.DeployProcessorVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeployProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.DeployProcessorVersionRequest} message DeployProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeployProcessorVersionRequest.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 DeployProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - DeployProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeployProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DeployProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeployProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DeployProcessorVersionRequest"; - }; - - return DeployProcessorVersionRequest; - })(); - - v1.DeployProcessorVersionResponse = (function() { - - /** - * Properties of a DeployProcessorVersionResponse. - * @memberof google.cloud.documentai.v1 - * @interface IDeployProcessorVersionResponse - */ - - /** - * Constructs a new DeployProcessorVersionResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DeployProcessorVersionResponse. - * @implements IDeployProcessorVersionResponse - * @constructor - * @param {google.cloud.documentai.v1.IDeployProcessorVersionResponse=} [properties] Properties to set - */ - function DeployProcessorVersionResponse(properties) { - if (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 DeployProcessorVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.IDeployProcessorVersionResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DeployProcessorVersionResponse} DeployProcessorVersionResponse instance - */ - DeployProcessorVersionResponse.create = function create(properties) { - return new DeployProcessorVersionResponse(properties); - }; - - /** - * Encodes the specified DeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.IDeployProcessorVersionResponse} message DeployProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployProcessorVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified DeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.IDeployProcessorVersionResponse} message DeployProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeployProcessorVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse - * @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.DeployProcessorVersionResponse} DeployProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployProcessorVersionResponse.decode = function decode(reader, 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.DeployProcessorVersionResponse(); - 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 DeployProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DeployProcessorVersionResponse} DeployProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeployProcessorVersionResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeployProcessorVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a DeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DeployProcessorVersionResponse} DeployProcessorVersionResponse - */ - DeployProcessorVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DeployProcessorVersionResponse) - return object; - return new $root.google.cloud.documentai.v1.DeployProcessorVersionResponse(); - }; - - /** - * Creates a plain object from a DeployProcessorVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.DeployProcessorVersionResponse} message DeployProcessorVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeployProcessorVersionResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this DeployProcessorVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse - * @instance - * @returns {Object.} JSON object - */ - DeployProcessorVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeployProcessorVersionResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DeployProcessorVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeployProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DeployProcessorVersionResponse"; - }; - - return DeployProcessorVersionResponse; - })(); - - v1.DeployProcessorVersionMetadata = (function() { - - /** - * Properties of a DeployProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1 - * @interface IDeployProcessorVersionMetadata - * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] DeployProcessorVersionMetadata commonMetadata - */ - - /** - * Constructs a new DeployProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DeployProcessorVersionMetadata. - * @implements IDeployProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1.IDeployProcessorVersionMetadata=} [properties] Properties to set - */ - function DeployProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeployProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata - * @instance - */ - DeployProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * Creates a new DeployProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.IDeployProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata instance - */ - DeployProcessorVersionMetadata.create = function create(properties) { - return new DeployProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified DeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.IDeployProcessorVersionMetadata} message DeployProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeployProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.IDeployProcessorVersionMetadata} message DeployProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata - * @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.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployProcessorVersionMetadata.decode = function decode(reader, 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.DeployProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeployProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeployProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates a DeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata - */ - DeployProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DeployProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1.DeployProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1.DeployProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from a DeployProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.DeployProcessorVersionMetadata} message DeployProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeployProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this DeployProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - DeployProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeployProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DeployProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeployProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DeployProcessorVersionMetadata"; - }; - - return DeployProcessorVersionMetadata; - })(); - - v1.UndeployProcessorVersionRequest = (function() { - - /** - * Properties of an UndeployProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @interface IUndeployProcessorVersionRequest - * @property {string|null} [name] UndeployProcessorVersionRequest name - */ - - /** - * Constructs a new UndeployProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents an UndeployProcessorVersionRequest. - * @implements IUndeployProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionRequest=} [properties] Properties to set - */ - function UndeployProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UndeployProcessorVersionRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest - * @instance - */ - UndeployProcessorVersionRequest.prototype.name = ""; - - /** - * Creates a new UndeployProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest instance - */ - UndeployProcessorVersionRequest.create = function create(properties) { - return new UndeployProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified UndeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionRequest} message UndeployProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeployProcessorVersionRequest.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 UndeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionRequest} message UndeployProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeployProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UndeployProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest - * @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.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeployProcessorVersionRequest.decode = function decode(reader, 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.UndeployProcessorVersionRequest(); - 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 an UndeployProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeployProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UndeployProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UndeployProcessorVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates an UndeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest - */ - UndeployProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.UndeployProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1.UndeployProcessorVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an UndeployProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.UndeployProcessorVersionRequest} message UndeployProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UndeployProcessorVersionRequest.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 UndeployProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - UndeployProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UndeployProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UndeployProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.UndeployProcessorVersionRequest"; - }; - - return UndeployProcessorVersionRequest; - })(); - - v1.UndeployProcessorVersionResponse = (function() { - - /** - * Properties of an UndeployProcessorVersionResponse. - * @memberof google.cloud.documentai.v1 - * @interface IUndeployProcessorVersionResponse - */ - - /** - * Constructs a new UndeployProcessorVersionResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents an UndeployProcessorVersionResponse. - * @implements IUndeployProcessorVersionResponse - * @constructor - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionResponse=} [properties] Properties to set - */ - function UndeployProcessorVersionResponse(properties) { - if (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 UndeployProcessorVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse instance - */ - UndeployProcessorVersionResponse.create = function create(properties) { - return new UndeployProcessorVersionResponse(properties); - }; - - /** - * Encodes the specified UndeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionResponse} message UndeployProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeployProcessorVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified UndeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionResponse} message UndeployProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeployProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UndeployProcessorVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse - * @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.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeployProcessorVersionResponse.decode = function decode(reader, 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.UndeployProcessorVersionResponse(); - 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 UndeployProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeployProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UndeployProcessorVersionResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UndeployProcessorVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an UndeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse - */ - UndeployProcessorVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.UndeployProcessorVersionResponse) - return object; - return new $root.google.cloud.documentai.v1.UndeployProcessorVersionResponse(); - }; - - /** - * Creates a plain object from an UndeployProcessorVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.UndeployProcessorVersionResponse} message UndeployProcessorVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UndeployProcessorVersionResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this UndeployProcessorVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse - * @instance - * @returns {Object.} JSON object - */ - UndeployProcessorVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UndeployProcessorVersionResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UndeployProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.UndeployProcessorVersionResponse"; - }; - - return UndeployProcessorVersionResponse; - })(); - - v1.UndeployProcessorVersionMetadata = (function() { - - /** - * Properties of an UndeployProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1 - * @interface IUndeployProcessorVersionMetadata - * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] UndeployProcessorVersionMetadata commonMetadata - */ - - /** - * Constructs a new UndeployProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents an UndeployProcessorVersionMetadata. - * @implements IUndeployProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionMetadata=} [properties] Properties to set - */ - function UndeployProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UndeployProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata - * @instance - */ - UndeployProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * Creates a new UndeployProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata instance - */ - UndeployProcessorVersionMetadata.create = function create(properties) { - return new UndeployProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified UndeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionMetadata} message UndeployProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeployProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UndeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.UndeployProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.IUndeployProcessorVersionMetadata} message UndeployProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeployProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata - * @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.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeployProcessorVersionMetadata.decode = function decode(reader, 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.UndeployProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeployProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UndeployProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UndeployProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates an UndeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata - */ - UndeployProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.UndeployProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1.UndeployProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1.UndeployProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from an UndeployProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.UndeployProcessorVersionMetadata} message UndeployProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UndeployProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this UndeployProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - UndeployProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UndeployProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.UndeployProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UndeployProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.UndeployProcessorVersionMetadata"; - }; - - return UndeployProcessorVersionMetadata; - })(); - - v1.CreateProcessorRequest = (function() { - - /** - * Properties of a CreateProcessorRequest. - * @memberof google.cloud.documentai.v1 - * @interface ICreateProcessorRequest - * @property {string|null} [parent] CreateProcessorRequest parent - * @property {google.cloud.documentai.v1.IProcessor|null} [processor] CreateProcessorRequest processor - */ - - /** - * Constructs a new CreateProcessorRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a CreateProcessorRequest. - * @implements ICreateProcessorRequest - * @constructor - * @param {google.cloud.documentai.v1.ICreateProcessorRequest=} [properties] Properties to set - */ - function CreateProcessorRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateProcessorRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1.CreateProcessorRequest - * @instance - */ - CreateProcessorRequest.prototype.parent = ""; - - /** - * CreateProcessorRequest processor. - * @member {google.cloud.documentai.v1.IProcessor|null|undefined} processor - * @memberof google.cloud.documentai.v1.CreateProcessorRequest - * @instance - */ - CreateProcessorRequest.prototype.processor = null; - - /** - * Creates a new CreateProcessorRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.CreateProcessorRequest - * @static - * @param {google.cloud.documentai.v1.ICreateProcessorRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.CreateProcessorRequest} CreateProcessorRequest instance - */ - CreateProcessorRequest.create = function create(properties) { - return new CreateProcessorRequest(properties); - }; - - /** - * Encodes the specified CreateProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.CreateProcessorRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.CreateProcessorRequest - * @static - * @param {google.cloud.documentai.v1.ICreateProcessorRequest} message CreateProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateProcessorRequest.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.processor != null && Object.hasOwnProperty.call(message, "processor")) - $root.google.cloud.documentai.v1.Processor.encode(message.processor, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.CreateProcessorRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.CreateProcessorRequest - * @static - * @param {google.cloud.documentai.v1.ICreateProcessorRequest} message CreateProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateProcessorRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.CreateProcessorRequest - * @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.CreateProcessorRequest} CreateProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateProcessorRequest.decode = function decode(reader, 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.CreateProcessorRequest(); - 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.processor = $root.google.cloud.documentai.v1.Processor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateProcessorRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.CreateProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.CreateProcessorRequest} CreateProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateProcessorRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateProcessorRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.CreateProcessorRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateProcessorRequest.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.processor != null && message.hasOwnProperty("processor")) { - var error = $root.google.cloud.documentai.v1.Processor.verify(message.processor); - if (error) - return "processor." + error; - } - return null; - }; - - /** - * Creates a CreateProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.CreateProcessorRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.CreateProcessorRequest} CreateProcessorRequest - */ - CreateProcessorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.CreateProcessorRequest) - return object; - var message = new $root.google.cloud.documentai.v1.CreateProcessorRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.processor != null) { - if (typeof object.processor !== "object") - throw TypeError(".google.cloud.documentai.v1.CreateProcessorRequest.processor: object expected"); - message.processor = $root.google.cloud.documentai.v1.Processor.fromObject(object.processor); - } - return message; - }; - - /** - * Creates a plain object from a CreateProcessorRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.CreateProcessorRequest - * @static - * @param {google.cloud.documentai.v1.CreateProcessorRequest} message CreateProcessorRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateProcessorRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.processor = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.processor != null && message.hasOwnProperty("processor")) - object.processor = $root.google.cloud.documentai.v1.Processor.toObject(message.processor, options); - return object; - }; - - /** - * Converts this CreateProcessorRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.CreateProcessorRequest - * @instance - * @returns {Object.} JSON object - */ - CreateProcessorRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateProcessorRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.CreateProcessorRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.CreateProcessorRequest"; - }; - - return CreateProcessorRequest; - })(); - - v1.DeleteProcessorRequest = (function() { - - /** - * Properties of a DeleteProcessorRequest. - * @memberof google.cloud.documentai.v1 - * @interface IDeleteProcessorRequest - * @property {string|null} [name] DeleteProcessorRequest name - */ - - /** - * Constructs a new DeleteProcessorRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DeleteProcessorRequest. - * @implements IDeleteProcessorRequest - * @constructor - * @param {google.cloud.documentai.v1.IDeleteProcessorRequest=} [properties] Properties to set - */ - function DeleteProcessorRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteProcessorRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1.DeleteProcessorRequest - * @instance - */ - DeleteProcessorRequest.prototype.name = ""; - - /** - * Creates a new DeleteProcessorRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DeleteProcessorRequest - * @static - * @param {google.cloud.documentai.v1.IDeleteProcessorRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DeleteProcessorRequest} DeleteProcessorRequest instance - */ - DeleteProcessorRequest.create = function create(properties) { - return new DeleteProcessorRequest(properties); - }; - - /** - * Encodes the specified DeleteProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DeleteProcessorRequest - * @static - * @param {google.cloud.documentai.v1.IDeleteProcessorRequest} message DeleteProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorRequest.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 DeleteProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DeleteProcessorRequest - * @static - * @param {google.cloud.documentai.v1.IDeleteProcessorRequest} message DeleteProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteProcessorRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DeleteProcessorRequest - * @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.DeleteProcessorRequest} DeleteProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorRequest.decode = function decode(reader, 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.DeleteProcessorRequest(); - 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 DeleteProcessorRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DeleteProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DeleteProcessorRequest} DeleteProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteProcessorRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.DeleteProcessorRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteProcessorRequest.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 DeleteProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DeleteProcessorRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DeleteProcessorRequest} DeleteProcessorRequest - */ - DeleteProcessorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DeleteProcessorRequest) - return object; - var message = new $root.google.cloud.documentai.v1.DeleteProcessorRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteProcessorRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DeleteProcessorRequest - * @static - * @param {google.cloud.documentai.v1.DeleteProcessorRequest} message DeleteProcessorRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteProcessorRequest.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 DeleteProcessorRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DeleteProcessorRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteProcessorRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteProcessorRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DeleteProcessorRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DeleteProcessorRequest"; - }; - - return DeleteProcessorRequest; - })(); - - v1.DeleteProcessorMetadata = (function() { - - /** - * Properties of a DeleteProcessorMetadata. - * @memberof google.cloud.documentai.v1 - * @interface IDeleteProcessorMetadata - * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] DeleteProcessorMetadata commonMetadata - */ - - /** - * Constructs a new DeleteProcessorMetadata. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DeleteProcessorMetadata. - * @implements IDeleteProcessorMetadata - * @constructor - * @param {google.cloud.documentai.v1.IDeleteProcessorMetadata=} [properties] Properties to set - */ - function DeleteProcessorMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteProcessorMetadata commonMetadata. - * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata - * @instance - */ - DeleteProcessorMetadata.prototype.commonMetadata = null; - - /** - * Creates a new DeleteProcessorMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata - * @static - * @param {google.cloud.documentai.v1.IDeleteProcessorMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DeleteProcessorMetadata} DeleteProcessorMetadata instance - */ - DeleteProcessorMetadata.create = function create(properties) { - return new DeleteProcessorMetadata(properties); - }; - - /** - * Encodes the specified DeleteProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata - * @static - * @param {google.cloud.documentai.v1.IDeleteProcessorMetadata} message DeleteProcessorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DeleteProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DeleteProcessorMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata - * @static - * @param {google.cloud.documentai.v1.IDeleteProcessorMetadata} message DeleteProcessorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteProcessorMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata - * @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.DeleteProcessorMetadata} DeleteProcessorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorMetadata.decode = function decode(reader, 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.DeleteProcessorMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteProcessorMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DeleteProcessorMetadata} DeleteProcessorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteProcessorMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteProcessorMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates a DeleteProcessorMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DeleteProcessorMetadata} DeleteProcessorMetadata - */ - DeleteProcessorMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DeleteProcessorMetadata) - return object; - var message = new $root.google.cloud.documentai.v1.DeleteProcessorMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1.DeleteProcessorMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from a DeleteProcessorMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata - * @static - * @param {google.cloud.documentai.v1.DeleteProcessorMetadata} message DeleteProcessorMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteProcessorMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this DeleteProcessorMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata - * @instance - * @returns {Object.} JSON object - */ - DeleteProcessorMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteProcessorMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DeleteProcessorMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteProcessorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DeleteProcessorMetadata"; - }; - - return DeleteProcessorMetadata; - })(); - - v1.EnableProcessorRequest = (function() { - - /** - * Properties of an EnableProcessorRequest. - * @memberof google.cloud.documentai.v1 - * @interface IEnableProcessorRequest - * @property {string|null} [name] EnableProcessorRequest name - */ - - /** - * Constructs a new EnableProcessorRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents an EnableProcessorRequest. - * @implements IEnableProcessorRequest - * @constructor - * @param {google.cloud.documentai.v1.IEnableProcessorRequest=} [properties] Properties to set - */ - function EnableProcessorRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnableProcessorRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1.EnableProcessorRequest - * @instance - */ - EnableProcessorRequest.prototype.name = ""; - - /** - * Creates a new EnableProcessorRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.EnableProcessorRequest - * @static - * @param {google.cloud.documentai.v1.IEnableProcessorRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.EnableProcessorRequest} EnableProcessorRequest instance - */ - EnableProcessorRequest.create = function create(properties) { - return new EnableProcessorRequest(properties); - }; - - /** - * Encodes the specified EnableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.EnableProcessorRequest - * @static - * @param {google.cloud.documentai.v1.IEnableProcessorRequest} message EnableProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProcessorRequest.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 EnableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.EnableProcessorRequest - * @static - * @param {google.cloud.documentai.v1.IEnableProcessorRequest} message EnableProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnableProcessorRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.EnableProcessorRequest - * @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.EnableProcessorRequest} EnableProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProcessorRequest.decode = function decode(reader, 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.EnableProcessorRequest(); - 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 an EnableProcessorRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.EnableProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.EnableProcessorRequest} EnableProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProcessorRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnableProcessorRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.EnableProcessorRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnableProcessorRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates an EnableProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.EnableProcessorRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.EnableProcessorRequest} EnableProcessorRequest - */ - EnableProcessorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.EnableProcessorRequest) - return object; - var message = new $root.google.cloud.documentai.v1.EnableProcessorRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an EnableProcessorRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.EnableProcessorRequest - * @static - * @param {google.cloud.documentai.v1.EnableProcessorRequest} message EnableProcessorRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnableProcessorRequest.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 EnableProcessorRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.EnableProcessorRequest - * @instance - * @returns {Object.} JSON object - */ - EnableProcessorRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnableProcessorRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.EnableProcessorRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnableProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.EnableProcessorRequest"; - }; - - return EnableProcessorRequest; - })(); - - v1.EnableProcessorResponse = (function() { - - /** - * Properties of an EnableProcessorResponse. - * @memberof google.cloud.documentai.v1 - * @interface IEnableProcessorResponse - */ - - /** - * Constructs a new EnableProcessorResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents an EnableProcessorResponse. - * @implements IEnableProcessorResponse - * @constructor - * @param {google.cloud.documentai.v1.IEnableProcessorResponse=} [properties] Properties to set - */ - function EnableProcessorResponse(properties) { - if (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 EnableProcessorResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.EnableProcessorResponse - * @static - * @param {google.cloud.documentai.v1.IEnableProcessorResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.EnableProcessorResponse} EnableProcessorResponse instance - */ - EnableProcessorResponse.create = function create(properties) { - return new EnableProcessorResponse(properties); - }; - - /** - * Encodes the specified EnableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.EnableProcessorResponse - * @static - * @param {google.cloud.documentai.v1.IEnableProcessorResponse} message EnableProcessorResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProcessorResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified EnableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.EnableProcessorResponse - * @static - * @param {google.cloud.documentai.v1.IEnableProcessorResponse} message EnableProcessorResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProcessorResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnableProcessorResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.EnableProcessorResponse - * @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.EnableProcessorResponse} EnableProcessorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProcessorResponse.decode = function decode(reader, 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.EnableProcessorResponse(); - 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 EnableProcessorResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.EnableProcessorResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.EnableProcessorResponse} EnableProcessorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProcessorResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnableProcessorResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.EnableProcessorResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnableProcessorResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an EnableProcessorResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.EnableProcessorResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.EnableProcessorResponse} EnableProcessorResponse - */ - EnableProcessorResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.EnableProcessorResponse) - return object; - return new $root.google.cloud.documentai.v1.EnableProcessorResponse(); - }; - - /** - * Creates a plain object from an EnableProcessorResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.EnableProcessorResponse - * @static - * @param {google.cloud.documentai.v1.EnableProcessorResponse} message EnableProcessorResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnableProcessorResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this EnableProcessorResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.EnableProcessorResponse - * @instance - * @returns {Object.} JSON object - */ - EnableProcessorResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnableProcessorResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.EnableProcessorResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnableProcessorResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.EnableProcessorResponse"; - }; - - return EnableProcessorResponse; - })(); - - v1.EnableProcessorMetadata = (function() { - - /** - * Properties of an EnableProcessorMetadata. - * @memberof google.cloud.documentai.v1 - * @interface IEnableProcessorMetadata - * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] EnableProcessorMetadata commonMetadata - */ - - /** - * Constructs a new EnableProcessorMetadata. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents an EnableProcessorMetadata. - * @implements IEnableProcessorMetadata - * @constructor - * @param {google.cloud.documentai.v1.IEnableProcessorMetadata=} [properties] Properties to set - */ - function EnableProcessorMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnableProcessorMetadata commonMetadata. - * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1.EnableProcessorMetadata - * @instance - */ - EnableProcessorMetadata.prototype.commonMetadata = null; - - /** - * Creates a new EnableProcessorMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.EnableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1.IEnableProcessorMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.EnableProcessorMetadata} EnableProcessorMetadata instance - */ - EnableProcessorMetadata.create = function create(properties) { - return new EnableProcessorMetadata(properties); - }; - - /** - * Encodes the specified EnableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.EnableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1.IEnableProcessorMetadata} message EnableProcessorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProcessorMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EnableProcessorMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.EnableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1.IEnableProcessorMetadata} message EnableProcessorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProcessorMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnableProcessorMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.EnableProcessorMetadata - * @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.EnableProcessorMetadata} EnableProcessorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProcessorMetadata.decode = function decode(reader, 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.EnableProcessorMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnableProcessorMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.EnableProcessorMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.EnableProcessorMetadata} EnableProcessorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProcessorMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnableProcessorMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1.EnableProcessorMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnableProcessorMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates an EnableProcessorMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.EnableProcessorMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.EnableProcessorMetadata} EnableProcessorMetadata - */ - EnableProcessorMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.EnableProcessorMetadata) - return object; - var message = new $root.google.cloud.documentai.v1.EnableProcessorMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1.EnableProcessorMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from an EnableProcessorMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.EnableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1.EnableProcessorMetadata} message EnableProcessorMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnableProcessorMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this EnableProcessorMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.EnableProcessorMetadata - * @instance - * @returns {Object.} JSON object - */ - EnableProcessorMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnableProcessorMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.EnableProcessorMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnableProcessorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.EnableProcessorMetadata"; - }; - - return EnableProcessorMetadata; - })(); - - v1.DisableProcessorRequest = (function() { - - /** - * Properties of a DisableProcessorRequest. - * @memberof google.cloud.documentai.v1 - * @interface IDisableProcessorRequest - * @property {string|null} [name] DisableProcessorRequest name - */ - - /** - * Constructs a new DisableProcessorRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DisableProcessorRequest. - * @implements IDisableProcessorRequest - * @constructor - * @param {google.cloud.documentai.v1.IDisableProcessorRequest=} [properties] Properties to set - */ - function DisableProcessorRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DisableProcessorRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1.DisableProcessorRequest - * @instance - */ - DisableProcessorRequest.prototype.name = ""; - - /** - * Creates a new DisableProcessorRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DisableProcessorRequest - * @static - * @param {google.cloud.documentai.v1.IDisableProcessorRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DisableProcessorRequest} DisableProcessorRequest instance - */ - DisableProcessorRequest.create = function create(properties) { - return new DisableProcessorRequest(properties); - }; - - /** - * Encodes the specified DisableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DisableProcessorRequest - * @static - * @param {google.cloud.documentai.v1.IDisableProcessorRequest} message DisableProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProcessorRequest.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 DisableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DisableProcessorRequest - * @static - * @param {google.cloud.documentai.v1.IDisableProcessorRequest} message DisableProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisableProcessorRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DisableProcessorRequest - * @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.DisableProcessorRequest} DisableProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProcessorRequest.decode = function decode(reader, 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.DisableProcessorRequest(); - 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 DisableProcessorRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DisableProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DisableProcessorRequest} DisableProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProcessorRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisableProcessorRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.DisableProcessorRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisableProcessorRequest.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 DisableProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DisableProcessorRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DisableProcessorRequest} DisableProcessorRequest - */ - DisableProcessorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DisableProcessorRequest) - return object; - var message = new $root.google.cloud.documentai.v1.DisableProcessorRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DisableProcessorRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DisableProcessorRequest - * @static - * @param {google.cloud.documentai.v1.DisableProcessorRequest} message DisableProcessorRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisableProcessorRequest.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 DisableProcessorRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DisableProcessorRequest - * @instance - * @returns {Object.} JSON object - */ - DisableProcessorRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisableProcessorRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DisableProcessorRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisableProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DisableProcessorRequest"; - }; - - return DisableProcessorRequest; - })(); - - v1.DisableProcessorResponse = (function() { - - /** - * Properties of a DisableProcessorResponse. - * @memberof google.cloud.documentai.v1 - * @interface IDisableProcessorResponse - */ - - /** - * Constructs a new DisableProcessorResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DisableProcessorResponse. - * @implements IDisableProcessorResponse - * @constructor - * @param {google.cloud.documentai.v1.IDisableProcessorResponse=} [properties] Properties to set - */ - function DisableProcessorResponse(properties) { - if (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 DisableProcessorResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DisableProcessorResponse - * @static - * @param {google.cloud.documentai.v1.IDisableProcessorResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DisableProcessorResponse} DisableProcessorResponse instance - */ - DisableProcessorResponse.create = function create(properties) { - return new DisableProcessorResponse(properties); - }; - - /** - * Encodes the specified DisableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DisableProcessorResponse - * @static - * @param {google.cloud.documentai.v1.IDisableProcessorResponse} message DisableProcessorResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProcessorResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified DisableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DisableProcessorResponse - * @static - * @param {google.cloud.documentai.v1.IDisableProcessorResponse} message DisableProcessorResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProcessorResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisableProcessorResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DisableProcessorResponse - * @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.DisableProcessorResponse} DisableProcessorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProcessorResponse.decode = function decode(reader, 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.DisableProcessorResponse(); - 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 DisableProcessorResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DisableProcessorResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DisableProcessorResponse} DisableProcessorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProcessorResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisableProcessorResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.DisableProcessorResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisableProcessorResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a DisableProcessorResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DisableProcessorResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DisableProcessorResponse} DisableProcessorResponse - */ - DisableProcessorResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DisableProcessorResponse) - return object; - return new $root.google.cloud.documentai.v1.DisableProcessorResponse(); - }; - - /** - * Creates a plain object from a DisableProcessorResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DisableProcessorResponse - * @static - * @param {google.cloud.documentai.v1.DisableProcessorResponse} message DisableProcessorResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisableProcessorResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this DisableProcessorResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DisableProcessorResponse - * @instance - * @returns {Object.} JSON object - */ - DisableProcessorResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisableProcessorResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DisableProcessorResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisableProcessorResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DisableProcessorResponse"; - }; - - return DisableProcessorResponse; - })(); - - v1.DisableProcessorMetadata = (function() { - - /** - * Properties of a DisableProcessorMetadata. - * @memberof google.cloud.documentai.v1 - * @interface IDisableProcessorMetadata - * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] DisableProcessorMetadata commonMetadata - */ - - /** - * Constructs a new DisableProcessorMetadata. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DisableProcessorMetadata. - * @implements IDisableProcessorMetadata - * @constructor - * @param {google.cloud.documentai.v1.IDisableProcessorMetadata=} [properties] Properties to set - */ - function DisableProcessorMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DisableProcessorMetadata commonMetadata. - * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1.DisableProcessorMetadata - * @instance - */ - DisableProcessorMetadata.prototype.commonMetadata = null; - - /** - * Creates a new DisableProcessorMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DisableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1.IDisableProcessorMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DisableProcessorMetadata} DisableProcessorMetadata instance - */ - DisableProcessorMetadata.create = function create(properties) { - return new DisableProcessorMetadata(properties); - }; - - /** - * Encodes the specified DisableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DisableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1.IDisableProcessorMetadata} message DisableProcessorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProcessorMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DisableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DisableProcessorMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DisableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1.IDisableProcessorMetadata} message DisableProcessorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProcessorMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisableProcessorMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DisableProcessorMetadata - * @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.DisableProcessorMetadata} DisableProcessorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProcessorMetadata.decode = function decode(reader, 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.DisableProcessorMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DisableProcessorMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DisableProcessorMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DisableProcessorMetadata} DisableProcessorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProcessorMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisableProcessorMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1.DisableProcessorMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisableProcessorMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates a DisableProcessorMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DisableProcessorMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DisableProcessorMetadata} DisableProcessorMetadata - */ - DisableProcessorMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DisableProcessorMetadata) - return object; - var message = new $root.google.cloud.documentai.v1.DisableProcessorMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1.DisableProcessorMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from a DisableProcessorMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DisableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1.DisableProcessorMetadata} message DisableProcessorMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisableProcessorMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this DisableProcessorMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DisableProcessorMetadata - * @instance - * @returns {Object.} JSON object - */ - DisableProcessorMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisableProcessorMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DisableProcessorMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisableProcessorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DisableProcessorMetadata"; - }; - - return DisableProcessorMetadata; - })(); - - v1.SetDefaultProcessorVersionRequest = (function() { - - /** - * Properties of a SetDefaultProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @interface ISetDefaultProcessorVersionRequest - * @property {string|null} [processor] SetDefaultProcessorVersionRequest processor - * @property {string|null} [defaultProcessorVersion] SetDefaultProcessorVersionRequest defaultProcessorVersion - */ - - /** - * Constructs a new SetDefaultProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a SetDefaultProcessorVersionRequest. - * @implements ISetDefaultProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest=} [properties] Properties to set - */ - function SetDefaultProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SetDefaultProcessorVersionRequest processor. - * @member {string} processor - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - * @instance - */ - SetDefaultProcessorVersionRequest.prototype.processor = ""; - - /** - * SetDefaultProcessorVersionRequest defaultProcessorVersion. - * @member {string} defaultProcessorVersion - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - * @instance - */ - SetDefaultProcessorVersionRequest.prototype.defaultProcessorVersion = ""; - - /** - * Creates a new SetDefaultProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest instance - */ - SetDefaultProcessorVersionRequest.create = function create(properties) { - return new SetDefaultProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified SetDefaultProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest} message SetDefaultProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultProcessorVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processor != null && Object.hasOwnProperty.call(message, "processor")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.processor); - if (message.defaultProcessorVersion != null && Object.hasOwnProperty.call(message, "defaultProcessorVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.defaultProcessorVersion); - return writer; - }; - - /** - * Encodes the specified SetDefaultProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest} message SetDefaultProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - * @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.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultProcessorVersionRequest.decode = function decode(reader, 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.SetDefaultProcessorVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.processor = reader.string(); - break; - } - case 2: { - message.defaultProcessorVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetDefaultProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetDefaultProcessorVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processor != null && message.hasOwnProperty("processor")) - if (!$util.isString(message.processor)) - return "processor: string expected"; - if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) - if (!$util.isString(message.defaultProcessorVersion)) - return "defaultProcessorVersion: string expected"; - return null; - }; - - /** - * Creates a SetDefaultProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest - */ - SetDefaultProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest(); - if (object.processor != null) - message.processor = String(object.processor); - if (object.defaultProcessorVersion != null) - message.defaultProcessorVersion = String(object.defaultProcessorVersion); - return message; - }; - - /** - * Creates a plain object from a SetDefaultProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.SetDefaultProcessorVersionRequest} message SetDefaultProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetDefaultProcessorVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.processor = ""; - object.defaultProcessorVersion = ""; - } - if (message.processor != null && message.hasOwnProperty("processor")) - object.processor = message.processor; - if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) - object.defaultProcessorVersion = message.defaultProcessorVersion; - return object; - }; - - /** - * Converts this SetDefaultProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - SetDefaultProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetDefaultProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetDefaultProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.SetDefaultProcessorVersionRequest"; - }; - - return SetDefaultProcessorVersionRequest; - })(); - - v1.SetDefaultProcessorVersionResponse = (function() { - - /** - * Properties of a SetDefaultProcessorVersionResponse. - * @memberof google.cloud.documentai.v1 - * @interface ISetDefaultProcessorVersionResponse - */ - - /** - * Constructs a new SetDefaultProcessorVersionResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a SetDefaultProcessorVersionResponse. - * @implements ISetDefaultProcessorVersionResponse - * @constructor - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse=} [properties] Properties to set - */ - function SetDefaultProcessorVersionResponse(properties) { - if (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 SetDefaultProcessorVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse instance - */ - SetDefaultProcessorVersionResponse.create = function create(properties) { - return new SetDefaultProcessorVersionResponse(properties); - }; - - /** - * Encodes the specified SetDefaultProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse} message SetDefaultProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultProcessorVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified SetDefaultProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionResponse} message SetDefaultProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetDefaultProcessorVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse - * @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.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultProcessorVersionResponse.decode = function decode(reader, 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.SetDefaultProcessorVersionResponse(); - 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 SetDefaultProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetDefaultProcessorVersionResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetDefaultProcessorVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a SetDefaultProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse - */ - SetDefaultProcessorVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse) - return object; - return new $root.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse(); - }; - - /** - * Creates a plain object from a SetDefaultProcessorVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.SetDefaultProcessorVersionResponse} message SetDefaultProcessorVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetDefaultProcessorVersionResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this SetDefaultProcessorVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse - * @instance - * @returns {Object.} JSON object - */ - SetDefaultProcessorVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetDefaultProcessorVersionResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetDefaultProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.SetDefaultProcessorVersionResponse"; - }; - - return SetDefaultProcessorVersionResponse; - })(); - - v1.SetDefaultProcessorVersionMetadata = (function() { - - /** - * Properties of a SetDefaultProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1 - * @interface ISetDefaultProcessorVersionMetadata - * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] SetDefaultProcessorVersionMetadata commonMetadata - */ - - /** - * Constructs a new SetDefaultProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a SetDefaultProcessorVersionMetadata. - * @implements ISetDefaultProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata=} [properties] Properties to set - */ - function SetDefaultProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SetDefaultProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata - * @instance - */ - SetDefaultProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * Creates a new SetDefaultProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata instance - */ - SetDefaultProcessorVersionMetadata.create = function create(properties) { - return new SetDefaultProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified SetDefaultProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata} message SetDefaultProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SetDefaultProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.ISetDefaultProcessorVersionMetadata} message SetDefaultProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata - * @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.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultProcessorVersionMetadata.decode = function decode(reader, 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.SetDefaultProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetDefaultProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetDefaultProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates a SetDefaultProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata - */ - SetDefaultProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from a SetDefaultProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata} message SetDefaultProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetDefaultProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this SetDefaultProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - SetDefaultProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetDefaultProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetDefaultProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata"; - }; - - return SetDefaultProcessorVersionMetadata; - })(); - - v1.TrainProcessorVersionRequest = (function() { - - /** - * Properties of a TrainProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @interface ITrainProcessorVersionRequest - * @property {google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null} [customDocumentExtractionOptions] TrainProcessorVersionRequest customDocumentExtractionOptions - * @property {google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null} [foundationModelTuningOptions] TrainProcessorVersionRequest foundationModelTuningOptions - * @property {string|null} [parent] TrainProcessorVersionRequest parent - * @property {google.cloud.documentai.v1.IProcessorVersion|null} [processorVersion] TrainProcessorVersionRequest processorVersion - * @property {google.cloud.documentai.v1.IDocumentSchema|null} [documentSchema] TrainProcessorVersionRequest documentSchema - * @property {google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData|null} [inputData] TrainProcessorVersionRequest inputData - * @property {string|null} [baseProcessorVersion] TrainProcessorVersionRequest baseProcessorVersion - */ - - /** - * Constructs a new TrainProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a TrainProcessorVersionRequest. - * @implements ITrainProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1.ITrainProcessorVersionRequest=} [properties] Properties to set - */ - function TrainProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrainProcessorVersionRequest customDocumentExtractionOptions. - * @member {google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null|undefined} customDocumentExtractionOptions - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.customDocumentExtractionOptions = null; - - /** - * TrainProcessorVersionRequest foundationModelTuningOptions. - * @member {google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null|undefined} foundationModelTuningOptions - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.foundationModelTuningOptions = null; - - /** - * TrainProcessorVersionRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.parent = ""; - - /** - * TrainProcessorVersionRequest processorVersion. - * @member {google.cloud.documentai.v1.IProcessorVersion|null|undefined} processorVersion - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.processorVersion = null; - - /** - * TrainProcessorVersionRequest documentSchema. - * @member {google.cloud.documentai.v1.IDocumentSchema|null|undefined} documentSchema - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.documentSchema = null; - - /** - * TrainProcessorVersionRequest inputData. - * @member {google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData|null|undefined} inputData - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.inputData = null; - - /** - * TrainProcessorVersionRequest baseProcessorVersion. - * @member {string} baseProcessorVersion - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.baseProcessorVersion = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TrainProcessorVersionRequest processorFlags. - * @member {"customDocumentExtractionOptions"|"foundationModelTuningOptions"|undefined} processorFlags - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @instance - */ - Object.defineProperty(TrainProcessorVersionRequest.prototype, "processorFlags", { - get: $util.oneOfGetter($oneOfFields = ["customDocumentExtractionOptions", "foundationModelTuningOptions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TrainProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.ITrainProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest} TrainProcessorVersionRequest instance - */ - TrainProcessorVersionRequest.create = function create(properties) { - return new TrainProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified TrainProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.ITrainProcessorVersionRequest} message TrainProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainProcessorVersionRequest.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.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) - $root.google.cloud.documentai.v1.ProcessorVersion.encode(message.processorVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.inputData != null && Object.hasOwnProperty.call(message, "inputData")) - $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.encode(message.inputData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.customDocumentExtractionOptions != null && Object.hasOwnProperty.call(message, "customDocumentExtractionOptions")) - $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.encode(message.customDocumentExtractionOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.baseProcessorVersion != null && Object.hasOwnProperty.call(message, "baseProcessorVersion")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.baseProcessorVersion); - if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) - $root.google.cloud.documentai.v1.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.foundationModelTuningOptions != null && Object.hasOwnProperty.call(message, "foundationModelTuningOptions")) - $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.encode(message.foundationModelTuningOptions, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TrainProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.ITrainProcessorVersionRequest} message TrainProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @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.TrainProcessorVersionRequest} TrainProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainProcessorVersionRequest.decode = function decode(reader, 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.TrainProcessorVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.customDocumentExtractionOptions = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.decode(reader, reader.uint32()); - break; - } - case 12: { - message.foundationModelTuningOptions = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.decode(reader, reader.uint32()); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.processorVersion = $root.google.cloud.documentai.v1.ProcessorVersion.decode(reader, reader.uint32()); - break; - } - case 10: { - message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.decode(reader, reader.uint32()); - break; - } - case 4: { - message.inputData = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.decode(reader, reader.uint32()); - break; - } - case 8: { - message.baseProcessorVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest} TrainProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrainProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrainProcessorVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.customDocumentExtractionOptions != null && message.hasOwnProperty("customDocumentExtractionOptions")) { - properties.processorFlags = 1; - { - var error = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify(message.customDocumentExtractionOptions); - if (error) - return "customDocumentExtractionOptions." + error; - } - } - if (message.foundationModelTuningOptions != null && message.hasOwnProperty("foundationModelTuningOptions")) { - if (properties.processorFlags === 1) - return "processorFlags: multiple values"; - properties.processorFlags = 1; - { - var error = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify(message.foundationModelTuningOptions); - if (error) - return "foundationModelTuningOptions." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) { - var error = $root.google.cloud.documentai.v1.ProcessorVersion.verify(message.processorVersion); - if (error) - return "processorVersion." + error; - } - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) { - var error = $root.google.cloud.documentai.v1.DocumentSchema.verify(message.documentSchema); - if (error) - return "documentSchema." + error; - } - if (message.inputData != null && message.hasOwnProperty("inputData")) { - var error = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.verify(message.inputData); - if (error) - return "inputData." + error; - } - if (message.baseProcessorVersion != null && message.hasOwnProperty("baseProcessorVersion")) - if (!$util.isString(message.baseProcessorVersion)) - return "baseProcessorVersion: string expected"; - return null; - }; - - /** - * Creates a TrainProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest} TrainProcessorVersionRequest - */ - TrainProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionRequest(); - if (object.customDocumentExtractionOptions != null) { - if (typeof object.customDocumentExtractionOptions !== "object") - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.customDocumentExtractionOptions: object expected"); - message.customDocumentExtractionOptions = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.fromObject(object.customDocumentExtractionOptions); - } - if (object.foundationModelTuningOptions != null) { - if (typeof object.foundationModelTuningOptions !== "object") - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.foundationModelTuningOptions: object expected"); - message.foundationModelTuningOptions = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.fromObject(object.foundationModelTuningOptions); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.processorVersion != null) { - if (typeof object.processorVersion !== "object") - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.processorVersion: object expected"); - message.processorVersion = $root.google.cloud.documentai.v1.ProcessorVersion.fromObject(object.processorVersion); - } - if (object.documentSchema != null) { - if (typeof object.documentSchema !== "object") - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.documentSchema: object expected"); - message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.fromObject(object.documentSchema); - } - if (object.inputData != null) { - if (typeof object.inputData !== "object") - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.inputData: object expected"); - message.inputData = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.fromObject(object.inputData); - } - if (object.baseProcessorVersion != null) - message.baseProcessorVersion = String(object.baseProcessorVersion); - return message; - }; - - /** - * Creates a plain object from a TrainProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest} message TrainProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrainProcessorVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.processorVersion = null; - object.inputData = null; - object.baseProcessorVersion = ""; - object.documentSchema = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - object.processorVersion = $root.google.cloud.documentai.v1.ProcessorVersion.toObject(message.processorVersion, options); - if (message.inputData != null && message.hasOwnProperty("inputData")) - object.inputData = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.toObject(message.inputData, options); - if (message.customDocumentExtractionOptions != null && message.hasOwnProperty("customDocumentExtractionOptions")) { - object.customDocumentExtractionOptions = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.toObject(message.customDocumentExtractionOptions, options); - if (options.oneofs) - object.processorFlags = "customDocumentExtractionOptions"; - } - if (message.baseProcessorVersion != null && message.hasOwnProperty("baseProcessorVersion")) - object.baseProcessorVersion = message.baseProcessorVersion; - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) - object.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.toObject(message.documentSchema, options); - if (message.foundationModelTuningOptions != null && message.hasOwnProperty("foundationModelTuningOptions")) { - object.foundationModelTuningOptions = $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.toObject(message.foundationModelTuningOptions, options); - if (options.oneofs) - object.processorFlags = "foundationModelTuningOptions"; - } - return object; - }; - - /** - * Converts this TrainProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - TrainProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrainProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrainProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionRequest"; - }; - - TrainProcessorVersionRequest.InputData = (function() { - - /** - * Properties of an InputData. - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @interface IInputData - * @property {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null} [trainingDocuments] InputData trainingDocuments - * @property {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null} [testDocuments] InputData testDocuments - */ - - /** - * Constructs a new InputData. - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @classdesc Represents an InputData. - * @implements IInputData - * @constructor - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData=} [properties] Properties to set - */ - function InputData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InputData trainingDocuments. - * @member {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null|undefined} trainingDocuments - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - * @instance - */ - InputData.prototype.trainingDocuments = null; - - /** - * InputData testDocuments. - * @member {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null|undefined} testDocuments - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - * @instance - */ - InputData.prototype.testDocuments = null; - - /** - * Creates a new InputData instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData} InputData instance - */ - InputData.create = function create(properties) { - return new InputData(properties); - }; - - /** - * Encodes the specified InputData message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData} message InputData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InputData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.trainingDocuments != null && Object.hasOwnProperty.call(message, "trainingDocuments")) - $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.encode(message.trainingDocuments, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.testDocuments != null && Object.hasOwnProperty.call(message, "testDocuments")) - $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.encode(message.testDocuments, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InputData message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IInputData} message InputData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InputData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InputData message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - * @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.TrainProcessorVersionRequest.InputData} InputData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InputData.decode = function decode(reader, 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.TrainProcessorVersionRequest.InputData(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.trainingDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.testDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InputData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData} InputData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InputData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InputData message. - * @function verify - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InputData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.trainingDocuments != null && message.hasOwnProperty("trainingDocuments")) { - var error = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.verify(message.trainingDocuments); - if (error) - return "trainingDocuments." + error; - } - if (message.testDocuments != null && message.hasOwnProperty("testDocuments")) { - var error = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.verify(message.testDocuments); - if (error) - return "testDocuments." + error; - } - return null; - }; - - /** - * Creates an InputData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData} InputData - */ - InputData.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData) - return object; - var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData(); - if (object.trainingDocuments != null) { - if (typeof object.trainingDocuments !== "object") - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.trainingDocuments: object expected"); - message.trainingDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.fromObject(object.trainingDocuments); - } - if (object.testDocuments != null) { - if (typeof object.testDocuments !== "object") - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData.testDocuments: object expected"); - message.testDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.fromObject(object.testDocuments); - } - return message; - }; - - /** - * Creates a plain object from an InputData message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData} message InputData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InputData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.trainingDocuments = null; - object.testDocuments = null; - } - if (message.trainingDocuments != null && message.hasOwnProperty("trainingDocuments")) - object.trainingDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.toObject(message.trainingDocuments, options); - if (message.testDocuments != null && message.hasOwnProperty("testDocuments")) - object.testDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.toObject(message.testDocuments, options); - return object; - }; - - /** - * Converts this InputData to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - * @instance - * @returns {Object.} JSON object - */ - InputData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InputData - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InputData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData"; - }; - - return InputData; - })(); - - TrainProcessorVersionRequest.CustomDocumentExtractionOptions = (function() { - - /** - * Properties of a CustomDocumentExtractionOptions. - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @interface ICustomDocumentExtractionOptions - * @property {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|null} [trainingMethod] CustomDocumentExtractionOptions trainingMethod - */ - - /** - * Constructs a new CustomDocumentExtractionOptions. - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @classdesc Represents a CustomDocumentExtractionOptions. - * @implements ICustomDocumentExtractionOptions - * @constructor - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions=} [properties] Properties to set - */ - function CustomDocumentExtractionOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomDocumentExtractionOptions trainingMethod. - * @member {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod} trainingMethod - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @instance - */ - CustomDocumentExtractionOptions.prototype.trainingMethod = 0; - - /** - * Creates a new CustomDocumentExtractionOptions instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions instance - */ - CustomDocumentExtractionOptions.create = function create(properties) { - return new CustomDocumentExtractionOptions(properties); - }; - - /** - * Encodes the specified CustomDocumentExtractionOptions message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions} message CustomDocumentExtractionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomDocumentExtractionOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.trainingMethod != null && Object.hasOwnProperty.call(message, "trainingMethod")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.trainingMethod); - return writer; - }; - - /** - * Encodes the specified CustomDocumentExtractionOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions} message CustomDocumentExtractionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomDocumentExtractionOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @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.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomDocumentExtractionOptions.decode = function decode(reader, 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.TrainProcessorVersionRequest.CustomDocumentExtractionOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.trainingMethod = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomDocumentExtractionOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomDocumentExtractionOptions message. - * @function verify - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomDocumentExtractionOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.trainingMethod != null && message.hasOwnProperty("trainingMethod")) - switch (message.trainingMethod) { - default: - return "trainingMethod: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a CustomDocumentExtractionOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions - */ - CustomDocumentExtractionOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions) - return object; - var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions(); - switch (object.trainingMethod) { - default: - if (typeof object.trainingMethod === "number") { - message.trainingMethod = object.trainingMethod; - break; - } - break; - case "TRAINING_METHOD_UNSPECIFIED": - case 0: - message.trainingMethod = 0; - break; - case "MODEL_BASED": - case 1: - message.trainingMethod = 1; - break; - case "TEMPLATE_BASED": - case 2: - message.trainingMethod = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a CustomDocumentExtractionOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} message CustomDocumentExtractionOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomDocumentExtractionOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.trainingMethod = options.enums === String ? "TRAINING_METHOD_UNSPECIFIED" : 0; - if (message.trainingMethod != null && message.hasOwnProperty("trainingMethod")) - object.trainingMethod = options.enums === String ? $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod[message.trainingMethod] === undefined ? message.trainingMethod : $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod[message.trainingMethod] : message.trainingMethod; - return object; - }; - - /** - * Converts this CustomDocumentExtractionOptions to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @instance - * @returns {Object.} JSON object - */ - CustomDocumentExtractionOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomDocumentExtractionOptions - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomDocumentExtractionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions"; - }; - - /** - * TrainingMethod enum. - * @name google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod - * @enum {number} - * @property {number} TRAINING_METHOD_UNSPECIFIED=0 TRAINING_METHOD_UNSPECIFIED value - * @property {number} MODEL_BASED=1 MODEL_BASED value - * @property {number} TEMPLATE_BASED=2 TEMPLATE_BASED value - */ - CustomDocumentExtractionOptions.TrainingMethod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TRAINING_METHOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "MODEL_BASED"] = 1; - values[valuesById[2] = "TEMPLATE_BASED"] = 2; - return values; - })(); - - return CustomDocumentExtractionOptions; - })(); - - TrainProcessorVersionRequest.FoundationModelTuningOptions = (function() { - - /** - * Properties of a FoundationModelTuningOptions. - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @interface IFoundationModelTuningOptions - * @property {number|null} [trainSteps] FoundationModelTuningOptions trainSteps - * @property {number|null} [learningRateMultiplier] FoundationModelTuningOptions learningRateMultiplier - */ - - /** - * Constructs a new FoundationModelTuningOptions. - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest - * @classdesc Represents a FoundationModelTuningOptions. - * @implements IFoundationModelTuningOptions - * @constructor - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions=} [properties] Properties to set - */ - function FoundationModelTuningOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FoundationModelTuningOptions trainSteps. - * @member {number} trainSteps - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @instance - */ - FoundationModelTuningOptions.prototype.trainSteps = 0; - - /** - * FoundationModelTuningOptions learningRateMultiplier. - * @member {number} learningRateMultiplier - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @instance - */ - FoundationModelTuningOptions.prototype.learningRateMultiplier = 0; - - /** - * Creates a new FoundationModelTuningOptions instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions instance - */ - FoundationModelTuningOptions.create = function create(properties) { - return new FoundationModelTuningOptions(properties); - }; - - /** - * Encodes the specified FoundationModelTuningOptions message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions} message FoundationModelTuningOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FoundationModelTuningOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.trainSteps != null && Object.hasOwnProperty.call(message, "trainSteps")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.trainSteps); - if (message.learningRateMultiplier != null && Object.hasOwnProperty.call(message, "learningRateMultiplier")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.learningRateMultiplier); - return writer; - }; - - /** - * Encodes the specified FoundationModelTuningOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.IFoundationModelTuningOptions} message FoundationModelTuningOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FoundationModelTuningOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FoundationModelTuningOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @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.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FoundationModelTuningOptions.decode = function decode(reader, 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.TrainProcessorVersionRequest.FoundationModelTuningOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.trainSteps = reader.int32(); - break; - } - case 3: { - message.learningRateMultiplier = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FoundationModelTuningOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FoundationModelTuningOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FoundationModelTuningOptions message. - * @function verify - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FoundationModelTuningOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.trainSteps != null && message.hasOwnProperty("trainSteps")) - if (!$util.isInteger(message.trainSteps)) - return "trainSteps: integer expected"; - if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) - if (typeof message.learningRateMultiplier !== "number") - return "learningRateMultiplier: number expected"; - return null; - }; - - /** - * Creates a FoundationModelTuningOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions - */ - FoundationModelTuningOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions) - return object; - var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions(); - if (object.trainSteps != null) - message.trainSteps = object.trainSteps | 0; - if (object.learningRateMultiplier != null) - message.learningRateMultiplier = Number(object.learningRateMultiplier); - return message; - }; - - /** - * Creates a plain object from a FoundationModelTuningOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions} message FoundationModelTuningOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FoundationModelTuningOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.trainSteps = 0; - object.learningRateMultiplier = 0; - } - if (message.trainSteps != null && message.hasOwnProperty("trainSteps")) - object.trainSteps = message.trainSteps; - if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) - object.learningRateMultiplier = options.json && !isFinite(message.learningRateMultiplier) ? String(message.learningRateMultiplier) : message.learningRateMultiplier; - return object; - }; - - /** - * Converts this FoundationModelTuningOptions to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @instance - * @returns {Object.} JSON object - */ - FoundationModelTuningOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FoundationModelTuningOptions - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FoundationModelTuningOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions"; - }; - - return FoundationModelTuningOptions; - })(); - - return TrainProcessorVersionRequest; - })(); - - v1.TrainProcessorVersionResponse = (function() { - - /** - * Properties of a TrainProcessorVersionResponse. - * @memberof google.cloud.documentai.v1 - * @interface ITrainProcessorVersionResponse - * @property {string|null} [processorVersion] TrainProcessorVersionResponse processorVersion - */ - - /** - * Constructs a new TrainProcessorVersionResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a TrainProcessorVersionResponse. - * @implements ITrainProcessorVersionResponse - * @constructor - * @param {google.cloud.documentai.v1.ITrainProcessorVersionResponse=} [properties] Properties to set - */ - function TrainProcessorVersionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrainProcessorVersionResponse processorVersion. - * @member {string} processorVersion - * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse - * @instance - */ - TrainProcessorVersionResponse.prototype.processorVersion = ""; - - /** - * Creates a new TrainProcessorVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.ITrainProcessorVersionResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.TrainProcessorVersionResponse} TrainProcessorVersionResponse instance - */ - TrainProcessorVersionResponse.create = function create(properties) { - return new TrainProcessorVersionResponse(properties); - }; - - /** - * Encodes the specified TrainProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.ITrainProcessorVersionResponse} message TrainProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainProcessorVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorVersion); - return writer; - }; - - /** - * Encodes the specified TrainProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.ITrainProcessorVersionResponse} message TrainProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse - * @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.TrainProcessorVersionResponse} TrainProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainProcessorVersionResponse.decode = function decode(reader, 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.TrainProcessorVersionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.processorVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.TrainProcessorVersionResponse} TrainProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrainProcessorVersionResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrainProcessorVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - if (!$util.isString(message.processorVersion)) - return "processorVersion: string expected"; - return null; - }; - - /** - * Creates a TrainProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.TrainProcessorVersionResponse} TrainProcessorVersionResponse - */ - TrainProcessorVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionResponse) - return object; - var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionResponse(); - if (object.processorVersion != null) - message.processorVersion = String(object.processorVersion); - return message; - }; - - /** - * Creates a plain object from a TrainProcessorVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionResponse} message TrainProcessorVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrainProcessorVersionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.processorVersion = ""; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - object.processorVersion = message.processorVersion; - return object; - }; - - /** - * Converts this TrainProcessorVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse - * @instance - * @returns {Object.} JSON object - */ - TrainProcessorVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrainProcessorVersionResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.TrainProcessorVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrainProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionResponse"; - }; - - return TrainProcessorVersionResponse; - })(); - - v1.TrainProcessorVersionMetadata = (function() { - - /** - * Properties of a TrainProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1 - * @interface ITrainProcessorVersionMetadata - * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] TrainProcessorVersionMetadata commonMetadata - * @property {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null} [trainingDatasetValidation] TrainProcessorVersionMetadata trainingDatasetValidation - * @property {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null} [testDatasetValidation] TrainProcessorVersionMetadata testDatasetValidation - */ - - /** - * Constructs a new TrainProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a TrainProcessorVersionMetadata. - * @implements ITrainProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1.ITrainProcessorVersionMetadata=} [properties] Properties to set - */ - function TrainProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrainProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @instance - */ - TrainProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * TrainProcessorVersionMetadata trainingDatasetValidation. - * @member {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null|undefined} trainingDatasetValidation - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @instance - */ - TrainProcessorVersionMetadata.prototype.trainingDatasetValidation = null; - - /** - * TrainProcessorVersionMetadata testDatasetValidation. - * @member {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation|null|undefined} testDatasetValidation - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @instance - */ - TrainProcessorVersionMetadata.prototype.testDatasetValidation = null; - - /** - * Creates a new TrainProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.ITrainProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata instance - */ - TrainProcessorVersionMetadata.create = function create(properties) { - return new TrainProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified TrainProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.ITrainProcessorVersionMetadata} message TrainProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.trainingDatasetValidation != null && Object.hasOwnProperty.call(message, "trainingDatasetValidation")) - $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.encode(message.trainingDatasetValidation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.testDatasetValidation != null && Object.hasOwnProperty.call(message, "testDatasetValidation")) - $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.encode(message.testDatasetValidation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TrainProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.ITrainProcessorVersionMetadata} message TrainProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @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.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainProcessorVersionMetadata.decode = function decode(reader, 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.TrainProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - case 2: { - message.trainingDatasetValidation = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.decode(reader, reader.uint32()); - break; - } - case 3: { - message.testDatasetValidation = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrainProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrainProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - if (message.trainingDatasetValidation != null && message.hasOwnProperty("trainingDatasetValidation")) { - var error = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.verify(message.trainingDatasetValidation); - if (error) - return "trainingDatasetValidation." + error; - } - if (message.testDatasetValidation != null && message.hasOwnProperty("testDatasetValidation")) { - var error = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.verify(message.testDatasetValidation); - if (error) - return "testDatasetValidation." + error; - } - return null; - }; - - /** - * Creates a TrainProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata - */ - TrainProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); - } - if (object.trainingDatasetValidation != null) { - if (typeof object.trainingDatasetValidation !== "object") - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.trainingDatasetValidation: object expected"); - message.trainingDatasetValidation = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.fromObject(object.trainingDatasetValidation); - } - if (object.testDatasetValidation != null) { - if (typeof object.testDatasetValidation !== "object") - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.testDatasetValidation: object expected"); - message.testDatasetValidation = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.fromObject(object.testDatasetValidation); - } - return message; - }; - - /** - * Creates a plain object from a TrainProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionMetadata} message TrainProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrainProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.commonMetadata = null; - object.trainingDatasetValidation = null; - object.testDatasetValidation = null; - } - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); - if (message.trainingDatasetValidation != null && message.hasOwnProperty("trainingDatasetValidation")) - object.trainingDatasetValidation = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.toObject(message.trainingDatasetValidation, options); - if (message.testDatasetValidation != null && message.hasOwnProperty("testDatasetValidation")) - object.testDatasetValidation = $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.toObject(message.testDatasetValidation, options); - return object; - }; - - /** - * Converts this TrainProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - TrainProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrainProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrainProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionMetadata"; - }; - - TrainProcessorVersionMetadata.DatasetValidation = (function() { - - /** - * Properties of a DatasetValidation. - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @interface IDatasetValidation - * @property {number|null} [documentErrorCount] DatasetValidation documentErrorCount - * @property {number|null} [datasetErrorCount] DatasetValidation datasetErrorCount - * @property {Array.|null} [documentErrors] DatasetValidation documentErrors - * @property {Array.|null} [datasetErrors] DatasetValidation datasetErrors - */ - - /** - * Constructs a new DatasetValidation. - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata - * @classdesc Represents a DatasetValidation. - * @implements IDatasetValidation - * @constructor - * @param {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation=} [properties] Properties to set - */ - function DatasetValidation(properties) { - this.documentErrors = []; - this.datasetErrors = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DatasetValidation documentErrorCount. - * @member {number} documentErrorCount - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @instance - */ - DatasetValidation.prototype.documentErrorCount = 0; - - /** - * DatasetValidation datasetErrorCount. - * @member {number} datasetErrorCount - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @instance - */ - DatasetValidation.prototype.datasetErrorCount = 0; - - /** - * DatasetValidation documentErrors. - * @member {Array.} documentErrors - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @instance - */ - DatasetValidation.prototype.documentErrors = $util.emptyArray; - - /** - * DatasetValidation datasetErrors. - * @member {Array.} datasetErrors - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @instance - */ - DatasetValidation.prototype.datasetErrors = $util.emptyArray; - - /** - * Creates a new DatasetValidation instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation instance - */ - DatasetValidation.create = function create(properties) { - return new DatasetValidation(properties); - }; - - /** - * Encodes the specified DatasetValidation message. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation} message DatasetValidation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatasetValidation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentErrors != null && message.documentErrors.length) - for (var i = 0; i < message.documentErrors.length; ++i) - $root.google.rpc.Status.encode(message.documentErrors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.datasetErrors != null && message.datasetErrors.length) - for (var i = 0; i < message.datasetErrors.length; ++i) - $root.google.rpc.Status.encode(message.datasetErrors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.documentErrorCount != null && Object.hasOwnProperty.call(message, "documentErrorCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.documentErrorCount); - if (message.datasetErrorCount != null && Object.hasOwnProperty.call(message, "datasetErrorCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.datasetErrorCount); - return writer; - }; - - /** - * Encodes the specified DatasetValidation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionMetadata.IDatasetValidation} message DatasetValidation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatasetValidation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DatasetValidation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @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.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatasetValidation.decode = function decode(reader, 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.TrainProcessorVersionMetadata.DatasetValidation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.documentErrorCount = reader.int32(); - break; - } - case 4: { - message.datasetErrorCount = reader.int32(); - break; - } - case 1: { - if (!(message.documentErrors && message.documentErrors.length)) - message.documentErrors = []; - message.documentErrors.push($root.google.rpc.Status.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.datasetErrors && message.datasetErrors.length)) - message.datasetErrors = []; - message.datasetErrors.push($root.google.rpc.Status.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DatasetValidation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatasetValidation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DatasetValidation message. - * @function verify - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DatasetValidation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentErrorCount != null && message.hasOwnProperty("documentErrorCount")) - if (!$util.isInteger(message.documentErrorCount)) - return "documentErrorCount: integer expected"; - if (message.datasetErrorCount != null && message.hasOwnProperty("datasetErrorCount")) - if (!$util.isInteger(message.datasetErrorCount)) - return "datasetErrorCount: integer expected"; - if (message.documentErrors != null && message.hasOwnProperty("documentErrors")) { - if (!Array.isArray(message.documentErrors)) - return "documentErrors: array expected"; - for (var i = 0; i < message.documentErrors.length; ++i) { - var error = $root.google.rpc.Status.verify(message.documentErrors[i]); - if (error) - return "documentErrors." + error; - } - } - if (message.datasetErrors != null && message.hasOwnProperty("datasetErrors")) { - if (!Array.isArray(message.datasetErrors)) - return "datasetErrors: array expected"; - for (var i = 0; i < message.datasetErrors.length; ++i) { - var error = $root.google.rpc.Status.verify(message.datasetErrors[i]); - if (error) - return "datasetErrors." + error; - } - } - return null; - }; - - /** - * Creates a DatasetValidation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation - */ - DatasetValidation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation) - return object; - var message = new $root.google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation(); - if (object.documentErrorCount != null) - message.documentErrorCount = object.documentErrorCount | 0; - if (object.datasetErrorCount != null) - message.datasetErrorCount = object.datasetErrorCount | 0; - if (object.documentErrors) { - if (!Array.isArray(object.documentErrors)) - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.documentErrors: array expected"); - message.documentErrors = []; - for (var i = 0; i < object.documentErrors.length; ++i) { - if (typeof object.documentErrors[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.documentErrors: object expected"); - message.documentErrors[i] = $root.google.rpc.Status.fromObject(object.documentErrors[i]); - } - } - if (object.datasetErrors) { - if (!Array.isArray(object.datasetErrors)) - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.datasetErrors: array expected"); - message.datasetErrors = []; - for (var i = 0; i < object.datasetErrors.length; ++i) { - if (typeof object.datasetErrors[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation.datasetErrors: object expected"); - message.datasetErrors[i] = $root.google.rpc.Status.fromObject(object.datasetErrors[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a DatasetValidation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation} message DatasetValidation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DatasetValidation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.documentErrors = []; - object.datasetErrors = []; - } - if (options.defaults) { - object.documentErrorCount = 0; - object.datasetErrorCount = 0; - } - if (message.documentErrors && message.documentErrors.length) { - object.documentErrors = []; - for (var j = 0; j < message.documentErrors.length; ++j) - object.documentErrors[j] = $root.google.rpc.Status.toObject(message.documentErrors[j], options); - } - if (message.datasetErrors && message.datasetErrors.length) { - object.datasetErrors = []; - for (var j = 0; j < message.datasetErrors.length; ++j) - object.datasetErrors[j] = $root.google.rpc.Status.toObject(message.datasetErrors[j], options); - } - if (message.documentErrorCount != null && message.hasOwnProperty("documentErrorCount")) - object.documentErrorCount = message.documentErrorCount; - if (message.datasetErrorCount != null && message.hasOwnProperty("datasetErrorCount")) - object.datasetErrorCount = message.datasetErrorCount; - return object; - }; - - /** - * Converts this DatasetValidation to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @instance - * @returns {Object.} JSON object - */ - DatasetValidation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DatasetValidation - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DatasetValidation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation"; - }; - - return DatasetValidation; - })(); - - return TrainProcessorVersionMetadata; - })(); - - v1.ReviewDocumentRequest = (function() { - - /** - * Properties of a ReviewDocumentRequest. - * @memberof google.cloud.documentai.v1 - * @interface IReviewDocumentRequest - * @property {google.cloud.documentai.v1.IDocument|null} [inlineDocument] ReviewDocumentRequest inlineDocument - * @property {string|null} [humanReviewConfig] ReviewDocumentRequest humanReviewConfig - * @property {boolean|null} [enableSchemaValidation] ReviewDocumentRequest enableSchemaValidation - * @property {google.cloud.documentai.v1.ReviewDocumentRequest.Priority|null} [priority] ReviewDocumentRequest priority - * @property {google.cloud.documentai.v1.IDocumentSchema|null} [documentSchema] ReviewDocumentRequest documentSchema - */ - - /** - * Constructs a new ReviewDocumentRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ReviewDocumentRequest. - * @implements IReviewDocumentRequest - * @constructor - * @param {google.cloud.documentai.v1.IReviewDocumentRequest=} [properties] Properties to set - */ - function ReviewDocumentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReviewDocumentRequest inlineDocument. - * @member {google.cloud.documentai.v1.IDocument|null|undefined} inlineDocument - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @instance - */ - ReviewDocumentRequest.prototype.inlineDocument = null; - - /** - * ReviewDocumentRequest humanReviewConfig. - * @member {string} humanReviewConfig - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @instance - */ - ReviewDocumentRequest.prototype.humanReviewConfig = ""; - - /** - * ReviewDocumentRequest enableSchemaValidation. - * @member {boolean} enableSchemaValidation - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @instance - */ - ReviewDocumentRequest.prototype.enableSchemaValidation = false; - - /** - * ReviewDocumentRequest priority. - * @member {google.cloud.documentai.v1.ReviewDocumentRequest.Priority} priority - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @instance - */ - ReviewDocumentRequest.prototype.priority = 0; - - /** - * ReviewDocumentRequest documentSchema. - * @member {google.cloud.documentai.v1.IDocumentSchema|null|undefined} documentSchema - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @instance - */ - ReviewDocumentRequest.prototype.documentSchema = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ReviewDocumentRequest source. - * @member {"inlineDocument"|undefined} source - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @instance - */ - Object.defineProperty(ReviewDocumentRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["inlineDocument"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ReviewDocumentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @static - * @param {google.cloud.documentai.v1.IReviewDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ReviewDocumentRequest} ReviewDocumentRequest instance - */ - ReviewDocumentRequest.create = function create(properties) { - return new ReviewDocumentRequest(properties); - }; - - /** - * Encodes the specified ReviewDocumentRequest message. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @static - * @param {google.cloud.documentai.v1.IReviewDocumentRequest} message ReviewDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReviewDocumentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.humanReviewConfig != null && Object.hasOwnProperty.call(message, "humanReviewConfig")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.humanReviewConfig); - if (message.enableSchemaValidation != null && Object.hasOwnProperty.call(message, "enableSchemaValidation")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableSchemaValidation); - if (message.inlineDocument != null && Object.hasOwnProperty.call(message, "inlineDocument")) - $root.google.cloud.documentai.v1.Document.encode(message.inlineDocument, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.priority); - if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) - $root.google.cloud.documentai.v1.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReviewDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @static - * @param {google.cloud.documentai.v1.IReviewDocumentRequest} message ReviewDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReviewDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReviewDocumentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @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.ReviewDocumentRequest} ReviewDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReviewDocumentRequest.decode = function decode(reader, 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.ReviewDocumentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.inlineDocument = $root.google.cloud.documentai.v1.Document.decode(reader, reader.uint32()); - break; - } - case 1: { - message.humanReviewConfig = reader.string(); - break; - } - case 3: { - message.enableSchemaValidation = reader.bool(); - break; - } - case 5: { - message.priority = reader.int32(); - break; - } - case 6: { - message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReviewDocumentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ReviewDocumentRequest} ReviewDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReviewDocumentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReviewDocumentRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReviewDocumentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1.Document.verify(message.inlineDocument); - if (error) - return "inlineDocument." + error; - } - } - if (message.humanReviewConfig != null && message.hasOwnProperty("humanReviewConfig")) - if (!$util.isString(message.humanReviewConfig)) - return "humanReviewConfig: string expected"; - if (message.enableSchemaValidation != null && message.hasOwnProperty("enableSchemaValidation")) - if (typeof message.enableSchemaValidation !== "boolean") - return "enableSchemaValidation: boolean expected"; - if (message.priority != null && message.hasOwnProperty("priority")) - switch (message.priority) { - default: - return "priority: enum value expected"; - case 0: - case 1: - break; - } - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) { - var error = $root.google.cloud.documentai.v1.DocumentSchema.verify(message.documentSchema); - if (error) - return "documentSchema." + error; - } - return null; - }; - - /** - * Creates a ReviewDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ReviewDocumentRequest} ReviewDocumentRequest - */ - ReviewDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ReviewDocumentRequest) - return object; - var message = new $root.google.cloud.documentai.v1.ReviewDocumentRequest(); - if (object.inlineDocument != null) { - if (typeof object.inlineDocument !== "object") - throw TypeError(".google.cloud.documentai.v1.ReviewDocumentRequest.inlineDocument: object expected"); - message.inlineDocument = $root.google.cloud.documentai.v1.Document.fromObject(object.inlineDocument); - } - if (object.humanReviewConfig != null) - message.humanReviewConfig = String(object.humanReviewConfig); - if (object.enableSchemaValidation != null) - message.enableSchemaValidation = Boolean(object.enableSchemaValidation); - switch (object.priority) { - default: - if (typeof object.priority === "number") { - message.priority = object.priority; - break; - } - break; - case "DEFAULT": - case 0: - message.priority = 0; - break; - case "URGENT": - case 1: - message.priority = 1; - break; - } - if (object.documentSchema != null) { - if (typeof object.documentSchema !== "object") - throw TypeError(".google.cloud.documentai.v1.ReviewDocumentRequest.documentSchema: object expected"); - message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.fromObject(object.documentSchema); - } - return message; - }; - - /** - * Creates a plain object from a ReviewDocumentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @static - * @param {google.cloud.documentai.v1.ReviewDocumentRequest} message ReviewDocumentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReviewDocumentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.humanReviewConfig = ""; - object.enableSchemaValidation = false; - object.priority = options.enums === String ? "DEFAULT" : 0; - object.documentSchema = null; - } - if (message.humanReviewConfig != null && message.hasOwnProperty("humanReviewConfig")) - object.humanReviewConfig = message.humanReviewConfig; - if (message.enableSchemaValidation != null && message.hasOwnProperty("enableSchemaValidation")) - object.enableSchemaValidation = message.enableSchemaValidation; - if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { - object.inlineDocument = $root.google.cloud.documentai.v1.Document.toObject(message.inlineDocument, options); - if (options.oneofs) - object.source = "inlineDocument"; - } - if (message.priority != null && message.hasOwnProperty("priority")) - object.priority = options.enums === String ? $root.google.cloud.documentai.v1.ReviewDocumentRequest.Priority[message.priority] === undefined ? message.priority : $root.google.cloud.documentai.v1.ReviewDocumentRequest.Priority[message.priority] : message.priority; - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) - object.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.toObject(message.documentSchema, options); - return object; - }; - - /** - * Converts this ReviewDocumentRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @instance - * @returns {Object.} JSON object - */ - ReviewDocumentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReviewDocumentRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ReviewDocumentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReviewDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ReviewDocumentRequest"; - }; - - /** - * Priority enum. - * @name google.cloud.documentai.v1.ReviewDocumentRequest.Priority - * @enum {number} - * @property {number} DEFAULT=0 DEFAULT value - * @property {number} URGENT=1 URGENT value - */ - ReviewDocumentRequest.Priority = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEFAULT"] = 0; - values[valuesById[1] = "URGENT"] = 1; - return values; - })(); - - return ReviewDocumentRequest; - })(); - - v1.ReviewDocumentResponse = (function() { - - /** - * Properties of a ReviewDocumentResponse. - * @memberof google.cloud.documentai.v1 - * @interface IReviewDocumentResponse - * @property {string|null} [gcsDestination] ReviewDocumentResponse gcsDestination - * @property {google.cloud.documentai.v1.ReviewDocumentResponse.State|null} [state] ReviewDocumentResponse state - * @property {string|null} [rejectionReason] ReviewDocumentResponse rejectionReason - */ - - /** - * Constructs a new ReviewDocumentResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ReviewDocumentResponse. - * @implements IReviewDocumentResponse - * @constructor - * @param {google.cloud.documentai.v1.IReviewDocumentResponse=} [properties] Properties to set - */ - function ReviewDocumentResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReviewDocumentResponse gcsDestination. - * @member {string} gcsDestination - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @instance - */ - ReviewDocumentResponse.prototype.gcsDestination = ""; - - /** - * ReviewDocumentResponse state. - * @member {google.cloud.documentai.v1.ReviewDocumentResponse.State} state - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @instance - */ - ReviewDocumentResponse.prototype.state = 0; - - /** - * ReviewDocumentResponse rejectionReason. - * @member {string} rejectionReason - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @instance - */ - ReviewDocumentResponse.prototype.rejectionReason = ""; - - /** - * Creates a new ReviewDocumentResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @static - * @param {google.cloud.documentai.v1.IReviewDocumentResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ReviewDocumentResponse} ReviewDocumentResponse instance - */ - ReviewDocumentResponse.create = function create(properties) { - return new ReviewDocumentResponse(properties); - }; - - /** - * Encodes the specified ReviewDocumentResponse message. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @static - * @param {google.cloud.documentai.v1.IReviewDocumentResponse} message ReviewDocumentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReviewDocumentResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsDestination); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.rejectionReason != null && Object.hasOwnProperty.call(message, "rejectionReason")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.rejectionReason); - return writer; - }; - - /** - * Encodes the specified ReviewDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @static - * @param {google.cloud.documentai.v1.IReviewDocumentResponse} message ReviewDocumentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReviewDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReviewDocumentResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @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.ReviewDocumentResponse} ReviewDocumentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReviewDocumentResponse.decode = function decode(reader, 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.ReviewDocumentResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsDestination = reader.string(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 3: { - message.rejectionReason = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReviewDocumentResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ReviewDocumentResponse} ReviewDocumentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReviewDocumentResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReviewDocumentResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReviewDocumentResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - if (!$util.isString(message.gcsDestination)) - return "gcsDestination: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.rejectionReason != null && message.hasOwnProperty("rejectionReason")) - if (!$util.isString(message.rejectionReason)) - return "rejectionReason: string expected"; - return null; - }; - - /** - * Creates a ReviewDocumentResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ReviewDocumentResponse} ReviewDocumentResponse - */ - ReviewDocumentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ReviewDocumentResponse) - return object; - var message = new $root.google.cloud.documentai.v1.ReviewDocumentResponse(); - if (object.gcsDestination != null) - message.gcsDestination = String(object.gcsDestination); - 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 "REJECTED": - case 1: - message.state = 1; - break; - case "SUCCEEDED": - case 2: - message.state = 2; - break; - } - if (object.rejectionReason != null) - message.rejectionReason = String(object.rejectionReason); - return message; - }; - - /** - * Creates a plain object from a ReviewDocumentResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @static - * @param {google.cloud.documentai.v1.ReviewDocumentResponse} message ReviewDocumentResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReviewDocumentResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcsDestination = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.rejectionReason = ""; - } - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - object.gcsDestination = message.gcsDestination; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1.ReviewDocumentResponse.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.ReviewDocumentResponse.State[message.state] : message.state; - if (message.rejectionReason != null && message.hasOwnProperty("rejectionReason")) - object.rejectionReason = message.rejectionReason; - return object; - }; - - /** - * Converts this ReviewDocumentResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @instance - * @returns {Object.} JSON object - */ - ReviewDocumentResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReviewDocumentResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ReviewDocumentResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReviewDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ReviewDocumentResponse"; - }; - - /** - * State enum. - * @name google.cloud.documentai.v1.ReviewDocumentResponse.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} REJECTED=1 REJECTED value - * @property {number} SUCCEEDED=2 SUCCEEDED value - */ - ReviewDocumentResponse.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "REJECTED"] = 1; - values[valuesById[2] = "SUCCEEDED"] = 2; - return values; - })(); - - return ReviewDocumentResponse; - })(); - - v1.ReviewDocumentOperationMetadata = (function() { - - /** - * Properties of a ReviewDocumentOperationMetadata. - * @memberof google.cloud.documentai.v1 - * @interface IReviewDocumentOperationMetadata - * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] ReviewDocumentOperationMetadata commonMetadata - * @property {string|null} [questionId] ReviewDocumentOperationMetadata questionId - */ - - /** - * Constructs a new ReviewDocumentOperationMetadata. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ReviewDocumentOperationMetadata. - * @implements IReviewDocumentOperationMetadata - * @constructor - * @param {google.cloud.documentai.v1.IReviewDocumentOperationMetadata=} [properties] Properties to set - */ - function ReviewDocumentOperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReviewDocumentOperationMetadata commonMetadata. - * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata - * @instance - */ - ReviewDocumentOperationMetadata.prototype.commonMetadata = null; - - /** - * ReviewDocumentOperationMetadata questionId. - * @member {string} questionId - * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata - * @instance - */ - ReviewDocumentOperationMetadata.prototype.questionId = ""; - - /** - * Creates a new ReviewDocumentOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata - * @static - * @param {google.cloud.documentai.v1.IReviewDocumentOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata instance - */ - ReviewDocumentOperationMetadata.create = function create(properties) { - return new ReviewDocumentOperationMetadata(properties); - }; - - /** - * Encodes the specified ReviewDocumentOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata - * @static - * @param {google.cloud.documentai.v1.IReviewDocumentOperationMetadata} message ReviewDocumentOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReviewDocumentOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.questionId != null && Object.hasOwnProperty.call(message, "questionId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.questionId); - return writer; - }; - - /** - * Encodes the specified ReviewDocumentOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ReviewDocumentOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata - * @static - * @param {google.cloud.documentai.v1.IReviewDocumentOperationMetadata} message ReviewDocumentOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReviewDocumentOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata - * @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.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReviewDocumentOperationMetadata.decode = function decode(reader, 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.ReviewDocumentOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - case 6: { - message.questionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReviewDocumentOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReviewDocumentOperationMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReviewDocumentOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - if (message.questionId != null && message.hasOwnProperty("questionId")) - if (!$util.isString(message.questionId)) - return "questionId: string expected"; - return null; - }; - - /** - * Creates a ReviewDocumentOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata - */ - ReviewDocumentOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ReviewDocumentOperationMetadata) - return object; - var message = new $root.google.cloud.documentai.v1.ReviewDocumentOperationMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1.ReviewDocumentOperationMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); - } - if (object.questionId != null) - message.questionId = String(object.questionId); - return message; - }; - - /** - * Creates a plain object from a ReviewDocumentOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata - * @static - * @param {google.cloud.documentai.v1.ReviewDocumentOperationMetadata} message ReviewDocumentOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReviewDocumentOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.commonMetadata = null; - object.questionId = ""; - } - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); - if (message.questionId != null && message.hasOwnProperty("questionId")) - object.questionId = message.questionId; - return object; - }; - - /** - * Converts this ReviewDocumentOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - ReviewDocumentOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReviewDocumentOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ReviewDocumentOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReviewDocumentOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ReviewDocumentOperationMetadata"; - }; - - return ReviewDocumentOperationMetadata; - })(); - - v1.EvaluateProcessorVersionRequest = (function() { - - /** - * Properties of an EvaluateProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @interface IEvaluateProcessorVersionRequest - * @property {string|null} [processorVersion] EvaluateProcessorVersionRequest processorVersion - * @property {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null} [evaluationDocuments] EvaluateProcessorVersionRequest evaluationDocuments - */ - - /** - * Constructs a new EvaluateProcessorVersionRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents an EvaluateProcessorVersionRequest. - * @implements IEvaluateProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionRequest=} [properties] Properties to set - */ - function EvaluateProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluateProcessorVersionRequest processorVersion. - * @member {string} processorVersion - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest - * @instance - */ - EvaluateProcessorVersionRequest.prototype.processorVersion = ""; - - /** - * EvaluateProcessorVersionRequest evaluationDocuments. - * @member {google.cloud.documentai.v1.IBatchDocumentsInputConfig|null|undefined} evaluationDocuments - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest - * @instance - */ - EvaluateProcessorVersionRequest.prototype.evaluationDocuments = null; - - /** - * Creates a new EvaluateProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest instance - */ - EvaluateProcessorVersionRequest.create = function create(properties) { - return new EvaluateProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified EvaluateProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionRequest} message EvaluateProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluateProcessorVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorVersion); - if (message.evaluationDocuments != null && Object.hasOwnProperty.call(message, "evaluationDocuments")) - $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.encode(message.evaluationDocuments, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EvaluateProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionRequest} message EvaluateProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluateProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest - * @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.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluateProcessorVersionRequest.decode = function decode(reader, 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.EvaluateProcessorVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.processorVersion = reader.string(); - break; - } - case 3: { - message.evaluationDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluateProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluateProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluateProcessorVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - if (!$util.isString(message.processorVersion)) - return "processorVersion: string expected"; - if (message.evaluationDocuments != null && message.hasOwnProperty("evaluationDocuments")) { - var error = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.verify(message.evaluationDocuments); - if (error) - return "evaluationDocuments." + error; - } - return null; - }; - - /** - * Creates an EvaluateProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest - */ - EvaluateProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.EvaluateProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1.EvaluateProcessorVersionRequest(); - if (object.processorVersion != null) - message.processorVersion = String(object.processorVersion); - if (object.evaluationDocuments != null) { - if (typeof object.evaluationDocuments !== "object") - throw TypeError(".google.cloud.documentai.v1.EvaluateProcessorVersionRequest.evaluationDocuments: object expected"); - message.evaluationDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.fromObject(object.evaluationDocuments); - } - return message; - }; - - /** - * Creates a plain object from an EvaluateProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1.EvaluateProcessorVersionRequest} message EvaluateProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluateProcessorVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.processorVersion = ""; - object.evaluationDocuments = null; - } - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - object.processorVersion = message.processorVersion; - if (message.evaluationDocuments != null && message.hasOwnProperty("evaluationDocuments")) - object.evaluationDocuments = $root.google.cloud.documentai.v1.BatchDocumentsInputConfig.toObject(message.evaluationDocuments, options); - return object; - }; - - /** - * Converts this EvaluateProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - EvaluateProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluateProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluateProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.EvaluateProcessorVersionRequest"; - }; - - return EvaluateProcessorVersionRequest; - })(); - - v1.EvaluateProcessorVersionMetadata = (function() { - - /** - * Properties of an EvaluateProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1 - * @interface IEvaluateProcessorVersionMetadata - * @property {google.cloud.documentai.v1.ICommonOperationMetadata|null} [commonMetadata] EvaluateProcessorVersionMetadata commonMetadata - */ - - /** - * Constructs a new EvaluateProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents an EvaluateProcessorVersionMetadata. - * @implements IEvaluateProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata=} [properties] Properties to set - */ - function EvaluateProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluateProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata - * @instance - */ - EvaluateProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * Creates a new EvaluateProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata instance - */ - EvaluateProcessorVersionMetadata.create = function create(properties) { - return new EvaluateProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified EvaluateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata} message EvaluateProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluateProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EvaluateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionMetadata} message EvaluateProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluateProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata - * @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.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluateProcessorVersionMetadata.decode = function decode(reader, 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.EvaluateProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluateProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluateProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluateProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates an EvaluateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata - */ - EvaluateProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1.EvaluateProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from an EvaluateProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1.EvaluateProcessorVersionMetadata} message EvaluateProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluateProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this EvaluateProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - EvaluateProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluateProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluateProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.EvaluateProcessorVersionMetadata"; - }; - - return EvaluateProcessorVersionMetadata; - })(); - - v1.EvaluateProcessorVersionResponse = (function() { - - /** - * Properties of an EvaluateProcessorVersionResponse. - * @memberof google.cloud.documentai.v1 - * @interface IEvaluateProcessorVersionResponse - * @property {string|null} [evaluation] EvaluateProcessorVersionResponse evaluation - */ - - /** - * Constructs a new EvaluateProcessorVersionResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents an EvaluateProcessorVersionResponse. - * @implements IEvaluateProcessorVersionResponse - * @constructor - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionResponse=} [properties] Properties to set - */ - function EvaluateProcessorVersionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluateProcessorVersionResponse evaluation. - * @member {string} evaluation - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse - * @instance - */ - EvaluateProcessorVersionResponse.prototype.evaluation = ""; - - /** - * Creates a new EvaluateProcessorVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse instance - */ - EvaluateProcessorVersionResponse.create = function create(properties) { - return new EvaluateProcessorVersionResponse(properties); - }; - - /** - * Encodes the specified EvaluateProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionResponse} message EvaluateProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluateProcessorVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluation); - return writer; - }; - - /** - * Encodes the specified EvaluateProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluateProcessorVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.IEvaluateProcessorVersionResponse} message EvaluateProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluateProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse - * @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.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluateProcessorVersionResponse.decode = function decode(reader, 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.EvaluateProcessorVersionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.evaluation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluateProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluateProcessorVersionResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluateProcessorVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluation != null && message.hasOwnProperty("evaluation")) - if (!$util.isString(message.evaluation)) - return "evaluation: string expected"; - return null; - }; - - /** - * Creates an EvaluateProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse - */ - EvaluateProcessorVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.EvaluateProcessorVersionResponse) - return object; - var message = new $root.google.cloud.documentai.v1.EvaluateProcessorVersionResponse(); - if (object.evaluation != null) - message.evaluation = String(object.evaluation); - return message; - }; - - /** - * Creates a plain object from an EvaluateProcessorVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1.EvaluateProcessorVersionResponse} message EvaluateProcessorVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluateProcessorVersionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.evaluation = ""; - if (message.evaluation != null && message.hasOwnProperty("evaluation")) - object.evaluation = message.evaluation; - return object; - }; - - /** - * Converts this EvaluateProcessorVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse - * @instance - * @returns {Object.} JSON object - */ - EvaluateProcessorVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluateProcessorVersionResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.EvaluateProcessorVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluateProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.EvaluateProcessorVersionResponse"; - }; - - return EvaluateProcessorVersionResponse; - })(); - - v1.GetEvaluationRequest = (function() { - - /** - * Properties of a GetEvaluationRequest. - * @memberof google.cloud.documentai.v1 - * @interface IGetEvaluationRequest - * @property {string|null} [name] GetEvaluationRequest name - */ - - /** - * Constructs a new GetEvaluationRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a GetEvaluationRequest. - * @implements IGetEvaluationRequest - * @constructor - * @param {google.cloud.documentai.v1.IGetEvaluationRequest=} [properties] Properties to set - */ - function GetEvaluationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvaluationRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1.GetEvaluationRequest - * @instance - */ - GetEvaluationRequest.prototype.name = ""; - - /** - * Creates a new GetEvaluationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.GetEvaluationRequest - * @static - * @param {google.cloud.documentai.v1.IGetEvaluationRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.GetEvaluationRequest} GetEvaluationRequest instance - */ - GetEvaluationRequest.create = function create(properties) { - return new GetEvaluationRequest(properties); - }; - - /** - * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.documentai.v1.GetEvaluationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.GetEvaluationRequest - * @static - * @param {google.cloud.documentai.v1.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationRequest.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 GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.GetEvaluationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.GetEvaluationRequest - * @static - * @param {google.cloud.documentai.v1.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvaluationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.GetEvaluationRequest - * @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.GetEvaluationRequest} GetEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationRequest.decode = function decode(reader, 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.GetEvaluationRequest(); - 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 GetEvaluationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.GetEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.GetEvaluationRequest} GetEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvaluationRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.GetEvaluationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvaluationRequest.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 GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.GetEvaluationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.GetEvaluationRequest} GetEvaluationRequest - */ - GetEvaluationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.GetEvaluationRequest) - return object; - var message = new $root.google.cloud.documentai.v1.GetEvaluationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.GetEvaluationRequest - * @static - * @param {google.cloud.documentai.v1.GetEvaluationRequest} message GetEvaluationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvaluationRequest.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 GetEvaluationRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.GetEvaluationRequest - * @instance - * @returns {Object.} JSON object - */ - GetEvaluationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetEvaluationRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.GetEvaluationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.GetEvaluationRequest"; - }; - - return GetEvaluationRequest; - })(); - - v1.ListEvaluationsRequest = (function() { - - /** - * Properties of a ListEvaluationsRequest. - * @memberof google.cloud.documentai.v1 - * @interface IListEvaluationsRequest - * @property {string|null} [parent] ListEvaluationsRequest parent - * @property {number|null} [pageSize] ListEvaluationsRequest pageSize - * @property {string|null} [pageToken] ListEvaluationsRequest pageToken - */ - - /** - * Constructs a new ListEvaluationsRequest. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ListEvaluationsRequest. - * @implements IListEvaluationsRequest - * @constructor - * @param {google.cloud.documentai.v1.IListEvaluationsRequest=} [properties] Properties to set - */ - function ListEvaluationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationsRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.parent = ""; - - /** - * ListEvaluationsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.pageSize = 0; - - /** - * ListEvaluationsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListEvaluationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @static - * @param {google.cloud.documentai.v1.IListEvaluationsRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ListEvaluationsRequest} ListEvaluationsRequest instance - */ - ListEvaluationsRequest.create = function create(properties) { - return new ListEvaluationsRequest(properties); - }; - - /** - * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @static - * @param {google.cloud.documentai.v1.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationsRequest.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 ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @static - * @param {google.cloud.documentai.v1.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @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.ListEvaluationsRequest} ListEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationsRequest.decode = function decode(reader, 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.ListEvaluationsRequest(); - 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 ListEvaluationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ListEvaluationsRequest} ListEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationsRequest message. - * @function verify - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationsRequest.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 ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ListEvaluationsRequest} ListEvaluationsRequest - */ - ListEvaluationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ListEvaluationsRequest) - return object; - var message = new $root.google.cloud.documentai.v1.ListEvaluationsRequest(); - 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 ListEvaluationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @static - * @param {google.cloud.documentai.v1.ListEvaluationsRequest} message ListEvaluationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationsRequest.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 ListEvaluationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationsRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ListEvaluationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ListEvaluationsRequest"; - }; - - return ListEvaluationsRequest; - })(); - - v1.ListEvaluationsResponse = (function() { - - /** - * Properties of a ListEvaluationsResponse. - * @memberof google.cloud.documentai.v1 - * @interface IListEvaluationsResponse - * @property {Array.|null} [evaluations] ListEvaluationsResponse evaluations - * @property {string|null} [nextPageToken] ListEvaluationsResponse nextPageToken - */ - - /** - * Constructs a new ListEvaluationsResponse. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ListEvaluationsResponse. - * @implements IListEvaluationsResponse - * @constructor - * @param {google.cloud.documentai.v1.IListEvaluationsResponse=} [properties] Properties to set - */ - function ListEvaluationsResponse(properties) { - this.evaluations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationsResponse evaluations. - * @member {Array.} evaluations - * @memberof google.cloud.documentai.v1.ListEvaluationsResponse - * @instance - */ - ListEvaluationsResponse.prototype.evaluations = $util.emptyArray; - - /** - * ListEvaluationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.documentai.v1.ListEvaluationsResponse - * @instance - */ - ListEvaluationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListEvaluationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ListEvaluationsResponse - * @static - * @param {google.cloud.documentai.v1.IListEvaluationsResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ListEvaluationsResponse} ListEvaluationsResponse instance - */ - ListEvaluationsResponse.create = function create(properties) { - return new ListEvaluationsResponse(properties); - }; - - /** - * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ListEvaluationsResponse - * @static - * @param {google.cloud.documentai.v1.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluations != null && message.evaluations.length) - for (var i = 0; i < message.evaluations.length; ++i) - $root.google.cloud.documentai.v1.Evaluation.encode(message.evaluations[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 ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ListEvaluationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ListEvaluationsResponse - * @static - * @param {google.cloud.documentai.v1.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ListEvaluationsResponse - * @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.ListEvaluationsResponse} ListEvaluationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationsResponse.decode = function decode(reader, 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.ListEvaluationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.evaluations && message.evaluations.length)) - message.evaluations = []; - message.evaluations.push($root.google.cloud.documentai.v1.Evaluation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ListEvaluationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ListEvaluationsResponse} ListEvaluationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationsResponse message. - * @function verify - * @memberof google.cloud.documentai.v1.ListEvaluationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluations != null && message.hasOwnProperty("evaluations")) { - if (!Array.isArray(message.evaluations)) - return "evaluations: array expected"; - for (var i = 0; i < message.evaluations.length; ++i) { - var error = $root.google.cloud.documentai.v1.Evaluation.verify(message.evaluations[i]); - if (error) - return "evaluations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ListEvaluationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ListEvaluationsResponse} ListEvaluationsResponse - */ - ListEvaluationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ListEvaluationsResponse) - return object; - var message = new $root.google.cloud.documentai.v1.ListEvaluationsResponse(); - if (object.evaluations) { - if (!Array.isArray(object.evaluations)) - throw TypeError(".google.cloud.documentai.v1.ListEvaluationsResponse.evaluations: array expected"); - message.evaluations = []; - for (var i = 0; i < object.evaluations.length; ++i) { - if (typeof object.evaluations[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.ListEvaluationsResponse.evaluations: object expected"); - message.evaluations[i] = $root.google.cloud.documentai.v1.Evaluation.fromObject(object.evaluations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ListEvaluationsResponse - * @static - * @param {google.cloud.documentai.v1.ListEvaluationsResponse} message ListEvaluationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evaluations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.evaluations && message.evaluations.length) { - object.evaluations = []; - for (var j = 0; j < message.evaluations.length; ++j) - object.evaluations[j] = $root.google.cloud.documentai.v1.Evaluation.toObject(message.evaluations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListEvaluationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ListEvaluationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationsResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ListEvaluationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ListEvaluationsResponse"; - }; - - return ListEvaluationsResponse; - })(); - - v1.DocumentSchema = (function() { - - /** - * Properties of a DocumentSchema. - * @memberof google.cloud.documentai.v1 - * @interface IDocumentSchema - * @property {string|null} [displayName] DocumentSchema displayName - * @property {string|null} [description] DocumentSchema description - * @property {Array.|null} [entityTypes] DocumentSchema entityTypes - * @property {google.cloud.documentai.v1.DocumentSchema.IMetadata|null} [metadata] DocumentSchema metadata - */ - - /** - * Constructs a new DocumentSchema. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a DocumentSchema. - * @implements IDocumentSchema - * @constructor - * @param {google.cloud.documentai.v1.IDocumentSchema=} [properties] Properties to set - */ - function DocumentSchema(properties) { - this.entityTypes = []; - if (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 displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1.DocumentSchema - * @instance - */ - DocumentSchema.prototype.displayName = ""; - - /** - * DocumentSchema description. - * @member {string} description - * @memberof google.cloud.documentai.v1.DocumentSchema - * @instance - */ - DocumentSchema.prototype.description = ""; - - /** - * DocumentSchema entityTypes. - * @member {Array.} entityTypes - * @memberof google.cloud.documentai.v1.DocumentSchema - * @instance - */ - DocumentSchema.prototype.entityTypes = $util.emptyArray; - - /** - * DocumentSchema metadata. - * @member {google.cloud.documentai.v1.DocumentSchema.IMetadata|null|undefined} metadata - * @memberof google.cloud.documentai.v1.DocumentSchema - * @instance - */ - DocumentSchema.prototype.metadata = null; - - /** - * Creates a new DocumentSchema instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DocumentSchema - * @static - * @param {google.cloud.documentai.v1.IDocumentSchema=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DocumentSchema} DocumentSchema instance - */ - DocumentSchema.create = function create(properties) { - return new DocumentSchema(properties); - }; - - /** - * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DocumentSchema - * @static - * @param {google.cloud.documentai.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.entityTypes != null && message.entityTypes.length) - for (var i = 0; i < message.entityTypes.length; ++i) - $root.google.cloud.documentai.v1.DocumentSchema.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.documentai.v1.DocumentSchema.Metadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DocumentSchema - * @static - * @param {google.cloud.documentai.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.documentai.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.documentai.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.documentai.v1.DocumentSchema(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.displayName = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - if (!(message.entityTypes && message.entityTypes.length)) - message.entityTypes = []; - message.entityTypes.push($root.google.cloud.documentai.v1.DocumentSchema.EntityType.decode(reader, reader.uint32())); - break; - } - case 4: { - message.metadata = $root.google.cloud.documentai.v1.DocumentSchema.Metadata.decode(reader, reader.uint32()); - 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.documentai.v1.DocumentSchema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.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.documentai.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { - if (!Array.isArray(message.entityTypes)) - return "entityTypes: array expected"; - for (var i = 0; i < message.entityTypes.length; ++i) { - var error = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.verify(message.entityTypes[i]); - if (error) - return "entityTypes." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.documentai.v1.DocumentSchema.Metadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - return null; - }; - - /** - * Creates a DocumentSchema message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DocumentSchema - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DocumentSchema} DocumentSchema - */ - DocumentSchema.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DocumentSchema) - return object; - var message = new $root.google.cloud.documentai.v1.DocumentSchema(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.entityTypes) { - if (!Array.isArray(object.entityTypes)) - throw TypeError(".google.cloud.documentai.v1.DocumentSchema.entityTypes: array expected"); - message.entityTypes = []; - for (var i = 0; i < object.entityTypes.length; ++i) { - if (typeof object.entityTypes[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.DocumentSchema.entityTypes: object expected"); - message.entityTypes[i] = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.fromObject(object.entityTypes[i]); - } - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.documentai.v1.DocumentSchema.metadata: object expected"); - message.metadata = $root.google.cloud.documentai.v1.DocumentSchema.Metadata.fromObject(object.metadata); - } - return message; - }; - - /** - * Creates a plain object from a DocumentSchema message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DocumentSchema - * @static - * @param {google.cloud.documentai.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.entityTypes = []; - if (options.defaults) { - object.displayName = ""; - object.description = ""; - object.metadata = null; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.entityTypes && message.entityTypes.length) { - object.entityTypes = []; - for (var j = 0; j < message.entityTypes.length; ++j) - object.entityTypes[j] = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.toObject(message.entityTypes[j], options); - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.documentai.v1.DocumentSchema.Metadata.toObject(message.metadata, options); - return object; - }; - - /** - * Converts this DocumentSchema to JSON. - * @function toJSON - * @memberof google.cloud.documentai.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.documentai.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.documentai.v1.DocumentSchema"; - }; - - DocumentSchema.EntityType = (function() { - - /** - * Properties of an EntityType. - * @memberof google.cloud.documentai.v1.DocumentSchema - * @interface IEntityType - * @property {google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues|null} [enumValues] EntityType enumValues - * @property {string|null} [displayName] EntityType displayName - * @property {string|null} [name] EntityType name - * @property {Array.|null} [baseTypes] EntityType baseTypes - * @property {Array.|null} [properties] EntityType properties - */ - - /** - * Constructs a new EntityType. - * @memberof google.cloud.documentai.v1.DocumentSchema - * @classdesc Represents an EntityType. - * @implements IEntityType - * @constructor - * @param {google.cloud.documentai.v1.DocumentSchema.IEntityType=} [properties] Properties to set - */ - function EntityType(properties) { - this.baseTypes = []; - 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]]; - } - - /** - * EntityType enumValues. - * @member {google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues|null|undefined} enumValues - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @instance - */ - EntityType.prototype.enumValues = null; - - /** - * EntityType displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @instance - */ - EntityType.prototype.displayName = ""; - - /** - * EntityType name. - * @member {string} name - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @instance - */ - EntityType.prototype.name = ""; - - /** - * EntityType baseTypes. - * @member {Array.} baseTypes - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @instance - */ - EntityType.prototype.baseTypes = $util.emptyArray; - - /** - * EntityType properties. - * @member {Array.} properties - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @instance - */ - EntityType.prototype.properties = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * EntityType valueSource. - * @member {"enumValues"|undefined} valueSource - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @instance - */ - Object.defineProperty(EntityType.prototype, "valueSource", { - get: $util.oneOfGetter($oneOfFields = ["enumValues"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new EntityType instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.IEntityType=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType} EntityType instance - */ - EntityType.create = function create(properties) { - return new EntityType(properties); - }; - - /** - * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.IEntityType} message EntityType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityType.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.baseTypes != null && message.baseTypes.length) - for (var i = 0; i < message.baseTypes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseTypes[i]); - if (message.properties != null && message.properties.length) - for (var i = 0; i < message.properties.length; ++i) - $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.encode(message.properties[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.displayName); - if (message.enumValues != null && Object.hasOwnProperty.call(message, "enumValues")) - $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.encode(message.enumValues, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.IEntityType} message EntityType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EntityType message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @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.DocumentSchema.EntityType} EntityType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityType.decode = function decode(reader, 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.DocumentSchema.EntityType(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 14: { - message.enumValues = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.decode(reader, reader.uint32()); - break; - } - case 13: { - message.displayName = reader.string(); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.baseTypes && message.baseTypes.length)) - message.baseTypes = []; - message.baseTypes.push(reader.string()); - break; - } - case 6: { - if (!(message.properties && message.properties.length)) - message.properties = []; - message.properties.push($root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EntityType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType} EntityType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EntityType message. - * @function verify - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntityType.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.enumValues != null && message.hasOwnProperty("enumValues")) { - properties.valueSource = 1; - { - var error = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.verify(message.enumValues); - if (error) - return "enumValues." + error; - } - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.baseTypes != null && message.hasOwnProperty("baseTypes")) { - if (!Array.isArray(message.baseTypes)) - return "baseTypes: array expected"; - for (var i = 0; i < message.baseTypes.length; ++i) - if (!$util.isString(message.baseTypes[i])) - return "baseTypes: string[] 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.documentai.v1.DocumentSchema.EntityType.Property.verify(message.properties[i]); - if (error) - return "properties." + error; - } - } - return null; - }; - - /** - * Creates an EntityType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType} EntityType - */ - EntityType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DocumentSchema.EntityType) - return object; - var message = new $root.google.cloud.documentai.v1.DocumentSchema.EntityType(); - if (object.enumValues != null) { - if (typeof object.enumValues !== "object") - throw TypeError(".google.cloud.documentai.v1.DocumentSchema.EntityType.enumValues: object expected"); - message.enumValues = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.fromObject(object.enumValues); - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.name != null) - message.name = String(object.name); - if (object.baseTypes) { - if (!Array.isArray(object.baseTypes)) - throw TypeError(".google.cloud.documentai.v1.DocumentSchema.EntityType.baseTypes: array expected"); - message.baseTypes = []; - for (var i = 0; i < object.baseTypes.length; ++i) - message.baseTypes[i] = String(object.baseTypes[i]); - } - if (object.properties) { - if (!Array.isArray(object.properties)) - throw TypeError(".google.cloud.documentai.v1.DocumentSchema.EntityType.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.DocumentSchema.EntityType.properties: object expected"); - message.properties[i] = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.fromObject(object.properties[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EntityType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.EntityType} message EntityType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.baseTypes = []; - object.properties = []; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.baseTypes && message.baseTypes.length) { - object.baseTypes = []; - for (var j = 0; j < message.baseTypes.length; ++j) - object.baseTypes[j] = message.baseTypes[j]; - } - 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.DocumentSchema.EntityType.Property.toObject(message.properties[j], options); - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.enumValues != null && message.hasOwnProperty("enumValues")) { - object.enumValues = $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.toObject(message.enumValues, options); - if (options.oneofs) - object.valueSource = "enumValues"; - } - return object; - }; - - /** - * Converts this EntityType to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @instance - * @returns {Object.} JSON object - */ - EntityType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EntityType - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EntityType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DocumentSchema.EntityType"; - }; - - EntityType.EnumValues = (function() { - - /** - * Properties of an EnumValues. - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @interface IEnumValues - * @property {Array.|null} [values] EnumValues values - */ - - /** - * Constructs a new EnumValues. - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @classdesc Represents an EnumValues. - * @implements IEnumValues - * @constructor - * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues=} [properties] Properties to set - */ - function EnumValues(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]]; - } - - /** - * EnumValues values. - * @member {Array.} values - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues - * @instance - */ - EnumValues.prototype.values = $util.emptyArray; - - /** - * Creates a new EnumValues instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues} EnumValues instance - */ - EnumValues.create = function create(properties) { - return new EnumValues(properties); - }; - - /** - * Encodes the specified EnumValues message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues} message EnumValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValues.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 EnumValues message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.IEnumValues} message EnumValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValues message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues - * @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.DocumentSchema.EntityType.EnumValues} EnumValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValues.decode = function decode(reader, 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.DocumentSchema.EntityType.EnumValues(); - 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 EnumValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues} EnumValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValues message. - * @function verify - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValues.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 EnumValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues} EnumValues - */ - EnumValues.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues) - return object; - var message = new $root.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues.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 EnumValues message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues} message EnumValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValues.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 EnumValues to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues - * @instance - * @returns {Object.} JSON object - */ - EnumValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValues - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues"; - }; - - return EnumValues; - })(); - - EntityType.Property = (function() { - - /** - * Properties of a Property. - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @interface IProperty - * @property {string|null} [name] Property name - * @property {string|null} [displayName] Property displayName - * @property {string|null} [valueType] Property valueType - * @property {google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType|null} [occurrenceType] Property occurrenceType - * @property {google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method|null} [method] Property method - */ - - /** - * Constructs a new Property. - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType - * @classdesc Represents a Property. - * @implements IProperty - * @constructor - * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.Property - * @instance - */ - Property.prototype.name = ""; - - /** - * Property displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property - * @instance - */ - Property.prototype.displayName = ""; - - /** - * Property valueType. - * @member {string} valueType - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property - * @instance - */ - Property.prototype.valueType = ""; - - /** - * Property occurrenceType. - * @member {google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType} occurrenceType - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property - * @instance - */ - Property.prototype.occurrenceType = 0; - - /** - * Property method. - * @member {google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method} method - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property - * @instance - */ - Property.prototype.method = 0; - - /** - * Creates a new Property instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.IProperty=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType.Property} Property instance - */ - Property.create = function create(properties) { - return new Property(properties); - }; - - /** - * Encodes the specified Property message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.Property.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.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.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.valueType); - if (message.occurrenceType != null && Object.hasOwnProperty.call(message, "occurrenceType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.occurrenceType); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); - if (message.method != null && Object.hasOwnProperty.call(message, "method")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.method); - return writer; - }; - - /** - * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.EntityType.Property.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.Property - * @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.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.Property(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 6: { - message.displayName = reader.string(); - break; - } - case 2: { - message.valueType = reader.string(); - break; - } - case 3: { - message.occurrenceType = reader.int32(); - break; - } - case 8: { - message.method = reader.int32(); - 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.documentai.v1.DocumentSchema.EntityType.Property - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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"; - 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.valueType != null && message.hasOwnProperty("valueType")) - if (!$util.isString(message.valueType)) - return "valueType: string expected"; - if (message.occurrenceType != null && message.hasOwnProperty("occurrenceType")) - switch (message.occurrenceType) { - default: - return "occurrenceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - 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 a Property message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DocumentSchema.EntityType.Property} Property - */ - Property.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property) - return object; - var message = new $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.valueType != null) - message.valueType = String(object.valueType); - switch (object.occurrenceType) { - default: - if (typeof object.occurrenceType === "number") { - message.occurrenceType = object.occurrenceType; - break; - } - break; - case "OCCURRENCE_TYPE_UNSPECIFIED": - case 0: - message.occurrenceType = 0; - break; - case "OPTIONAL_ONCE": - case 1: - message.occurrenceType = 1; - break; - case "OPTIONAL_MULTIPLE": - case 2: - message.occurrenceType = 2; - break; - case "REQUIRED_ONCE": - case 3: - message.occurrenceType = 3; - break; - case "REQUIRED_MULTIPLE": - case 4: - message.occurrenceType = 4; - break; - } - 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 a Property message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.Property - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.EntityType.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 = ""; - object.valueType = ""; - object.occurrenceType = options.enums === String ? "OCCURRENCE_TYPE_UNSPECIFIED" : 0; - object.displayName = ""; - object.method = options.enums === String ? "METHOD_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = message.valueType; - if (message.occurrenceType != null && message.hasOwnProperty("occurrenceType")) - object.occurrenceType = options.enums === String ? $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] === undefined ? message.occurrenceType : $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] : message.occurrenceType; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.method != null && message.hasOwnProperty("method")) - object.method = options.enums === String ? $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method[message.method] === undefined ? message.method : $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method[message.method] : message.method; - return object; - }; - - /** - * Converts this Property to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.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.documentai.v1.DocumentSchema.EntityType.Property"; - }; - - /** - * OccurrenceType enum. - * @name google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType - * @enum {number} - * @property {number} OCCURRENCE_TYPE_UNSPECIFIED=0 OCCURRENCE_TYPE_UNSPECIFIED value - * @property {number} OPTIONAL_ONCE=1 OPTIONAL_ONCE value - * @property {number} OPTIONAL_MULTIPLE=2 OPTIONAL_MULTIPLE value - * @property {number} REQUIRED_ONCE=3 REQUIRED_ONCE value - * @property {number} REQUIRED_MULTIPLE=4 REQUIRED_MULTIPLE value - */ - Property.OccurrenceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OCCURRENCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL_ONCE"] = 1; - values[valuesById[2] = "OPTIONAL_MULTIPLE"] = 2; - values[valuesById[3] = "REQUIRED_ONCE"] = 3; - values[valuesById[4] = "REQUIRED_MULTIPLE"] = 4; - return values; - })(); - - /** - * Method enum. - * @name google.cloud.documentai.v1.DocumentSchema.EntityType.Property.Method - * @enum {number} - * @property {number} METHOD_UNSPECIFIED=0 METHOD_UNSPECIFIED value - * @property {number} EXTRACT=1 EXTRACT value - * @property {number} DERIVE=2 DERIVE value - */ - Property.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 Property; - })(); - - return EntityType; - })(); - - DocumentSchema.Metadata = (function() { - - /** - * Properties of a Metadata. - * @memberof google.cloud.documentai.v1.DocumentSchema - * @interface IMetadata - * @property {boolean|null} [documentSplitter] Metadata documentSplitter - * @property {boolean|null} [documentAllowMultipleLabels] Metadata documentAllowMultipleLabels - * @property {boolean|null} [prefixedNamingOnProperties] Metadata prefixedNamingOnProperties - * @property {boolean|null} [skipNamingValidation] Metadata skipNamingValidation - */ - - /** - * Constructs a new Metadata. - * @memberof google.cloud.documentai.v1.DocumentSchema - * @classdesc Represents a Metadata. - * @implements IMetadata - * @constructor - * @param {google.cloud.documentai.v1.DocumentSchema.IMetadata=} [properties] Properties to set - */ - function Metadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Metadata documentSplitter. - * @member {boolean} documentSplitter - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @instance - */ - Metadata.prototype.documentSplitter = false; - - /** - * Metadata documentAllowMultipleLabels. - * @member {boolean} documentAllowMultipleLabels - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @instance - */ - Metadata.prototype.documentAllowMultipleLabels = false; - - /** - * Metadata prefixedNamingOnProperties. - * @member {boolean} prefixedNamingOnProperties - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @instance - */ - Metadata.prototype.prefixedNamingOnProperties = false; - - /** - * Metadata skipNamingValidation. - * @member {boolean} skipNamingValidation - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @instance - */ - Metadata.prototype.skipNamingValidation = false; - - /** - * Creates a new Metadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.IMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.DocumentSchema.Metadata} Metadata instance - */ - Metadata.create = function create(properties) { - return new Metadata(properties); - }; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.Metadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentSplitter != null && Object.hasOwnProperty.call(message, "documentSplitter")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.documentSplitter); - if (message.documentAllowMultipleLabels != null && Object.hasOwnProperty.call(message, "documentAllowMultipleLabels")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.documentAllowMultipleLabels); - if (message.prefixedNamingOnProperties != null && Object.hasOwnProperty.call(message, "prefixedNamingOnProperties")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prefixedNamingOnProperties); - if (message.skipNamingValidation != null && Object.hasOwnProperty.call(message, "skipNamingValidation")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.skipNamingValidation); - return writer; - }; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.DocumentSchema.Metadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @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.DocumentSchema.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decode = function decode(reader, 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.DocumentSchema.Metadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.documentSplitter = reader.bool(); - break; - } - case 2: { - message.documentAllowMultipleLabels = reader.bool(); - break; - } - case 6: { - message.prefixedNamingOnProperties = reader.bool(); - break; - } - case 7: { - message.skipNamingValidation = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.DocumentSchema.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Metadata message. - * @function verify - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentSplitter != null && message.hasOwnProperty("documentSplitter")) - if (typeof message.documentSplitter !== "boolean") - return "documentSplitter: boolean expected"; - if (message.documentAllowMultipleLabels != null && message.hasOwnProperty("documentAllowMultipleLabels")) - if (typeof message.documentAllowMultipleLabels !== "boolean") - return "documentAllowMultipleLabels: boolean expected"; - if (message.prefixedNamingOnProperties != null && message.hasOwnProperty("prefixedNamingOnProperties")) - if (typeof message.prefixedNamingOnProperties !== "boolean") - return "prefixedNamingOnProperties: boolean expected"; - if (message.skipNamingValidation != null && message.hasOwnProperty("skipNamingValidation")) - if (typeof message.skipNamingValidation !== "boolean") - return "skipNamingValidation: boolean expected"; - return null; - }; - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.DocumentSchema.Metadata} Metadata - */ - Metadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.DocumentSchema.Metadata) - return object; - var message = new $root.google.cloud.documentai.v1.DocumentSchema.Metadata(); - if (object.documentSplitter != null) - message.documentSplitter = Boolean(object.documentSplitter); - if (object.documentAllowMultipleLabels != null) - message.documentAllowMultipleLabels = Boolean(object.documentAllowMultipleLabels); - if (object.prefixedNamingOnProperties != null) - message.prefixedNamingOnProperties = Boolean(object.prefixedNamingOnProperties); - if (object.skipNamingValidation != null) - message.skipNamingValidation = Boolean(object.skipNamingValidation); - return message; - }; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @static - * @param {google.cloud.documentai.v1.DocumentSchema.Metadata} message Metadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.documentSplitter = false; - object.documentAllowMultipleLabels = false; - object.prefixedNamingOnProperties = false; - object.skipNamingValidation = false; - } - if (message.documentSplitter != null && message.hasOwnProperty("documentSplitter")) - object.documentSplitter = message.documentSplitter; - if (message.documentAllowMultipleLabels != null && message.hasOwnProperty("documentAllowMultipleLabels")) - object.documentAllowMultipleLabels = message.documentAllowMultipleLabels; - if (message.prefixedNamingOnProperties != null && message.hasOwnProperty("prefixedNamingOnProperties")) - object.prefixedNamingOnProperties = message.prefixedNamingOnProperties; - if (message.skipNamingValidation != null && message.hasOwnProperty("skipNamingValidation")) - object.skipNamingValidation = message.skipNamingValidation; - return object; - }; - - /** - * Converts this Metadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @instance - * @returns {Object.} JSON object - */ - Metadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Metadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.DocumentSchema.Metadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.DocumentSchema.Metadata"; - }; - - return Metadata; - })(); - - return DocumentSchema; - })(); - - v1.EvaluationReference = (function() { - - /** - * Properties of an EvaluationReference. - * @memberof google.cloud.documentai.v1 - * @interface IEvaluationReference - * @property {string|null} [operation] EvaluationReference operation - * @property {string|null} [evaluation] EvaluationReference evaluation - * @property {google.cloud.documentai.v1.Evaluation.IMetrics|null} [aggregateMetrics] EvaluationReference aggregateMetrics - * @property {google.cloud.documentai.v1.Evaluation.IMetrics|null} [aggregateMetricsExact] EvaluationReference aggregateMetricsExact - */ - - /** - * Constructs a new EvaluationReference. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents an EvaluationReference. - * @implements IEvaluationReference - * @constructor - * @param {google.cloud.documentai.v1.IEvaluationReference=} [properties] Properties to set - */ - function EvaluationReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationReference operation. - * @member {string} operation - * @memberof google.cloud.documentai.v1.EvaluationReference - * @instance - */ - EvaluationReference.prototype.operation = ""; - - /** - * EvaluationReference evaluation. - * @member {string} evaluation - * @memberof google.cloud.documentai.v1.EvaluationReference - * @instance - */ - EvaluationReference.prototype.evaluation = ""; - - /** - * EvaluationReference aggregateMetrics. - * @member {google.cloud.documentai.v1.Evaluation.IMetrics|null|undefined} aggregateMetrics - * @memberof google.cloud.documentai.v1.EvaluationReference - * @instance - */ - EvaluationReference.prototype.aggregateMetrics = null; - - /** - * EvaluationReference aggregateMetricsExact. - * @member {google.cloud.documentai.v1.Evaluation.IMetrics|null|undefined} aggregateMetricsExact - * @memberof google.cloud.documentai.v1.EvaluationReference - * @instance - */ - EvaluationReference.prototype.aggregateMetricsExact = null; - - /** - * Creates a new EvaluationReference instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.EvaluationReference - * @static - * @param {google.cloud.documentai.v1.IEvaluationReference=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.EvaluationReference} EvaluationReference instance - */ - EvaluationReference.create = function create(properties) { - return new EvaluationReference(properties); - }; - - /** - * Encodes the specified EvaluationReference message. Does not implicitly {@link google.cloud.documentai.v1.EvaluationReference.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.EvaluationReference - * @static - * @param {google.cloud.documentai.v1.IEvaluationReference} message EvaluationReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); - if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluation); - if (message.aggregateMetrics != null && Object.hasOwnProperty.call(message, "aggregateMetrics")) - $root.google.cloud.documentai.v1.Evaluation.Metrics.encode(message.aggregateMetrics, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.aggregateMetricsExact != null && Object.hasOwnProperty.call(message, "aggregateMetricsExact")) - $root.google.cloud.documentai.v1.Evaluation.Metrics.encode(message.aggregateMetricsExact, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EvaluationReference message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.EvaluationReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.EvaluationReference - * @static - * @param {google.cloud.documentai.v1.IEvaluationReference} message EvaluationReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationReference message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.EvaluationReference - * @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.EvaluationReference} EvaluationReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationReference.decode = function decode(reader, 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.EvaluationReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.operation = reader.string(); - break; - } - case 2: { - message.evaluation = reader.string(); - break; - } - case 4: { - message.aggregateMetrics = $root.google.cloud.documentai.v1.Evaluation.Metrics.decode(reader, reader.uint32()); - break; - } - case 5: { - message.aggregateMetricsExact = $root.google.cloud.documentai.v1.Evaluation.Metrics.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.EvaluationReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.EvaluationReference} EvaluationReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationReference message. - * @function verify - * @memberof google.cloud.documentai.v1.EvaluationReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operation != null && message.hasOwnProperty("operation")) - if (!$util.isString(message.operation)) - return "operation: string expected"; - if (message.evaluation != null && message.hasOwnProperty("evaluation")) - if (!$util.isString(message.evaluation)) - return "evaluation: string expected"; - if (message.aggregateMetrics != null && message.hasOwnProperty("aggregateMetrics")) { - var error = $root.google.cloud.documentai.v1.Evaluation.Metrics.verify(message.aggregateMetrics); - if (error) - return "aggregateMetrics." + error; - } - if (message.aggregateMetricsExact != null && message.hasOwnProperty("aggregateMetricsExact")) { - var error = $root.google.cloud.documentai.v1.Evaluation.Metrics.verify(message.aggregateMetricsExact); - if (error) - return "aggregateMetricsExact." + error; - } - return null; - }; - - /** - * Creates an EvaluationReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.EvaluationReference - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.EvaluationReference} EvaluationReference - */ - EvaluationReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.EvaluationReference) - return object; - var message = new $root.google.cloud.documentai.v1.EvaluationReference(); - if (object.operation != null) - message.operation = String(object.operation); - if (object.evaluation != null) - message.evaluation = String(object.evaluation); - if (object.aggregateMetrics != null) { - if (typeof object.aggregateMetrics !== "object") - throw TypeError(".google.cloud.documentai.v1.EvaluationReference.aggregateMetrics: object expected"); - message.aggregateMetrics = $root.google.cloud.documentai.v1.Evaluation.Metrics.fromObject(object.aggregateMetrics); - } - if (object.aggregateMetricsExact != null) { - if (typeof object.aggregateMetricsExact !== "object") - throw TypeError(".google.cloud.documentai.v1.EvaluationReference.aggregateMetricsExact: object expected"); - message.aggregateMetricsExact = $root.google.cloud.documentai.v1.Evaluation.Metrics.fromObject(object.aggregateMetricsExact); - } - return message; - }; - - /** - * Creates a plain object from an EvaluationReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.EvaluationReference - * @static - * @param {google.cloud.documentai.v1.EvaluationReference} message EvaluationReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.operation = ""; - object.evaluation = ""; - object.aggregateMetrics = null; - object.aggregateMetricsExact = null; - } - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = message.operation; - if (message.evaluation != null && message.hasOwnProperty("evaluation")) - object.evaluation = message.evaluation; - if (message.aggregateMetrics != null && message.hasOwnProperty("aggregateMetrics")) - object.aggregateMetrics = $root.google.cloud.documentai.v1.Evaluation.Metrics.toObject(message.aggregateMetrics, options); - if (message.aggregateMetricsExact != null && message.hasOwnProperty("aggregateMetricsExact")) - object.aggregateMetricsExact = $root.google.cloud.documentai.v1.Evaluation.Metrics.toObject(message.aggregateMetricsExact, options); - return object; - }; - - /** - * Converts this EvaluationReference to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.EvaluationReference - * @instance - * @returns {Object.} JSON object - */ - EvaluationReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationReference - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.EvaluationReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.EvaluationReference"; - }; - - return EvaluationReference; - })(); - - v1.Evaluation = (function() { - - /** - * Properties of an Evaluation. - * @memberof google.cloud.documentai.v1 - * @interface IEvaluation - * @property {string|null} [name] Evaluation name - * @property {google.protobuf.ITimestamp|null} [createTime] Evaluation createTime - * @property {google.cloud.documentai.v1.Evaluation.ICounters|null} [documentCounters] Evaluation documentCounters - * @property {google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics|null} [allEntitiesMetrics] Evaluation allEntitiesMetrics - * @property {Object.|null} [entityMetrics] Evaluation entityMetrics - * @property {string|null} [kmsKeyName] Evaluation kmsKeyName - * @property {string|null} [kmsKeyVersionName] Evaluation kmsKeyVersionName - */ - - /** - * Constructs a new Evaluation. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents an Evaluation. - * @implements IEvaluation - * @constructor - * @param {google.cloud.documentai.v1.IEvaluation=} [properties] Properties to set - */ - function Evaluation(properties) { - this.entityMetrics = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Evaluation name. - * @member {string} name - * @memberof google.cloud.documentai.v1.Evaluation - * @instance - */ - Evaluation.prototype.name = ""; - - /** - * Evaluation createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1.Evaluation - * @instance - */ - Evaluation.prototype.createTime = null; - - /** - * Evaluation documentCounters. - * @member {google.cloud.documentai.v1.Evaluation.ICounters|null|undefined} documentCounters - * @memberof google.cloud.documentai.v1.Evaluation - * @instance - */ - Evaluation.prototype.documentCounters = null; - - /** - * Evaluation allEntitiesMetrics. - * @member {google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics|null|undefined} allEntitiesMetrics - * @memberof google.cloud.documentai.v1.Evaluation - * @instance - */ - Evaluation.prototype.allEntitiesMetrics = null; - - /** - * Evaluation entityMetrics. - * @member {Object.} entityMetrics - * @memberof google.cloud.documentai.v1.Evaluation - * @instance - */ - Evaluation.prototype.entityMetrics = $util.emptyObject; - - /** - * Evaluation kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.documentai.v1.Evaluation - * @instance - */ - Evaluation.prototype.kmsKeyName = ""; - - /** - * Evaluation kmsKeyVersionName. - * @member {string} kmsKeyVersionName - * @memberof google.cloud.documentai.v1.Evaluation - * @instance - */ - Evaluation.prototype.kmsKeyVersionName = ""; - - /** - * Creates a new Evaluation instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Evaluation - * @static - * @param {google.cloud.documentai.v1.IEvaluation=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Evaluation} Evaluation instance - */ - Evaluation.create = function create(properties) { - return new Evaluation(properties); - }; - - /** - * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Evaluation - * @static - * @param {google.cloud.documentai.v1.IEvaluation} message Evaluation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Evaluation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.allEntitiesMetrics != null && Object.hasOwnProperty.call(message, "allEntitiesMetrics")) - $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.encode(message.allEntitiesMetrics, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.entityMetrics != null && Object.hasOwnProperty.call(message, "entityMetrics")) - for (var keys = Object.keys(message.entityMetrics), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.encode(message.entityMetrics[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.documentCounters != null && Object.hasOwnProperty.call(message, "documentCounters")) - $root.google.cloud.documentai.v1.Evaluation.Counters.encode(message.documentCounters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.kmsKeyName); - if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.kmsKeyVersionName); - return writer; - }; - - /** - * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Evaluation - * @static - * @param {google.cloud.documentai.v1.IEvaluation} message Evaluation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Evaluation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Evaluation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Evaluation - * @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.Evaluation} Evaluation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Evaluation.decode = function decode(reader, 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.Evaluation(), key, value; - 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.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.documentCounters = $root.google.cloud.documentai.v1.Evaluation.Counters.decode(reader, reader.uint32()); - break; - } - case 3: { - message.allEntitiesMetrics = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); - break; - } - case 4: { - if (message.entityMetrics === $util.emptyObject) - message.entityMetrics = {}; - 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.documentai.v1.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.entityMetrics[key] = value; - break; - } - case 6: { - message.kmsKeyName = reader.string(); - break; - } - case 7: { - message.kmsKeyVersionName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Evaluation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Evaluation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Evaluation} Evaluation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Evaluation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Evaluation message. - * @function verify - * @memberof google.cloud.documentai.v1.Evaluation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Evaluation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.documentCounters != null && message.hasOwnProperty("documentCounters")) { - var error = $root.google.cloud.documentai.v1.Evaluation.Counters.verify(message.documentCounters); - if (error) - return "documentCounters." + error; - } - if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) { - var error = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.verify(message.allEntitiesMetrics); - if (error) - return "allEntitiesMetrics." + error; - } - if (message.entityMetrics != null && message.hasOwnProperty("entityMetrics")) { - if (!$util.isObject(message.entityMetrics)) - return "entityMetrics: object expected"; - var key = Object.keys(message.entityMetrics); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.verify(message.entityMetrics[key[i]]); - if (error) - return "entityMetrics." + error; - } - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) - if (!$util.isString(message.kmsKeyVersionName)) - return "kmsKeyVersionName: string expected"; - return null; - }; - - /** - * Creates an Evaluation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Evaluation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Evaluation} Evaluation - */ - Evaluation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Evaluation) - return object; - var message = new $root.google.cloud.documentai.v1.Evaluation(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1.Evaluation.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.documentCounters != null) { - if (typeof object.documentCounters !== "object") - throw TypeError(".google.cloud.documentai.v1.Evaluation.documentCounters: object expected"); - message.documentCounters = $root.google.cloud.documentai.v1.Evaluation.Counters.fromObject(object.documentCounters); - } - if (object.allEntitiesMetrics != null) { - if (typeof object.allEntitiesMetrics !== "object") - throw TypeError(".google.cloud.documentai.v1.Evaluation.allEntitiesMetrics: object expected"); - message.allEntitiesMetrics = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.fromObject(object.allEntitiesMetrics); - } - if (object.entityMetrics) { - if (typeof object.entityMetrics !== "object") - throw TypeError(".google.cloud.documentai.v1.Evaluation.entityMetrics: object expected"); - message.entityMetrics = {}; - for (var keys = Object.keys(object.entityMetrics), i = 0; i < keys.length; ++i) { - if (typeof object.entityMetrics[keys[i]] !== "object") - throw TypeError(".google.cloud.documentai.v1.Evaluation.entityMetrics: object expected"); - message.entityMetrics[keys[i]] = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.fromObject(object.entityMetrics[keys[i]]); - } - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyVersionName != null) - message.kmsKeyVersionName = String(object.kmsKeyVersionName); - return message; - }; - - /** - * Creates a plain object from an Evaluation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Evaluation - * @static - * @param {google.cloud.documentai.v1.Evaluation} message Evaluation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Evaluation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.entityMetrics = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.allEntitiesMetrics = null; - object.documentCounters = null; - object.kmsKeyName = ""; - object.kmsKeyVersionName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) - object.allEntitiesMetrics = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.toObject(message.allEntitiesMetrics, options); - var keys2; - if (message.entityMetrics && (keys2 = Object.keys(message.entityMetrics)).length) { - object.entityMetrics = {}; - for (var j = 0; j < keys2.length; ++j) - object.entityMetrics[keys2[j]] = $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.toObject(message.entityMetrics[keys2[j]], options); - } - if (message.documentCounters != null && message.hasOwnProperty("documentCounters")) - object.documentCounters = $root.google.cloud.documentai.v1.Evaluation.Counters.toObject(message.documentCounters, options); - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) - object.kmsKeyVersionName = message.kmsKeyVersionName; - return object; - }; - - /** - * Converts this Evaluation to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Evaluation - * @instance - * @returns {Object.} JSON object - */ - Evaluation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Evaluation - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Evaluation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Evaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Evaluation"; - }; - - Evaluation.Counters = (function() { - - /** - * Properties of a Counters. - * @memberof google.cloud.documentai.v1.Evaluation - * @interface ICounters - * @property {number|null} [inputDocumentsCount] Counters inputDocumentsCount - * @property {number|null} [invalidDocumentsCount] Counters invalidDocumentsCount - * @property {number|null} [failedDocumentsCount] Counters failedDocumentsCount - * @property {number|null} [evaluatedDocumentsCount] Counters evaluatedDocumentsCount - */ - - /** - * Constructs a new Counters. - * @memberof google.cloud.documentai.v1.Evaluation - * @classdesc Represents a Counters. - * @implements ICounters - * @constructor - * @param {google.cloud.documentai.v1.Evaluation.ICounters=} [properties] Properties to set - */ - function Counters(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Counters inputDocumentsCount. - * @member {number} inputDocumentsCount - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @instance - */ - Counters.prototype.inputDocumentsCount = 0; - - /** - * Counters invalidDocumentsCount. - * @member {number} invalidDocumentsCount - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @instance - */ - Counters.prototype.invalidDocumentsCount = 0; - - /** - * Counters failedDocumentsCount. - * @member {number} failedDocumentsCount - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @instance - */ - Counters.prototype.failedDocumentsCount = 0; - - /** - * Counters evaluatedDocumentsCount. - * @member {number} evaluatedDocumentsCount - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @instance - */ - Counters.prototype.evaluatedDocumentsCount = 0; - - /** - * Creates a new Counters instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @static - * @param {google.cloud.documentai.v1.Evaluation.ICounters=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Evaluation.Counters} Counters instance - */ - Counters.create = function create(properties) { - return new Counters(properties); - }; - - /** - * Encodes the specified Counters message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Counters.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @static - * @param {google.cloud.documentai.v1.Evaluation.ICounters} message Counters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Counters.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputDocumentsCount != null && Object.hasOwnProperty.call(message, "inputDocumentsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.inputDocumentsCount); - if (message.invalidDocumentsCount != null && Object.hasOwnProperty.call(message, "invalidDocumentsCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidDocumentsCount); - if (message.failedDocumentsCount != null && Object.hasOwnProperty.call(message, "failedDocumentsCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.failedDocumentsCount); - if (message.evaluatedDocumentsCount != null && Object.hasOwnProperty.call(message, "evaluatedDocumentsCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.evaluatedDocumentsCount); - return writer; - }; - - /** - * Encodes the specified Counters message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Counters.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @static - * @param {google.cloud.documentai.v1.Evaluation.ICounters} message Counters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Counters.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Counters message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @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.Evaluation.Counters} Counters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Counters.decode = function decode(reader, 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.Evaluation.Counters(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.inputDocumentsCount = reader.int32(); - break; - } - case 2: { - message.invalidDocumentsCount = reader.int32(); - break; - } - case 3: { - message.failedDocumentsCount = reader.int32(); - break; - } - case 4: { - message.evaluatedDocumentsCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Counters message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Evaluation.Counters} Counters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Counters.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Counters message. - * @function verify - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Counters.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputDocumentsCount != null && message.hasOwnProperty("inputDocumentsCount")) - if (!$util.isInteger(message.inputDocumentsCount)) - return "inputDocumentsCount: integer expected"; - if (message.invalidDocumentsCount != null && message.hasOwnProperty("invalidDocumentsCount")) - if (!$util.isInteger(message.invalidDocumentsCount)) - return "invalidDocumentsCount: integer expected"; - if (message.failedDocumentsCount != null && message.hasOwnProperty("failedDocumentsCount")) - if (!$util.isInteger(message.failedDocumentsCount)) - return "failedDocumentsCount: integer expected"; - if (message.evaluatedDocumentsCount != null && message.hasOwnProperty("evaluatedDocumentsCount")) - if (!$util.isInteger(message.evaluatedDocumentsCount)) - return "evaluatedDocumentsCount: integer expected"; - return null; - }; - - /** - * Creates a Counters message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Evaluation.Counters} Counters - */ - Counters.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Evaluation.Counters) - return object; - var message = new $root.google.cloud.documentai.v1.Evaluation.Counters(); - if (object.inputDocumentsCount != null) - message.inputDocumentsCount = object.inputDocumentsCount | 0; - if (object.invalidDocumentsCount != null) - message.invalidDocumentsCount = object.invalidDocumentsCount | 0; - if (object.failedDocumentsCount != null) - message.failedDocumentsCount = object.failedDocumentsCount | 0; - if (object.evaluatedDocumentsCount != null) - message.evaluatedDocumentsCount = object.evaluatedDocumentsCount | 0; - return message; - }; - - /** - * Creates a plain object from a Counters message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @static - * @param {google.cloud.documentai.v1.Evaluation.Counters} message Counters - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Counters.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inputDocumentsCount = 0; - object.invalidDocumentsCount = 0; - object.failedDocumentsCount = 0; - object.evaluatedDocumentsCount = 0; - } - if (message.inputDocumentsCount != null && message.hasOwnProperty("inputDocumentsCount")) - object.inputDocumentsCount = message.inputDocumentsCount; - if (message.invalidDocumentsCount != null && message.hasOwnProperty("invalidDocumentsCount")) - object.invalidDocumentsCount = message.invalidDocumentsCount; - if (message.failedDocumentsCount != null && message.hasOwnProperty("failedDocumentsCount")) - object.failedDocumentsCount = message.failedDocumentsCount; - if (message.evaluatedDocumentsCount != null && message.hasOwnProperty("evaluatedDocumentsCount")) - object.evaluatedDocumentsCount = message.evaluatedDocumentsCount; - return object; - }; - - /** - * Converts this Counters to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @instance - * @returns {Object.} JSON object - */ - Counters.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Counters - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Evaluation.Counters - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Counters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Evaluation.Counters"; - }; - - return Counters; - })(); - - Evaluation.Metrics = (function() { - - /** - * Properties of a Metrics. - * @memberof google.cloud.documentai.v1.Evaluation - * @interface IMetrics - * @property {number|null} [precision] Metrics precision - * @property {number|null} [recall] Metrics recall - * @property {number|null} [f1Score] Metrics f1Score - * @property {number|null} [predictedOccurrencesCount] Metrics predictedOccurrencesCount - * @property {number|null} [groundTruthOccurrencesCount] Metrics groundTruthOccurrencesCount - * @property {number|null} [predictedDocumentCount] Metrics predictedDocumentCount - * @property {number|null} [groundTruthDocumentCount] Metrics groundTruthDocumentCount - * @property {number|null} [truePositivesCount] Metrics truePositivesCount - * @property {number|null} [falsePositivesCount] Metrics falsePositivesCount - * @property {number|null} [falseNegativesCount] Metrics falseNegativesCount - * @property {number|null} [totalDocumentsCount] Metrics totalDocumentsCount - */ - - /** - * Constructs a new Metrics. - * @memberof google.cloud.documentai.v1.Evaluation - * @classdesc Represents a Metrics. - * @implements IMetrics - * @constructor - * @param {google.cloud.documentai.v1.Evaluation.IMetrics=} [properties] Properties to set - */ - function Metrics(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Metrics precision. - * @member {number} precision - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @instance - */ - Metrics.prototype.precision = 0; - - /** - * Metrics recall. - * @member {number} recall - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @instance - */ - Metrics.prototype.recall = 0; - - /** - * Metrics f1Score. - * @member {number} f1Score - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @instance - */ - Metrics.prototype.f1Score = 0; - - /** - * Metrics predictedOccurrencesCount. - * @member {number} predictedOccurrencesCount - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @instance - */ - Metrics.prototype.predictedOccurrencesCount = 0; - - /** - * Metrics groundTruthOccurrencesCount. - * @member {number} groundTruthOccurrencesCount - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @instance - */ - Metrics.prototype.groundTruthOccurrencesCount = 0; - - /** - * Metrics predictedDocumentCount. - * @member {number} predictedDocumentCount - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @instance - */ - Metrics.prototype.predictedDocumentCount = 0; - - /** - * Metrics groundTruthDocumentCount. - * @member {number} groundTruthDocumentCount - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @instance - */ - Metrics.prototype.groundTruthDocumentCount = 0; - - /** - * Metrics truePositivesCount. - * @member {number} truePositivesCount - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @instance - */ - Metrics.prototype.truePositivesCount = 0; - - /** - * Metrics falsePositivesCount. - * @member {number} falsePositivesCount - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @instance - */ - Metrics.prototype.falsePositivesCount = 0; - - /** - * Metrics falseNegativesCount. - * @member {number} falseNegativesCount - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @instance - */ - Metrics.prototype.falseNegativesCount = 0; - - /** - * Metrics totalDocumentsCount. - * @member {number} totalDocumentsCount - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @instance - */ - Metrics.prototype.totalDocumentsCount = 0; - - /** - * Creates a new Metrics instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @static - * @param {google.cloud.documentai.v1.Evaluation.IMetrics=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Evaluation.Metrics} Metrics instance - */ - Metrics.create = function create(properties) { - return new Metrics(properties); - }; - - /** - * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Metrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @static - * @param {google.cloud.documentai.v1.Evaluation.IMetrics} message Metrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.precision); - if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); - if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.f1Score); - if (message.predictedOccurrencesCount != null && Object.hasOwnProperty.call(message, "predictedOccurrencesCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.predictedOccurrencesCount); - if (message.groundTruthOccurrencesCount != null && Object.hasOwnProperty.call(message, "groundTruthOccurrencesCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.groundTruthOccurrencesCount); - if (message.truePositivesCount != null && Object.hasOwnProperty.call(message, "truePositivesCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.truePositivesCount); - if (message.falsePositivesCount != null && Object.hasOwnProperty.call(message, "falsePositivesCount")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.falsePositivesCount); - if (message.falseNegativesCount != null && Object.hasOwnProperty.call(message, "falseNegativesCount")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.falseNegativesCount); - if (message.totalDocumentsCount != null && Object.hasOwnProperty.call(message, "totalDocumentsCount")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.totalDocumentsCount); - if (message.predictedDocumentCount != null && Object.hasOwnProperty.call(message, "predictedDocumentCount")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.predictedDocumentCount); - if (message.groundTruthDocumentCount != null && Object.hasOwnProperty.call(message, "groundTruthDocumentCount")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.groundTruthDocumentCount); - return writer; - }; - - /** - * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.Metrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @static - * @param {google.cloud.documentai.v1.Evaluation.IMetrics} message Metrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Metrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @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.Evaluation.Metrics} Metrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metrics.decode = function decode(reader, 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.Evaluation.Metrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.precision = reader.float(); - break; - } - case 2: { - message.recall = reader.float(); - break; - } - case 3: { - message.f1Score = reader.float(); - break; - } - case 4: { - message.predictedOccurrencesCount = reader.int32(); - break; - } - case 5: { - message.groundTruthOccurrencesCount = reader.int32(); - break; - } - case 10: { - message.predictedDocumentCount = reader.int32(); - break; - } - case 11: { - message.groundTruthDocumentCount = reader.int32(); - break; - } - case 6: { - message.truePositivesCount = reader.int32(); - break; - } - case 7: { - message.falsePositivesCount = reader.int32(); - break; - } - case 8: { - message.falseNegativesCount = reader.int32(); - break; - } - case 9: { - message.totalDocumentsCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Metrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Evaluation.Metrics} Metrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Metrics message. - * @function verify - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.precision != null && message.hasOwnProperty("precision")) - if (typeof message.precision !== "number") - return "precision: number expected"; - if (message.recall != null && message.hasOwnProperty("recall")) - if (typeof message.recall !== "number") - return "recall: number expected"; - if (message.f1Score != null && message.hasOwnProperty("f1Score")) - if (typeof message.f1Score !== "number") - return "f1Score: number expected"; - if (message.predictedOccurrencesCount != null && message.hasOwnProperty("predictedOccurrencesCount")) - if (!$util.isInteger(message.predictedOccurrencesCount)) - return "predictedOccurrencesCount: integer expected"; - if (message.groundTruthOccurrencesCount != null && message.hasOwnProperty("groundTruthOccurrencesCount")) - if (!$util.isInteger(message.groundTruthOccurrencesCount)) - return "groundTruthOccurrencesCount: integer expected"; - if (message.predictedDocumentCount != null && message.hasOwnProperty("predictedDocumentCount")) - if (!$util.isInteger(message.predictedDocumentCount)) - return "predictedDocumentCount: integer expected"; - if (message.groundTruthDocumentCount != null && message.hasOwnProperty("groundTruthDocumentCount")) - if (!$util.isInteger(message.groundTruthDocumentCount)) - return "groundTruthDocumentCount: integer expected"; - if (message.truePositivesCount != null && message.hasOwnProperty("truePositivesCount")) - if (!$util.isInteger(message.truePositivesCount)) - return "truePositivesCount: integer expected"; - if (message.falsePositivesCount != null && message.hasOwnProperty("falsePositivesCount")) - if (!$util.isInteger(message.falsePositivesCount)) - return "falsePositivesCount: integer expected"; - if (message.falseNegativesCount != null && message.hasOwnProperty("falseNegativesCount")) - if (!$util.isInteger(message.falseNegativesCount)) - return "falseNegativesCount: integer expected"; - if (message.totalDocumentsCount != null && message.hasOwnProperty("totalDocumentsCount")) - if (!$util.isInteger(message.totalDocumentsCount)) - return "totalDocumentsCount: integer expected"; - return null; - }; - - /** - * Creates a Metrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Evaluation.Metrics} Metrics - */ - Metrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Evaluation.Metrics) - return object; - var message = new $root.google.cloud.documentai.v1.Evaluation.Metrics(); - if (object.precision != null) - message.precision = Number(object.precision); - if (object.recall != null) - message.recall = Number(object.recall); - if (object.f1Score != null) - message.f1Score = Number(object.f1Score); - if (object.predictedOccurrencesCount != null) - message.predictedOccurrencesCount = object.predictedOccurrencesCount | 0; - if (object.groundTruthOccurrencesCount != null) - message.groundTruthOccurrencesCount = object.groundTruthOccurrencesCount | 0; - if (object.predictedDocumentCount != null) - message.predictedDocumentCount = object.predictedDocumentCount | 0; - if (object.groundTruthDocumentCount != null) - message.groundTruthDocumentCount = object.groundTruthDocumentCount | 0; - if (object.truePositivesCount != null) - message.truePositivesCount = object.truePositivesCount | 0; - if (object.falsePositivesCount != null) - message.falsePositivesCount = object.falsePositivesCount | 0; - if (object.falseNegativesCount != null) - message.falseNegativesCount = object.falseNegativesCount | 0; - if (object.totalDocumentsCount != null) - message.totalDocumentsCount = object.totalDocumentsCount | 0; - return message; - }; - - /** - * Creates a plain object from a Metrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @static - * @param {google.cloud.documentai.v1.Evaluation.Metrics} message Metrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.precision = 0; - object.recall = 0; - object.f1Score = 0; - object.predictedOccurrencesCount = 0; - object.groundTruthOccurrencesCount = 0; - object.truePositivesCount = 0; - object.falsePositivesCount = 0; - object.falseNegativesCount = 0; - object.totalDocumentsCount = 0; - object.predictedDocumentCount = 0; - object.groundTruthDocumentCount = 0; - } - if (message.precision != null && message.hasOwnProperty("precision")) - object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; - if (message.recall != null && message.hasOwnProperty("recall")) - object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; - if (message.f1Score != null && message.hasOwnProperty("f1Score")) - object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; - if (message.predictedOccurrencesCount != null && message.hasOwnProperty("predictedOccurrencesCount")) - object.predictedOccurrencesCount = message.predictedOccurrencesCount; - if (message.groundTruthOccurrencesCount != null && message.hasOwnProperty("groundTruthOccurrencesCount")) - object.groundTruthOccurrencesCount = message.groundTruthOccurrencesCount; - if (message.truePositivesCount != null && message.hasOwnProperty("truePositivesCount")) - object.truePositivesCount = message.truePositivesCount; - if (message.falsePositivesCount != null && message.hasOwnProperty("falsePositivesCount")) - object.falsePositivesCount = message.falsePositivesCount; - if (message.falseNegativesCount != null && message.hasOwnProperty("falseNegativesCount")) - object.falseNegativesCount = message.falseNegativesCount; - if (message.totalDocumentsCount != null && message.hasOwnProperty("totalDocumentsCount")) - object.totalDocumentsCount = message.totalDocumentsCount; - if (message.predictedDocumentCount != null && message.hasOwnProperty("predictedDocumentCount")) - object.predictedDocumentCount = message.predictedDocumentCount; - if (message.groundTruthDocumentCount != null && message.hasOwnProperty("groundTruthDocumentCount")) - object.groundTruthDocumentCount = message.groundTruthDocumentCount; - return object; - }; - - /** - * Converts this Metrics to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @instance - * @returns {Object.} JSON object - */ - Metrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Metrics - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Evaluation.Metrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Metrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Evaluation.Metrics"; - }; - - return Metrics; - })(); - - Evaluation.ConfidenceLevelMetrics = (function() { - - /** - * Properties of a ConfidenceLevelMetrics. - * @memberof google.cloud.documentai.v1.Evaluation - * @interface IConfidenceLevelMetrics - * @property {number|null} [confidenceLevel] ConfidenceLevelMetrics confidenceLevel - * @property {google.cloud.documentai.v1.Evaluation.IMetrics|null} [metrics] ConfidenceLevelMetrics metrics - */ - - /** - * Constructs a new ConfidenceLevelMetrics. - * @memberof google.cloud.documentai.v1.Evaluation - * @classdesc Represents a ConfidenceLevelMetrics. - * @implements IConfidenceLevelMetrics - * @constructor - * @param {google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics=} [properties] Properties to set - */ - function ConfidenceLevelMetrics(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConfidenceLevelMetrics confidenceLevel. - * @member {number} confidenceLevel - * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - * @instance - */ - ConfidenceLevelMetrics.prototype.confidenceLevel = 0; - - /** - * ConfidenceLevelMetrics metrics. - * @member {google.cloud.documentai.v1.Evaluation.IMetrics|null|undefined} metrics - * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - * @instance - */ - ConfidenceLevelMetrics.prototype.metrics = null; - - /** - * Creates a new ConfidenceLevelMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - * @static - * @param {google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics instance - */ - ConfidenceLevelMetrics.create = function create(properties) { - return new ConfidenceLevelMetrics(properties); - }; - - /** - * Encodes the specified ConfidenceLevelMetrics message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - * @static - * @param {google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics} message ConfidenceLevelMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConfidenceLevelMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.confidenceLevel != null && Object.hasOwnProperty.call(message, "confidenceLevel")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceLevel); - if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) - $root.google.cloud.documentai.v1.Evaluation.Metrics.encode(message.metrics, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConfidenceLevelMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - * @static - * @param {google.cloud.documentai.v1.Evaluation.IConfidenceLevelMetrics} message ConfidenceLevelMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConfidenceLevelMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - * @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.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConfidenceLevelMetrics.decode = function decode(reader, 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.Evaluation.ConfidenceLevelMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.confidenceLevel = reader.float(); - break; - } - case 2: { - message.metrics = $root.google.cloud.documentai.v1.Evaluation.Metrics.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConfidenceLevelMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConfidenceLevelMetrics message. - * @function verify - * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConfidenceLevelMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.confidenceLevel != null && message.hasOwnProperty("confidenceLevel")) - if (typeof message.confidenceLevel !== "number") - return "confidenceLevel: number expected"; - if (message.metrics != null && message.hasOwnProperty("metrics")) { - var error = $root.google.cloud.documentai.v1.Evaluation.Metrics.verify(message.metrics); - if (error) - return "metrics." + error; - } - return null; - }; - - /** - * Creates a ConfidenceLevelMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics - */ - ConfidenceLevelMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics) - return object; - var message = new $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics(); - if (object.confidenceLevel != null) - message.confidenceLevel = Number(object.confidenceLevel); - if (object.metrics != null) { - if (typeof object.metrics !== "object") - throw TypeError(".google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.metrics: object expected"); - message.metrics = $root.google.cloud.documentai.v1.Evaluation.Metrics.fromObject(object.metrics); - } - return message; - }; - - /** - * Creates a plain object from a ConfidenceLevelMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - * @static - * @param {google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics} message ConfidenceLevelMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConfidenceLevelMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.confidenceLevel = 0; - object.metrics = null; - } - if (message.confidenceLevel != null && message.hasOwnProperty("confidenceLevel")) - object.confidenceLevel = options.json && !isFinite(message.confidenceLevel) ? String(message.confidenceLevel) : message.confidenceLevel; - if (message.metrics != null && message.hasOwnProperty("metrics")) - object.metrics = $root.google.cloud.documentai.v1.Evaluation.Metrics.toObject(message.metrics, options); - return object; - }; - - /** - * Converts this ConfidenceLevelMetrics to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - * @instance - * @returns {Object.} JSON object - */ - ConfidenceLevelMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConfidenceLevelMetrics - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConfidenceLevelMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics"; - }; - - return ConfidenceLevelMetrics; - })(); - - Evaluation.MultiConfidenceMetrics = (function() { - - /** - * Properties of a MultiConfidenceMetrics. - * @memberof google.cloud.documentai.v1.Evaluation - * @interface IMultiConfidenceMetrics - * @property {Array.|null} [confidenceLevelMetrics] MultiConfidenceMetrics confidenceLevelMetrics - * @property {Array.|null} [confidenceLevelMetricsExact] MultiConfidenceMetrics confidenceLevelMetricsExact - * @property {number|null} [auprc] MultiConfidenceMetrics auprc - * @property {number|null} [estimatedCalibrationError] MultiConfidenceMetrics estimatedCalibrationError - * @property {number|null} [auprcExact] MultiConfidenceMetrics auprcExact - * @property {number|null} [estimatedCalibrationErrorExact] MultiConfidenceMetrics estimatedCalibrationErrorExact - * @property {google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType|null} [metricsType] MultiConfidenceMetrics metricsType - */ - - /** - * Constructs a new MultiConfidenceMetrics. - * @memberof google.cloud.documentai.v1.Evaluation - * @classdesc Represents a MultiConfidenceMetrics. - * @implements IMultiConfidenceMetrics - * @constructor - * @param {google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics=} [properties] Properties to set - */ - function MultiConfidenceMetrics(properties) { - this.confidenceLevelMetrics = []; - this.confidenceLevelMetricsExact = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MultiConfidenceMetrics confidenceLevelMetrics. - * @member {Array.} confidenceLevelMetrics - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.confidenceLevelMetrics = $util.emptyArray; - - /** - * MultiConfidenceMetrics confidenceLevelMetricsExact. - * @member {Array.} confidenceLevelMetricsExact - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.confidenceLevelMetricsExact = $util.emptyArray; - - /** - * MultiConfidenceMetrics auprc. - * @member {number} auprc - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.auprc = 0; - - /** - * MultiConfidenceMetrics estimatedCalibrationError. - * @member {number} estimatedCalibrationError - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.estimatedCalibrationError = 0; - - /** - * MultiConfidenceMetrics auprcExact. - * @member {number} auprcExact - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.auprcExact = 0; - - /** - * MultiConfidenceMetrics estimatedCalibrationErrorExact. - * @member {number} estimatedCalibrationErrorExact - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.estimatedCalibrationErrorExact = 0; - - /** - * MultiConfidenceMetrics metricsType. - * @member {google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType} metricsType - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.metricsType = 0; - - /** - * Creates a new MultiConfidenceMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @static - * @param {google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics instance - */ - MultiConfidenceMetrics.create = function create(properties) { - return new MultiConfidenceMetrics(properties); - }; - - /** - * Encodes the specified MultiConfidenceMetrics message. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @static - * @param {google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics} message MultiConfidenceMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiConfidenceMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.confidenceLevelMetrics != null && message.confidenceLevelMetrics.length) - for (var i = 0; i < message.confidenceLevelMetrics.length; ++i) - $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.encode(message.confidenceLevelMetrics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.auprc != null && Object.hasOwnProperty.call(message, "auprc")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.auprc); - if (message.estimatedCalibrationError != null && Object.hasOwnProperty.call(message, "estimatedCalibrationError")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.estimatedCalibrationError); - if (message.confidenceLevelMetricsExact != null && message.confidenceLevelMetricsExact.length) - for (var i = 0; i < message.confidenceLevelMetricsExact.length; ++i) - $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.encode(message.confidenceLevelMetricsExact[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.auprcExact != null && Object.hasOwnProperty.call(message, "auprcExact")) - writer.uint32(/* id 5, wireType 5 =*/45).float(message.auprcExact); - if (message.estimatedCalibrationErrorExact != null && Object.hasOwnProperty.call(message, "estimatedCalibrationErrorExact")) - writer.uint32(/* id 6, wireType 5 =*/53).float(message.estimatedCalibrationErrorExact); - if (message.metricsType != null && Object.hasOwnProperty.call(message, "metricsType")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.metricsType); - return writer; - }; - - /** - * Encodes the specified MultiConfidenceMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @static - * @param {google.cloud.documentai.v1.Evaluation.IMultiConfidenceMetrics} message MultiConfidenceMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiConfidenceMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MultiConfidenceMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @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.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiConfidenceMetrics.decode = function decode(reader, 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.Evaluation.MultiConfidenceMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.confidenceLevelMetrics && message.confidenceLevelMetrics.length)) - message.confidenceLevelMetrics = []; - message.confidenceLevelMetrics.push($root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.confidenceLevelMetricsExact && message.confidenceLevelMetricsExact.length)) - message.confidenceLevelMetricsExact = []; - message.confidenceLevelMetricsExact.push($root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.decode(reader, reader.uint32())); - break; - } - case 2: { - message.auprc = reader.float(); - break; - } - case 3: { - message.estimatedCalibrationError = reader.float(); - break; - } - case 5: { - message.auprcExact = reader.float(); - break; - } - case 6: { - message.estimatedCalibrationErrorExact = reader.float(); - break; - } - case 7: { - message.metricsType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MultiConfidenceMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiConfidenceMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MultiConfidenceMetrics message. - * @function verify - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MultiConfidenceMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.confidenceLevelMetrics != null && message.hasOwnProperty("confidenceLevelMetrics")) { - if (!Array.isArray(message.confidenceLevelMetrics)) - return "confidenceLevelMetrics: array expected"; - for (var i = 0; i < message.confidenceLevelMetrics.length; ++i) { - var error = $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.verify(message.confidenceLevelMetrics[i]); - if (error) - return "confidenceLevelMetrics." + error; - } - } - if (message.confidenceLevelMetricsExact != null && message.hasOwnProperty("confidenceLevelMetricsExact")) { - if (!Array.isArray(message.confidenceLevelMetricsExact)) - return "confidenceLevelMetricsExact: array expected"; - for (var i = 0; i < message.confidenceLevelMetricsExact.length; ++i) { - var error = $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.verify(message.confidenceLevelMetricsExact[i]); - if (error) - return "confidenceLevelMetricsExact." + error; - } - } - if (message.auprc != null && message.hasOwnProperty("auprc")) - if (typeof message.auprc !== "number") - return "auprc: number expected"; - if (message.estimatedCalibrationError != null && message.hasOwnProperty("estimatedCalibrationError")) - if (typeof message.estimatedCalibrationError !== "number") - return "estimatedCalibrationError: number expected"; - if (message.auprcExact != null && message.hasOwnProperty("auprcExact")) - if (typeof message.auprcExact !== "number") - return "auprcExact: number expected"; - if (message.estimatedCalibrationErrorExact != null && message.hasOwnProperty("estimatedCalibrationErrorExact")) - if (typeof message.estimatedCalibrationErrorExact !== "number") - return "estimatedCalibrationErrorExact: number expected"; - if (message.metricsType != null && message.hasOwnProperty("metricsType")) - switch (message.metricsType) { - default: - return "metricsType: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a MultiConfidenceMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics - */ - MultiConfidenceMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics) - return object; - var message = new $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics(); - if (object.confidenceLevelMetrics) { - if (!Array.isArray(object.confidenceLevelMetrics)) - throw TypeError(".google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.confidenceLevelMetrics: array expected"); - message.confidenceLevelMetrics = []; - for (var i = 0; i < object.confidenceLevelMetrics.length; ++i) { - if (typeof object.confidenceLevelMetrics[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.confidenceLevelMetrics: object expected"); - message.confidenceLevelMetrics[i] = $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.fromObject(object.confidenceLevelMetrics[i]); - } - } - if (object.confidenceLevelMetricsExact) { - if (!Array.isArray(object.confidenceLevelMetricsExact)) - throw TypeError(".google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.confidenceLevelMetricsExact: array expected"); - message.confidenceLevelMetricsExact = []; - for (var i = 0; i < object.confidenceLevelMetricsExact.length; ++i) { - if (typeof object.confidenceLevelMetricsExact[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.confidenceLevelMetricsExact: object expected"); - message.confidenceLevelMetricsExact[i] = $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.fromObject(object.confidenceLevelMetricsExact[i]); - } - } - if (object.auprc != null) - message.auprc = Number(object.auprc); - if (object.estimatedCalibrationError != null) - message.estimatedCalibrationError = Number(object.estimatedCalibrationError); - if (object.auprcExact != null) - message.auprcExact = Number(object.auprcExact); - if (object.estimatedCalibrationErrorExact != null) - message.estimatedCalibrationErrorExact = Number(object.estimatedCalibrationErrorExact); - switch (object.metricsType) { - default: - if (typeof object.metricsType === "number") { - message.metricsType = object.metricsType; - break; - } - break; - case "METRICS_TYPE_UNSPECIFIED": - case 0: - message.metricsType = 0; - break; - case "AGGREGATE": - case 1: - message.metricsType = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a MultiConfidenceMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @static - * @param {google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics} message MultiConfidenceMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MultiConfidenceMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.confidenceLevelMetrics = []; - object.confidenceLevelMetricsExact = []; - } - if (options.defaults) { - object.auprc = 0; - object.estimatedCalibrationError = 0; - object.auprcExact = 0; - object.estimatedCalibrationErrorExact = 0; - object.metricsType = options.enums === String ? "METRICS_TYPE_UNSPECIFIED" : 0; - } - if (message.confidenceLevelMetrics && message.confidenceLevelMetrics.length) { - object.confidenceLevelMetrics = []; - for (var j = 0; j < message.confidenceLevelMetrics.length; ++j) - object.confidenceLevelMetrics[j] = $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.toObject(message.confidenceLevelMetrics[j], options); - } - if (message.auprc != null && message.hasOwnProperty("auprc")) - object.auprc = options.json && !isFinite(message.auprc) ? String(message.auprc) : message.auprc; - if (message.estimatedCalibrationError != null && message.hasOwnProperty("estimatedCalibrationError")) - object.estimatedCalibrationError = options.json && !isFinite(message.estimatedCalibrationError) ? String(message.estimatedCalibrationError) : message.estimatedCalibrationError; - if (message.confidenceLevelMetricsExact && message.confidenceLevelMetricsExact.length) { - object.confidenceLevelMetricsExact = []; - for (var j = 0; j < message.confidenceLevelMetricsExact.length; ++j) - object.confidenceLevelMetricsExact[j] = $root.google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics.toObject(message.confidenceLevelMetricsExact[j], options); - } - if (message.auprcExact != null && message.hasOwnProperty("auprcExact")) - object.auprcExact = options.json && !isFinite(message.auprcExact) ? String(message.auprcExact) : message.auprcExact; - if (message.estimatedCalibrationErrorExact != null && message.hasOwnProperty("estimatedCalibrationErrorExact")) - object.estimatedCalibrationErrorExact = options.json && !isFinite(message.estimatedCalibrationErrorExact) ? String(message.estimatedCalibrationErrorExact) : message.estimatedCalibrationErrorExact; - if (message.metricsType != null && message.hasOwnProperty("metricsType")) - object.metricsType = options.enums === String ? $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType[message.metricsType] === undefined ? message.metricsType : $root.google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType[message.metricsType] : message.metricsType; - return object; - }; - - /** - * Converts this MultiConfidenceMetrics to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @instance - * @returns {Object.} JSON object - */ - MultiConfidenceMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MultiConfidenceMetrics - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MultiConfidenceMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics"; - }; - - /** - * MetricsType enum. - * @name google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType - * @enum {number} - * @property {number} METRICS_TYPE_UNSPECIFIED=0 METRICS_TYPE_UNSPECIFIED value - * @property {number} AGGREGATE=1 AGGREGATE value - */ - MultiConfidenceMetrics.MetricsType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "METRICS_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "AGGREGATE"] = 1; - return values; - })(); - - return MultiConfidenceMetrics; - })(); - - return Evaluation; - })(); - - v1.CommonOperationMetadata = (function() { - - /** - * Properties of a CommonOperationMetadata. - * @memberof google.cloud.documentai.v1 - * @interface ICommonOperationMetadata - * @property {google.cloud.documentai.v1.CommonOperationMetadata.State|null} [state] CommonOperationMetadata state - * @property {string|null} [stateMessage] CommonOperationMetadata stateMessage - * @property {string|null} [resource] CommonOperationMetadata resource - * @property {google.protobuf.ITimestamp|null} [createTime] CommonOperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] CommonOperationMetadata updateTime - */ - - /** - * Constructs a new CommonOperationMetadata. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a CommonOperationMetadata. - * @implements ICommonOperationMetadata - * @constructor - * @param {google.cloud.documentai.v1.ICommonOperationMetadata=} [properties] Properties to set - */ - function CommonOperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonOperationMetadata state. - * @member {google.cloud.documentai.v1.CommonOperationMetadata.State} state - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @instance - */ - CommonOperationMetadata.prototype.state = 0; - - /** - * CommonOperationMetadata stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @instance - */ - CommonOperationMetadata.prototype.stateMessage = ""; - - /** - * CommonOperationMetadata resource. - * @member {string} resource - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @instance - */ - CommonOperationMetadata.prototype.resource = ""; - - /** - * CommonOperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @instance - */ - CommonOperationMetadata.prototype.createTime = null; - - /** - * CommonOperationMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @instance - */ - CommonOperationMetadata.prototype.updateTime = null; - - /** - * Creates a new CommonOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @static - * @param {google.cloud.documentai.v1.ICommonOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.CommonOperationMetadata} CommonOperationMetadata instance - */ - CommonOperationMetadata.create = function create(properties) { - return new CommonOperationMetadata(properties); - }; - - /** - * Encodes the specified CommonOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1.CommonOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @static - * @param {google.cloud.documentai.v1.ICommonOperationMetadata} message CommonOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); - 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.resource); - return writer; - }; - - /** - * Encodes the specified CommonOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.CommonOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @static - * @param {google.cloud.documentai.v1.ICommonOperationMetadata} message CommonOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @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.CommonOperationMetadata} CommonOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonOperationMetadata.decode = function decode(reader, 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.CommonOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.stateMessage = reader.string(); - break; - } - case 5: { - message.resource = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.CommonOperationMetadata} CommonOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonOperationMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - return null; - }; - - /** - * Creates a CommonOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.CommonOperationMetadata} CommonOperationMetadata - */ - CommonOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.CommonOperationMetadata) - return object; - var message = new $root.google.cloud.documentai.v1.CommonOperationMetadata(); - 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 "RUNNING": - case 1: - message.state = 1; - break; - case "CANCELLING": - case 2: - message.state = 2; - break; - case "SUCCEEDED": - case 3: - message.state = 3; - break; - case "FAILED": - case 4: - message.state = 4; - break; - case "CANCELLED": - case 5: - message.state = 5; - break; - } - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.resource != null) - message.resource = String(object.resource); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1.CommonOperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.documentai.v1.CommonOperationMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - return message; - }; - - /** - * Creates a plain object from a CommonOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @static - * @param {google.cloud.documentai.v1.CommonOperationMetadata} message CommonOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; - object.createTime = null; - object.updateTime = null; - object.resource = ""; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1.CommonOperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.CommonOperationMetadata.State[message.state] : message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - return object; - }; - - /** - * Converts this CommonOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - CommonOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.CommonOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.CommonOperationMetadata"; - }; - - /** - * State enum. - * @name google.cloud.documentai.v1.CommonOperationMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} CANCELLING=2 CANCELLING value - * @property {number} SUCCEEDED=3 SUCCEEDED value - * @property {number} FAILED=4 FAILED value - * @property {number} CANCELLED=5 CANCELLED value - */ - CommonOperationMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "CANCELLING"] = 2; - values[valuesById[3] = "SUCCEEDED"] = 3; - values[valuesById[4] = "FAILED"] = 4; - values[valuesById[5] = "CANCELLED"] = 5; - return values; - })(); - - return CommonOperationMetadata; - })(); - - v1.ProcessorVersion = (function() { - - /** - * Properties of a ProcessorVersion. - * @memberof google.cloud.documentai.v1 - * @interface IProcessorVersion - * @property {string|null} [name] ProcessorVersion name - * @property {string|null} [displayName] ProcessorVersion displayName - * @property {google.cloud.documentai.v1.IDocumentSchema|null} [documentSchema] ProcessorVersion documentSchema - * @property {google.cloud.documentai.v1.ProcessorVersion.State|null} [state] ProcessorVersion state - * @property {google.protobuf.ITimestamp|null} [createTime] ProcessorVersion createTime - * @property {google.cloud.documentai.v1.IEvaluationReference|null} [latestEvaluation] ProcessorVersion latestEvaluation - * @property {string|null} [kmsKeyName] ProcessorVersion kmsKeyName - * @property {string|null} [kmsKeyVersionName] ProcessorVersion kmsKeyVersionName - * @property {boolean|null} [googleManaged] ProcessorVersion googleManaged - * @property {google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo|null} [deprecationInfo] ProcessorVersion deprecationInfo - * @property {google.cloud.documentai.v1.ProcessorVersion.ModelType|null} [modelType] ProcessorVersion modelType - * @property {boolean|null} [satisfiesPzs] ProcessorVersion satisfiesPzs - * @property {boolean|null} [satisfiesPzi] ProcessorVersion satisfiesPzi - * @property {google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo|null} [genAiModelInfo] ProcessorVersion genAiModelInfo - */ - - /** - * Constructs a new ProcessorVersion. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ProcessorVersion. - * @implements IProcessorVersion - * @constructor - * @param {google.cloud.documentai.v1.IProcessorVersion=} [properties] Properties to set - */ - function ProcessorVersion(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProcessorVersion name. - * @member {string} name - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.name = ""; - - /** - * ProcessorVersion displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.displayName = ""; - - /** - * ProcessorVersion documentSchema. - * @member {google.cloud.documentai.v1.IDocumentSchema|null|undefined} documentSchema - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.documentSchema = null; - - /** - * ProcessorVersion state. - * @member {google.cloud.documentai.v1.ProcessorVersion.State} state - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.state = 0; - - /** - * ProcessorVersion createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.createTime = null; - - /** - * ProcessorVersion latestEvaluation. - * @member {google.cloud.documentai.v1.IEvaluationReference|null|undefined} latestEvaluation - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.latestEvaluation = null; - - /** - * ProcessorVersion kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.kmsKeyName = ""; - - /** - * ProcessorVersion kmsKeyVersionName. - * @member {string} kmsKeyVersionName - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.kmsKeyVersionName = ""; - - /** - * ProcessorVersion googleManaged. - * @member {boolean} googleManaged - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.googleManaged = false; - - /** - * ProcessorVersion deprecationInfo. - * @member {google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo|null|undefined} deprecationInfo - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.deprecationInfo = null; - - /** - * ProcessorVersion modelType. - * @member {google.cloud.documentai.v1.ProcessorVersion.ModelType} modelType - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.modelType = 0; - - /** - * ProcessorVersion satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.satisfiesPzs = false; - - /** - * ProcessorVersion satisfiesPzi. - * @member {boolean} satisfiesPzi - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.satisfiesPzi = false; - - /** - * ProcessorVersion genAiModelInfo. - * @member {google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo|null|undefined} genAiModelInfo - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.genAiModelInfo = null; - - /** - * Creates a new ProcessorVersion instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @static - * @param {google.cloud.documentai.v1.IProcessorVersion=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessorVersion} ProcessorVersion instance - */ - ProcessorVersion.create = function create(properties) { - return new ProcessorVersion(properties); - }; - - /** - * Encodes the specified ProcessorVersion message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @static - * @param {google.cloud.documentai.v1.IProcessorVersion} message ProcessorVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorVersion.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.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.latestEvaluation != null && Object.hasOwnProperty.call(message, "latestEvaluation")) - $root.google.cloud.documentai.v1.EvaluationReference.encode(message.latestEvaluation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.kmsKeyName); - if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.kmsKeyVersionName); - if (message.googleManaged != null && Object.hasOwnProperty.call(message, "googleManaged")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.googleManaged); - if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) - $root.google.cloud.documentai.v1.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.deprecationInfo != null && Object.hasOwnProperty.call(message, "deprecationInfo")) - $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.encode(message.deprecationInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.modelType); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.satisfiesPzs); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.satisfiesPzi); - if (message.genAiModelInfo != null && Object.hasOwnProperty.call(message, "genAiModelInfo")) - $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.encode(message.genAiModelInfo, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ProcessorVersion message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @static - * @param {google.cloud.documentai.v1.IProcessorVersion} message ProcessorVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorVersion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessorVersion message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @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.ProcessorVersion} ProcessorVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorVersion.decode = function decode(reader, 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.ProcessorVersion(); - 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 12: { - message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.decode(reader, reader.uint32()); - break; - } - case 6: { - message.state = reader.int32(); - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.latestEvaluation = $root.google.cloud.documentai.v1.EvaluationReference.decode(reader, reader.uint32()); - break; - } - case 9: { - message.kmsKeyName = reader.string(); - break; - } - case 10: { - message.kmsKeyVersionName = reader.string(); - break; - } - case 11: { - message.googleManaged = reader.bool(); - break; - } - case 13: { - message.deprecationInfo = $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.decode(reader, reader.uint32()); - break; - } - case 15: { - message.modelType = reader.int32(); - break; - } - case 16: { - message.satisfiesPzs = reader.bool(); - break; - } - case 17: { - message.satisfiesPzi = reader.bool(); - break; - } - case 18: { - message.genAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessorVersion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessorVersion} ProcessorVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorVersion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessorVersion message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessorVersion.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.documentSchema != null && message.hasOwnProperty("documentSchema")) { - var error = $root.google.cloud.documentai.v1.DocumentSchema.verify(message.documentSchema); - if (error) - return "documentSchema." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.latestEvaluation != null && message.hasOwnProperty("latestEvaluation")) { - var error = $root.google.cloud.documentai.v1.EvaluationReference.verify(message.latestEvaluation); - if (error) - return "latestEvaluation." + error; - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) - if (!$util.isString(message.kmsKeyVersionName)) - return "kmsKeyVersionName: string expected"; - if (message.googleManaged != null && message.hasOwnProperty("googleManaged")) - if (typeof message.googleManaged !== "boolean") - return "googleManaged: boolean expected"; - if (message.deprecationInfo != null && message.hasOwnProperty("deprecationInfo")) { - var error = $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.verify(message.deprecationInfo); - if (error) - return "deprecationInfo." + error; - } - if (message.modelType != null && message.hasOwnProperty("modelType")) - switch (message.modelType) { - default: - return "modelType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; - if (message.genAiModelInfo != null && message.hasOwnProperty("genAiModelInfo")) { - var error = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.verify(message.genAiModelInfo); - if (error) - return "genAiModelInfo." + error; - } - return null; - }; - - /** - * Creates a ProcessorVersion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessorVersion} ProcessorVersion - */ - ProcessorVersion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersion) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessorVersion(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.documentSchema != null) { - if (typeof object.documentSchema !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.documentSchema: object expected"); - message.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.fromObject(object.documentSchema); - } - 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 "DEPLOYED": - case 1: - message.state = 1; - break; - case "DEPLOYING": - case 2: - message.state = 2; - break; - case "UNDEPLOYED": - case 3: - message.state = 3; - break; - case "UNDEPLOYING": - case 4: - message.state = 4; - break; - case "CREATING": - case 5: - message.state = 5; - break; - case "DELETING": - case 6: - message.state = 6; - break; - case "FAILED": - case 7: - message.state = 7; - break; - case "IMPORTING": - case 8: - message.state = 8; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.latestEvaluation != null) { - if (typeof object.latestEvaluation !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.latestEvaluation: object expected"); - message.latestEvaluation = $root.google.cloud.documentai.v1.EvaluationReference.fromObject(object.latestEvaluation); - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyVersionName != null) - message.kmsKeyVersionName = String(object.kmsKeyVersionName); - if (object.googleManaged != null) - message.googleManaged = Boolean(object.googleManaged); - if (object.deprecationInfo != null) { - if (typeof object.deprecationInfo !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.deprecationInfo: object expected"); - message.deprecationInfo = $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.fromObject(object.deprecationInfo); - } - switch (object.modelType) { - default: - if (typeof object.modelType === "number") { - message.modelType = object.modelType; - break; - } - break; - case "MODEL_TYPE_UNSPECIFIED": - case 0: - message.modelType = 0; - break; - case "MODEL_TYPE_GENERATIVE": - case 1: - message.modelType = 1; - break; - case "MODEL_TYPE_CUSTOM": - case 2: - message.modelType = 2; - break; - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); - if (object.genAiModelInfo != null) { - if (typeof object.genAiModelInfo !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.genAiModelInfo: object expected"); - message.genAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.fromObject(object.genAiModelInfo); - } - return message; - }; - - /** - * Creates a plain object from a ProcessorVersion message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion} message ProcessorVersion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessorVersion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.latestEvaluation = null; - object.kmsKeyName = ""; - object.kmsKeyVersionName = ""; - object.googleManaged = false; - object.documentSchema = null; - object.deprecationInfo = null; - object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; - object.satisfiesPzs = false; - object.satisfiesPzi = false; - object.genAiModelInfo = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1.ProcessorVersion.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.ProcessorVersion.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.latestEvaluation != null && message.hasOwnProperty("latestEvaluation")) - object.latestEvaluation = $root.google.cloud.documentai.v1.EvaluationReference.toObject(message.latestEvaluation, options); - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) - object.kmsKeyVersionName = message.kmsKeyVersionName; - if (message.googleManaged != null && message.hasOwnProperty("googleManaged")) - object.googleManaged = message.googleManaged; - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) - object.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.toObject(message.documentSchema, options); - if (message.deprecationInfo != null && message.hasOwnProperty("deprecationInfo")) - object.deprecationInfo = $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.toObject(message.deprecationInfo, options); - if (message.modelType != null && message.hasOwnProperty("modelType")) - object.modelType = options.enums === String ? $root.google.cloud.documentai.v1.ProcessorVersion.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.documentai.v1.ProcessorVersion.ModelType[message.modelType] : message.modelType; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; - if (message.genAiModelInfo != null && message.hasOwnProperty("genAiModelInfo")) - object.genAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.toObject(message.genAiModelInfo, options); - return object; - }; - - /** - * Converts this ProcessorVersion to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @instance - * @returns {Object.} JSON object - */ - ProcessorVersion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessorVersion - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessorVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersion"; - }; - - ProcessorVersion.DeprecationInfo = (function() { - - /** - * Properties of a DeprecationInfo. - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @interface IDeprecationInfo - * @property {google.protobuf.ITimestamp|null} [deprecationTime] DeprecationInfo deprecationTime - * @property {string|null} [replacementProcessorVersion] DeprecationInfo replacementProcessorVersion - */ - - /** - * Constructs a new DeprecationInfo. - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @classdesc Represents a DeprecationInfo. - * @implements IDeprecationInfo - * @constructor - * @param {google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo=} [properties] Properties to set - */ - function DeprecationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeprecationInfo deprecationTime. - * @member {google.protobuf.ITimestamp|null|undefined} deprecationTime - * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - * @instance - */ - DeprecationInfo.prototype.deprecationTime = null; - - /** - * DeprecationInfo replacementProcessorVersion. - * @member {string} replacementProcessorVersion - * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - * @instance - */ - DeprecationInfo.prototype.replacementProcessorVersion = ""; - - /** - * Creates a new DeprecationInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo} DeprecationInfo instance - */ - DeprecationInfo.create = function create(properties) { - return new DeprecationInfo(properties); - }; - - /** - * Encodes the specified DeprecationInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo} message DeprecationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeprecationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecationTime != null && Object.hasOwnProperty.call(message, "deprecationTime")) - $root.google.protobuf.Timestamp.encode(message.deprecationTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.replacementProcessorVersion != null && Object.hasOwnProperty.call(message, "replacementProcessorVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.replacementProcessorVersion); - return writer; - }; - - /** - * Encodes the specified DeprecationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.IDeprecationInfo} message DeprecationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeprecationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeprecationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - * @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.ProcessorVersion.DeprecationInfo} DeprecationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeprecationInfo.decode = function decode(reader, 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.ProcessorVersion.DeprecationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.replacementProcessorVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeprecationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo} DeprecationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeprecationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeprecationInfo message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeprecationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecationTime != null && message.hasOwnProperty("deprecationTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deprecationTime); - if (error) - return "deprecationTime." + error; - } - if (message.replacementProcessorVersion != null && message.hasOwnProperty("replacementProcessorVersion")) - if (!$util.isString(message.replacementProcessorVersion)) - return "replacementProcessorVersion: string expected"; - return null; - }; - - /** - * Creates a DeprecationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo} DeprecationInfo - */ - DeprecationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo(); - if (object.deprecationTime != null) { - if (typeof object.deprecationTime !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo.deprecationTime: object expected"); - message.deprecationTime = $root.google.protobuf.Timestamp.fromObject(object.deprecationTime); - } - if (object.replacementProcessorVersion != null) - message.replacementProcessorVersion = String(object.replacementProcessorVersion); - return message; - }; - - /** - * Creates a plain object from a DeprecationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo} message DeprecationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeprecationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.deprecationTime = null; - object.replacementProcessorVersion = ""; - } - if (message.deprecationTime != null && message.hasOwnProperty("deprecationTime")) - object.deprecationTime = $root.google.protobuf.Timestamp.toObject(message.deprecationTime, options); - if (message.replacementProcessorVersion != null && message.hasOwnProperty("replacementProcessorVersion")) - object.replacementProcessorVersion = message.replacementProcessorVersion; - return object; - }; - - /** - * Converts this DeprecationInfo to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - * @instance - * @returns {Object.} JSON object - */ - DeprecationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeprecationInfo - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeprecationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersion.DeprecationInfo"; - }; - - return DeprecationInfo; - })(); - - ProcessorVersion.GenAiModelInfo = (function() { - - /** - * Properties of a GenAiModelInfo. - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @interface IGenAiModelInfo - * @property {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null} [foundationGenAiModelInfo] GenAiModelInfo foundationGenAiModelInfo - * @property {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null} [customGenAiModelInfo] GenAiModelInfo customGenAiModelInfo - */ - - /** - * Constructs a new GenAiModelInfo. - * @memberof google.cloud.documentai.v1.ProcessorVersion - * @classdesc Represents a GenAiModelInfo. - * @implements IGenAiModelInfo - * @constructor - * @param {google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo=} [properties] Properties to set - */ - function GenAiModelInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenAiModelInfo foundationGenAiModelInfo. - * @member {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null|undefined} foundationGenAiModelInfo - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @instance - */ - GenAiModelInfo.prototype.foundationGenAiModelInfo = null; - - /** - * GenAiModelInfo customGenAiModelInfo. - * @member {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null|undefined} customGenAiModelInfo - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @instance - */ - GenAiModelInfo.prototype.customGenAiModelInfo = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GenAiModelInfo modelInfo. - * @member {"foundationGenAiModelInfo"|"customGenAiModelInfo"|undefined} modelInfo - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @instance - */ - Object.defineProperty(GenAiModelInfo.prototype, "modelInfo", { - get: $util.oneOfGetter($oneOfFields = ["foundationGenAiModelInfo", "customGenAiModelInfo"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GenAiModelInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo} GenAiModelInfo instance - */ - GenAiModelInfo.create = function create(properties) { - return new GenAiModelInfo(properties); - }; - - /** - * Encodes the specified GenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo} message GenAiModelInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenAiModelInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.foundationGenAiModelInfo != null && Object.hasOwnProperty.call(message, "foundationGenAiModelInfo")) - $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.encode(message.foundationGenAiModelInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.customGenAiModelInfo != null && Object.hasOwnProperty.call(message, "customGenAiModelInfo")) - $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.encode(message.customGenAiModelInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.IGenAiModelInfo} message GenAiModelInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenAiModelInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenAiModelInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @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.ProcessorVersion.GenAiModelInfo} GenAiModelInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenAiModelInfo.decode = function decode(reader, 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.ProcessorVersion.GenAiModelInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.foundationGenAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.decode(reader, reader.uint32()); - break; - } - case 2: { - message.customGenAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenAiModelInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo} GenAiModelInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenAiModelInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenAiModelInfo message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenAiModelInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.foundationGenAiModelInfo != null && message.hasOwnProperty("foundationGenAiModelInfo")) { - properties.modelInfo = 1; - { - var error = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify(message.foundationGenAiModelInfo); - if (error) - return "foundationGenAiModelInfo." + error; - } - } - if (message.customGenAiModelInfo != null && message.hasOwnProperty("customGenAiModelInfo")) { - if (properties.modelInfo === 1) - return "modelInfo: multiple values"; - properties.modelInfo = 1; - { - var error = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify(message.customGenAiModelInfo); - if (error) - return "customGenAiModelInfo." + error; - } - } - return null; - }; - - /** - * Creates a GenAiModelInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo} GenAiModelInfo - */ - GenAiModelInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo(); - if (object.foundationGenAiModelInfo != null) { - if (typeof object.foundationGenAiModelInfo !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.foundationGenAiModelInfo: object expected"); - message.foundationGenAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.fromObject(object.foundationGenAiModelInfo); - } - if (object.customGenAiModelInfo != null) { - if (typeof object.customGenAiModelInfo !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.customGenAiModelInfo: object expected"); - message.customGenAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.fromObject(object.customGenAiModelInfo); - } - return message; - }; - - /** - * Creates a plain object from a GenAiModelInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo} message GenAiModelInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenAiModelInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.foundationGenAiModelInfo != null && message.hasOwnProperty("foundationGenAiModelInfo")) { - object.foundationGenAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.toObject(message.foundationGenAiModelInfo, options); - if (options.oneofs) - object.modelInfo = "foundationGenAiModelInfo"; - } - if (message.customGenAiModelInfo != null && message.hasOwnProperty("customGenAiModelInfo")) { - object.customGenAiModelInfo = $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.toObject(message.customGenAiModelInfo, options); - if (options.oneofs) - object.modelInfo = "customGenAiModelInfo"; - } - return object; - }; - - /** - * Converts this GenAiModelInfo to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @instance - * @returns {Object.} JSON object - */ - GenAiModelInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenAiModelInfo - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenAiModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo"; - }; - - GenAiModelInfo.FoundationGenAiModelInfo = (function() { - - /** - * Properties of a FoundationGenAiModelInfo. - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @interface IFoundationGenAiModelInfo - * @property {boolean|null} [finetuningAllowed] FoundationGenAiModelInfo finetuningAllowed - * @property {number|null} [minTrainLabeledDocuments] FoundationGenAiModelInfo minTrainLabeledDocuments - */ - - /** - * Constructs a new FoundationGenAiModelInfo. - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @classdesc Represents a FoundationGenAiModelInfo. - * @implements IFoundationGenAiModelInfo - * @constructor - * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo=} [properties] Properties to set - */ - function FoundationGenAiModelInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FoundationGenAiModelInfo finetuningAllowed. - * @member {boolean} finetuningAllowed - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @instance - */ - FoundationGenAiModelInfo.prototype.finetuningAllowed = false; - - /** - * FoundationGenAiModelInfo minTrainLabeledDocuments. - * @member {number} minTrainLabeledDocuments - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @instance - */ - FoundationGenAiModelInfo.prototype.minTrainLabeledDocuments = 0; - - /** - * Creates a new FoundationGenAiModelInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo instance - */ - FoundationGenAiModelInfo.create = function create(properties) { - return new FoundationGenAiModelInfo(properties); - }; - - /** - * Encodes the specified FoundationGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo} message FoundationGenAiModelInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FoundationGenAiModelInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.finetuningAllowed != null && Object.hasOwnProperty.call(message, "finetuningAllowed")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.finetuningAllowed); - if (message.minTrainLabeledDocuments != null && Object.hasOwnProperty.call(message, "minTrainLabeledDocuments")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minTrainLabeledDocuments); - return writer; - }; - - /** - * Encodes the specified FoundationGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo} message FoundationGenAiModelInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FoundationGenAiModelInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @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.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FoundationGenAiModelInfo.decode = function decode(reader, 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.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.finetuningAllowed = reader.bool(); - break; - } - case 2: { - message.minTrainLabeledDocuments = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FoundationGenAiModelInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FoundationGenAiModelInfo message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FoundationGenAiModelInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.finetuningAllowed != null && message.hasOwnProperty("finetuningAllowed")) - if (typeof message.finetuningAllowed !== "boolean") - return "finetuningAllowed: boolean expected"; - if (message.minTrainLabeledDocuments != null && message.hasOwnProperty("minTrainLabeledDocuments")) - if (!$util.isInteger(message.minTrainLabeledDocuments)) - return "minTrainLabeledDocuments: integer expected"; - return null; - }; - - /** - * Creates a FoundationGenAiModelInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo - */ - FoundationGenAiModelInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo(); - if (object.finetuningAllowed != null) - message.finetuningAllowed = Boolean(object.finetuningAllowed); - if (object.minTrainLabeledDocuments != null) - message.minTrainLabeledDocuments = object.minTrainLabeledDocuments | 0; - return message; - }; - - /** - * Creates a plain object from a FoundationGenAiModelInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} message FoundationGenAiModelInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FoundationGenAiModelInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.finetuningAllowed = false; - object.minTrainLabeledDocuments = 0; - } - if (message.finetuningAllowed != null && message.hasOwnProperty("finetuningAllowed")) - object.finetuningAllowed = message.finetuningAllowed; - if (message.minTrainLabeledDocuments != null && message.hasOwnProperty("minTrainLabeledDocuments")) - object.minTrainLabeledDocuments = message.minTrainLabeledDocuments; - return object; - }; - - /** - * Converts this FoundationGenAiModelInfo to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @instance - * @returns {Object.} JSON object - */ - FoundationGenAiModelInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FoundationGenAiModelInfo - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FoundationGenAiModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo"; - }; - - return FoundationGenAiModelInfo; - })(); - - GenAiModelInfo.CustomGenAiModelInfo = (function() { - - /** - * Properties of a CustomGenAiModelInfo. - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @interface ICustomGenAiModelInfo - * @property {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|null} [customModelType] CustomGenAiModelInfo customModelType - * @property {string|null} [baseProcessorVersionId] CustomGenAiModelInfo baseProcessorVersionId - */ - - /** - * Constructs a new CustomGenAiModelInfo. - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo - * @classdesc Represents a CustomGenAiModelInfo. - * @implements ICustomGenAiModelInfo - * @constructor - * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo=} [properties] Properties to set - */ - function CustomGenAiModelInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomGenAiModelInfo customModelType. - * @member {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType} customModelType - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @instance - */ - CustomGenAiModelInfo.prototype.customModelType = 0; - - /** - * CustomGenAiModelInfo baseProcessorVersionId. - * @member {string} baseProcessorVersionId - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @instance - */ - CustomGenAiModelInfo.prototype.baseProcessorVersionId = ""; - - /** - * Creates a new CustomGenAiModelInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo instance - */ - CustomGenAiModelInfo.create = function create(properties) { - return new CustomGenAiModelInfo(properties); - }; - - /** - * Encodes the specified CustomGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo} message CustomGenAiModelInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomGenAiModelInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.customModelType != null && Object.hasOwnProperty.call(message, "customModelType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.customModelType); - if (message.baseProcessorVersionId != null && Object.hasOwnProperty.call(message, "baseProcessorVersionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseProcessorVersionId); - return writer; - }; - - /** - * Encodes the specified CustomGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo} message CustomGenAiModelInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomGenAiModelInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomGenAiModelInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @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.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomGenAiModelInfo.decode = function decode(reader, 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.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.customModelType = reader.int32(); - break; - } - case 2: { - message.baseProcessorVersionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomGenAiModelInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomGenAiModelInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomGenAiModelInfo message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomGenAiModelInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.customModelType != null && message.hasOwnProperty("customModelType")) - switch (message.customModelType) { - default: - return "customModelType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.baseProcessorVersionId != null && message.hasOwnProperty("baseProcessorVersionId")) - if (!$util.isString(message.baseProcessorVersionId)) - return "baseProcessorVersionId: string expected"; - return null; - }; - - /** - * Creates a CustomGenAiModelInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo - */ - CustomGenAiModelInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo(); - switch (object.customModelType) { - default: - if (typeof object.customModelType === "number") { - message.customModelType = object.customModelType; - break; - } - break; - case "CUSTOM_MODEL_TYPE_UNSPECIFIED": - case 0: - message.customModelType = 0; - break; - case "VERSIONED_FOUNDATION": - case 1: - message.customModelType = 1; - break; - case "FINE_TUNED": - case 2: - message.customModelType = 2; - break; - } - if (object.baseProcessorVersionId != null) - message.baseProcessorVersionId = String(object.baseProcessorVersionId); - return message; - }; - - /** - * Creates a plain object from a CustomGenAiModelInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} message CustomGenAiModelInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomGenAiModelInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.customModelType = options.enums === String ? "CUSTOM_MODEL_TYPE_UNSPECIFIED" : 0; - object.baseProcessorVersionId = ""; - } - if (message.customModelType != null && message.hasOwnProperty("customModelType")) - object.customModelType = options.enums === String ? $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType[message.customModelType] === undefined ? message.customModelType : $root.google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType[message.customModelType] : message.customModelType; - if (message.baseProcessorVersionId != null && message.hasOwnProperty("baseProcessorVersionId")) - object.baseProcessorVersionId = message.baseProcessorVersionId; - return object; - }; - - /** - * Converts this CustomGenAiModelInfo to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @instance - * @returns {Object.} JSON object - */ - CustomGenAiModelInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomGenAiModelInfo - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomGenAiModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo"; - }; - - /** - * CustomModelType enum. - * @name google.cloud.documentai.v1.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType - * @enum {number} - * @property {number} CUSTOM_MODEL_TYPE_UNSPECIFIED=0 CUSTOM_MODEL_TYPE_UNSPECIFIED value - * @property {number} VERSIONED_FOUNDATION=1 VERSIONED_FOUNDATION value - * @property {number} FINE_TUNED=2 FINE_TUNED value - */ - CustomGenAiModelInfo.CustomModelType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CUSTOM_MODEL_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "VERSIONED_FOUNDATION"] = 1; - values[valuesById[2] = "FINE_TUNED"] = 2; - return values; - })(); - - return CustomGenAiModelInfo; - })(); - - return GenAiModelInfo; - })(); - - /** - * State enum. - * @name google.cloud.documentai.v1.ProcessorVersion.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} DEPLOYED=1 DEPLOYED value - * @property {number} DEPLOYING=2 DEPLOYING value - * @property {number} UNDEPLOYED=3 UNDEPLOYED value - * @property {number} UNDEPLOYING=4 UNDEPLOYING value - * @property {number} CREATING=5 CREATING value - * @property {number} DELETING=6 DELETING value - * @property {number} FAILED=7 FAILED value - * @property {number} IMPORTING=8 IMPORTING value - */ - ProcessorVersion.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DEPLOYED"] = 1; - values[valuesById[2] = "DEPLOYING"] = 2; - values[valuesById[3] = "UNDEPLOYED"] = 3; - values[valuesById[4] = "UNDEPLOYING"] = 4; - values[valuesById[5] = "CREATING"] = 5; - values[valuesById[6] = "DELETING"] = 6; - values[valuesById[7] = "FAILED"] = 7; - values[valuesById[8] = "IMPORTING"] = 8; - return values; - })(); - - /** - * ModelType enum. - * @name google.cloud.documentai.v1.ProcessorVersion.ModelType - * @enum {number} - * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value - * @property {number} MODEL_TYPE_GENERATIVE=1 MODEL_TYPE_GENERATIVE value - * @property {number} MODEL_TYPE_CUSTOM=2 MODEL_TYPE_CUSTOM value - */ - ProcessorVersion.ModelType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "MODEL_TYPE_GENERATIVE"] = 1; - values[valuesById[2] = "MODEL_TYPE_CUSTOM"] = 2; - return values; - })(); - - return ProcessorVersion; - })(); - - v1.ProcessorVersionAlias = (function() { - - /** - * Properties of a ProcessorVersionAlias. - * @memberof google.cloud.documentai.v1 - * @interface IProcessorVersionAlias - * @property {string|null} [alias] ProcessorVersionAlias alias - * @property {string|null} [processorVersion] ProcessorVersionAlias processorVersion - */ - - /** - * Constructs a new ProcessorVersionAlias. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ProcessorVersionAlias. - * @implements IProcessorVersionAlias - * @constructor - * @param {google.cloud.documentai.v1.IProcessorVersionAlias=} [properties] Properties to set - */ - function ProcessorVersionAlias(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProcessorVersionAlias alias. - * @member {string} alias - * @memberof google.cloud.documentai.v1.ProcessorVersionAlias - * @instance - */ - ProcessorVersionAlias.prototype.alias = ""; - - /** - * ProcessorVersionAlias processorVersion. - * @member {string} processorVersion - * @memberof google.cloud.documentai.v1.ProcessorVersionAlias - * @instance - */ - ProcessorVersionAlias.prototype.processorVersion = ""; - - /** - * Creates a new ProcessorVersionAlias instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessorVersionAlias - * @static - * @param {google.cloud.documentai.v1.IProcessorVersionAlias=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessorVersionAlias} ProcessorVersionAlias instance - */ - ProcessorVersionAlias.create = function create(properties) { - return new ProcessorVersionAlias(properties); - }; - - /** - * Encodes the specified ProcessorVersionAlias message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersionAlias.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessorVersionAlias - * @static - * @param {google.cloud.documentai.v1.IProcessorVersionAlias} message ProcessorVersionAlias message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorVersionAlias.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.alias); - if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.processorVersion); - return writer; - }; - - /** - * Encodes the specified ProcessorVersionAlias message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorVersionAlias.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorVersionAlias - * @static - * @param {google.cloud.documentai.v1.IProcessorVersionAlias} message ProcessorVersionAlias message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorVersionAlias.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessorVersionAlias message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessorVersionAlias - * @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.ProcessorVersionAlias} ProcessorVersionAlias - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorVersionAlias.decode = function decode(reader, 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.ProcessorVersionAlias(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.alias = reader.string(); - break; - } - case 2: { - message.processorVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessorVersionAlias message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorVersionAlias - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessorVersionAlias} ProcessorVersionAlias - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorVersionAlias.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessorVersionAlias message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessorVersionAlias - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessorVersionAlias.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.alias != null && message.hasOwnProperty("alias")) - if (!$util.isString(message.alias)) - return "alias: string expected"; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - if (!$util.isString(message.processorVersion)) - return "processorVersion: string expected"; - return null; - }; - - /** - * Creates a ProcessorVersionAlias message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessorVersionAlias - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessorVersionAlias} ProcessorVersionAlias - */ - ProcessorVersionAlias.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessorVersionAlias) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessorVersionAlias(); - if (object.alias != null) - message.alias = String(object.alias); - if (object.processorVersion != null) - message.processorVersion = String(object.processorVersion); - return message; - }; - - /** - * Creates a plain object from a ProcessorVersionAlias message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessorVersionAlias - * @static - * @param {google.cloud.documentai.v1.ProcessorVersionAlias} message ProcessorVersionAlias - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessorVersionAlias.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.alias = ""; - object.processorVersion = ""; - } - if (message.alias != null && message.hasOwnProperty("alias")) - object.alias = message.alias; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - object.processorVersion = message.processorVersion; - return object; - }; - - /** - * Converts this ProcessorVersionAlias to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessorVersionAlias - * @instance - * @returns {Object.} JSON object - */ - ProcessorVersionAlias.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessorVersionAlias - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessorVersionAlias - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessorVersionAlias.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorVersionAlias"; - }; - - return ProcessorVersionAlias; - })(); - - v1.Processor = (function() { - - /** - * Properties of a Processor. - * @memberof google.cloud.documentai.v1 - * @interface IProcessor - * @property {string|null} [name] Processor name - * @property {string|null} [type] Processor type - * @property {string|null} [displayName] Processor displayName - * @property {google.cloud.documentai.v1.Processor.State|null} [state] Processor state - * @property {string|null} [defaultProcessorVersion] Processor defaultProcessorVersion - * @property {Array.|null} [processorVersionAliases] Processor processorVersionAliases - * @property {string|null} [processEndpoint] Processor processEndpoint - * @property {google.protobuf.ITimestamp|null} [createTime] Processor createTime - * @property {string|null} [kmsKeyName] Processor kmsKeyName - * @property {boolean|null} [satisfiesPzs] Processor satisfiesPzs - * @property {boolean|null} [satisfiesPzi] Processor satisfiesPzi - */ - - /** - * Constructs a new Processor. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a Processor. - * @implements IProcessor - * @constructor - * @param {google.cloud.documentai.v1.IProcessor=} [properties] Properties to set - */ - function Processor(properties) { - this.processorVersionAliases = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Processor name. - * @member {string} name - * @memberof google.cloud.documentai.v1.Processor - * @instance - */ - Processor.prototype.name = ""; - - /** - * Processor type. - * @member {string} type - * @memberof google.cloud.documentai.v1.Processor - * @instance - */ - Processor.prototype.type = ""; - - /** - * Processor displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1.Processor - * @instance - */ - Processor.prototype.displayName = ""; - - /** - * Processor state. - * @member {google.cloud.documentai.v1.Processor.State} state - * @memberof google.cloud.documentai.v1.Processor - * @instance - */ - Processor.prototype.state = 0; - - /** - * Processor defaultProcessorVersion. - * @member {string} defaultProcessorVersion - * @memberof google.cloud.documentai.v1.Processor - * @instance - */ - Processor.prototype.defaultProcessorVersion = ""; - - /** - * Processor processorVersionAliases. - * @member {Array.} processorVersionAliases - * @memberof google.cloud.documentai.v1.Processor - * @instance - */ - Processor.prototype.processorVersionAliases = $util.emptyArray; - - /** - * Processor processEndpoint. - * @member {string} processEndpoint - * @memberof google.cloud.documentai.v1.Processor - * @instance - */ - Processor.prototype.processEndpoint = ""; - - /** - * Processor createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1.Processor - * @instance - */ - Processor.prototype.createTime = null; - - /** - * Processor kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.documentai.v1.Processor - * @instance - */ - Processor.prototype.kmsKeyName = ""; - - /** - * Processor satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.documentai.v1.Processor - * @instance - */ - Processor.prototype.satisfiesPzs = false; - - /** - * Processor satisfiesPzi. - * @member {boolean} satisfiesPzi - * @memberof google.cloud.documentai.v1.Processor - * @instance - */ - Processor.prototype.satisfiesPzi = false; - - /** - * Creates a new Processor instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.Processor - * @static - * @param {google.cloud.documentai.v1.IProcessor=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.Processor} Processor instance - */ - Processor.create = function create(properties) { - return new Processor(properties); - }; - - /** - * Encodes the specified Processor message. Does not implicitly {@link google.cloud.documentai.v1.Processor.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.Processor - * @static - * @param {google.cloud.documentai.v1.IProcessor} message Processor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Processor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.processEndpoint != null && Object.hasOwnProperty.call(message, "processEndpoint")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.processEndpoint); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.kmsKeyName); - if (message.defaultProcessorVersion != null && Object.hasOwnProperty.call(message, "defaultProcessorVersion")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.defaultProcessorVersion); - if (message.processorVersionAliases != null && message.processorVersionAliases.length) - for (var i = 0; i < message.processorVersionAliases.length; ++i) - $root.google.cloud.documentai.v1.ProcessorVersionAlias.encode(message.processorVersionAliases[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.satisfiesPzs); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.satisfiesPzi); - return writer; - }; - - /** - * Encodes the specified Processor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.Processor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.Processor - * @static - * @param {google.cloud.documentai.v1.IProcessor} message Processor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Processor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Processor message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.Processor - * @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.Processor} Processor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Processor.decode = function decode(reader, 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.Processor(); - 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.type = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 4: { - message.state = reader.int32(); - break; - } - case 9: { - message.defaultProcessorVersion = reader.string(); - break; - } - case 10: { - if (!(message.processorVersionAliases && message.processorVersionAliases.length)) - message.processorVersionAliases = []; - message.processorVersionAliases.push($root.google.cloud.documentai.v1.ProcessorVersionAlias.decode(reader, reader.uint32())); - break; - } - case 6: { - message.processEndpoint = reader.string(); - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.kmsKeyName = reader.string(); - break; - } - case 12: { - message.satisfiesPzs = reader.bool(); - break; - } - case 13: { - message.satisfiesPzi = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Processor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.Processor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.Processor} Processor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Processor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Processor message. - * @function verify - * @memberof google.cloud.documentai.v1.Processor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Processor.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.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) - if (!$util.isString(message.defaultProcessorVersion)) - return "defaultProcessorVersion: string expected"; - if (message.processorVersionAliases != null && message.hasOwnProperty("processorVersionAliases")) { - if (!Array.isArray(message.processorVersionAliases)) - return "processorVersionAliases: array expected"; - for (var i = 0; i < message.processorVersionAliases.length; ++i) { - var error = $root.google.cloud.documentai.v1.ProcessorVersionAlias.verify(message.processorVersionAliases[i]); - if (error) - return "processorVersionAliases." + error; - } - } - if (message.processEndpoint != null && message.hasOwnProperty("processEndpoint")) - if (!$util.isString(message.processEndpoint)) - return "processEndpoint: 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.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; - return null; - }; - - /** - * Creates a Processor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.Processor - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.Processor} Processor - */ - Processor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.Processor) - return object; - var message = new $root.google.cloud.documentai.v1.Processor(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) - message.type = String(object.type); - if (object.displayName != null) - message.displayName = String(object.displayName); - 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 "ENABLED": - case 1: - message.state = 1; - break; - case "DISABLED": - case 2: - message.state = 2; - break; - case "ENABLING": - case 3: - message.state = 3; - break; - case "DISABLING": - case 4: - message.state = 4; - break; - case "CREATING": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "DELETING": - case 7: - message.state = 7; - break; - } - if (object.defaultProcessorVersion != null) - message.defaultProcessorVersion = String(object.defaultProcessorVersion); - if (object.processorVersionAliases) { - if (!Array.isArray(object.processorVersionAliases)) - throw TypeError(".google.cloud.documentai.v1.Processor.processorVersionAliases: array expected"); - message.processorVersionAliases = []; - for (var i = 0; i < object.processorVersionAliases.length; ++i) { - if (typeof object.processorVersionAliases[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.Processor.processorVersionAliases: object expected"); - message.processorVersionAliases[i] = $root.google.cloud.documentai.v1.ProcessorVersionAlias.fromObject(object.processorVersionAliases[i]); - } - } - if (object.processEndpoint != null) - message.processEndpoint = String(object.processEndpoint); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1.Processor.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); - return message; - }; - - /** - * Creates a plain object from a Processor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.Processor - * @static - * @param {google.cloud.documentai.v1.Processor} message Processor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Processor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.processorVersionAliases = []; - if (options.defaults) { - object.name = ""; - object.type = ""; - object.displayName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.processEndpoint = ""; - object.createTime = null; - object.kmsKeyName = ""; - object.defaultProcessorVersion = ""; - object.satisfiesPzs = false; - object.satisfiesPzi = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1.Processor.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.Processor.State[message.state] : message.state; - if (message.processEndpoint != null && message.hasOwnProperty("processEndpoint")) - object.processEndpoint = message.processEndpoint; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) - object.defaultProcessorVersion = message.defaultProcessorVersion; - if (message.processorVersionAliases && message.processorVersionAliases.length) { - object.processorVersionAliases = []; - for (var j = 0; j < message.processorVersionAliases.length; ++j) - object.processorVersionAliases[j] = $root.google.cloud.documentai.v1.ProcessorVersionAlias.toObject(message.processorVersionAliases[j], options); - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; - return object; - }; - - /** - * Converts this Processor to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.Processor - * @instance - * @returns {Object.} JSON object - */ - Processor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Processor - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.Processor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Processor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.Processor"; - }; - - /** - * State enum. - * @name google.cloud.documentai.v1.Processor.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ENABLED=1 ENABLED value - * @property {number} DISABLED=2 DISABLED value - * @property {number} ENABLING=3 ENABLING value - * @property {number} DISABLING=4 DISABLING value - * @property {number} CREATING=5 CREATING value - * @property {number} FAILED=6 FAILED value - * @property {number} DELETING=7 DELETING value - */ - Processor.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENABLED"] = 1; - values[valuesById[2] = "DISABLED"] = 2; - values[valuesById[3] = "ENABLING"] = 3; - values[valuesById[4] = "DISABLING"] = 4; - values[valuesById[5] = "CREATING"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[7] = "DELETING"] = 7; - return values; - })(); - - return Processor; - })(); - - v1.ProcessorType = (function() { - - /** - * Properties of a ProcessorType. - * @memberof google.cloud.documentai.v1 - * @interface IProcessorType - * @property {string|null} [name] ProcessorType name - * @property {string|null} [type] ProcessorType type - * @property {string|null} [category] ProcessorType category - * @property {Array.|null} [availableLocations] ProcessorType availableLocations - * @property {boolean|null} [allowCreation] ProcessorType allowCreation - * @property {google.api.LaunchStage|null} [launchStage] ProcessorType launchStage - * @property {Array.|null} [sampleDocumentUris] ProcessorType sampleDocumentUris - */ - - /** - * Constructs a new ProcessorType. - * @memberof google.cloud.documentai.v1 - * @classdesc Represents a ProcessorType. - * @implements IProcessorType - * @constructor - * @param {google.cloud.documentai.v1.IProcessorType=} [properties] Properties to set - */ - function ProcessorType(properties) { - this.availableLocations = []; - this.sampleDocumentUris = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProcessorType name. - * @member {string} name - * @memberof google.cloud.documentai.v1.ProcessorType - * @instance - */ - ProcessorType.prototype.name = ""; - - /** - * ProcessorType type. - * @member {string} type - * @memberof google.cloud.documentai.v1.ProcessorType - * @instance - */ - ProcessorType.prototype.type = ""; - - /** - * ProcessorType category. - * @member {string} category - * @memberof google.cloud.documentai.v1.ProcessorType - * @instance - */ - ProcessorType.prototype.category = ""; - - /** - * ProcessorType availableLocations. - * @member {Array.} availableLocations - * @memberof google.cloud.documentai.v1.ProcessorType - * @instance - */ - ProcessorType.prototype.availableLocations = $util.emptyArray; - - /** - * ProcessorType allowCreation. - * @member {boolean} allowCreation - * @memberof google.cloud.documentai.v1.ProcessorType - * @instance - */ - ProcessorType.prototype.allowCreation = false; - - /** - * ProcessorType launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.documentai.v1.ProcessorType - * @instance - */ - ProcessorType.prototype.launchStage = 0; - - /** - * ProcessorType sampleDocumentUris. - * @member {Array.} sampleDocumentUris - * @memberof google.cloud.documentai.v1.ProcessorType - * @instance - */ - ProcessorType.prototype.sampleDocumentUris = $util.emptyArray; - - /** - * Creates a new ProcessorType instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessorType - * @static - * @param {google.cloud.documentai.v1.IProcessorType=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessorType} ProcessorType instance - */ - ProcessorType.create = function create(properties) { - return new ProcessorType(properties); - }; - - /** - * Encodes the specified ProcessorType message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessorType - * @static - * @param {google.cloud.documentai.v1.IProcessorType} message ProcessorType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorType.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.category != null && Object.hasOwnProperty.call(message, "category")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.category); - if (message.availableLocations != null && message.availableLocations.length) - for (var i = 0; i < message.availableLocations.length; ++i) - $root.google.cloud.documentai.v1.ProcessorType.LocationInfo.encode(message.availableLocations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.allowCreation != null && Object.hasOwnProperty.call(message, "allowCreation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowCreation); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.launchStage); - if (message.sampleDocumentUris != null && message.sampleDocumentUris.length) - for (var i = 0; i < message.sampleDocumentUris.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.sampleDocumentUris[i]); - return writer; - }; - - /** - * Encodes the specified ProcessorType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorType - * @static - * @param {google.cloud.documentai.v1.IProcessorType} message ProcessorType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessorType message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessorType - * @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.ProcessorType} ProcessorType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorType.decode = function decode(reader, 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.ProcessorType(); - 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.type = reader.string(); - break; - } - case 3: { - message.category = reader.string(); - break; - } - case 4: { - if (!(message.availableLocations && message.availableLocations.length)) - message.availableLocations = []; - message.availableLocations.push($root.google.cloud.documentai.v1.ProcessorType.LocationInfo.decode(reader, reader.uint32())); - break; - } - case 6: { - message.allowCreation = reader.bool(); - break; - } - case 8: { - message.launchStage = reader.int32(); - break; - } - case 9: { - if (!(message.sampleDocumentUris && message.sampleDocumentUris.length)) - message.sampleDocumentUris = []; - message.sampleDocumentUris.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessorType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessorType} ProcessorType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessorType message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessorType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessorType.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.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.category != null && message.hasOwnProperty("category")) - if (!$util.isString(message.category)) - return "category: string expected"; - if (message.availableLocations != null && message.hasOwnProperty("availableLocations")) { - if (!Array.isArray(message.availableLocations)) - return "availableLocations: array expected"; - for (var i = 0; i < message.availableLocations.length; ++i) { - var error = $root.google.cloud.documentai.v1.ProcessorType.LocationInfo.verify(message.availableLocations[i]); - if (error) - return "availableLocations." + error; - } - } - if (message.allowCreation != null && message.hasOwnProperty("allowCreation")) - if (typeof message.allowCreation !== "boolean") - return "allowCreation: boolean 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.sampleDocumentUris != null && message.hasOwnProperty("sampleDocumentUris")) { - if (!Array.isArray(message.sampleDocumentUris)) - return "sampleDocumentUris: array expected"; - for (var i = 0; i < message.sampleDocumentUris.length; ++i) - if (!$util.isString(message.sampleDocumentUris[i])) - return "sampleDocumentUris: string[] expected"; - } - return null; - }; - - /** - * Creates a ProcessorType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessorType - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessorType} ProcessorType - */ - ProcessorType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessorType) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessorType(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) - message.type = String(object.type); - if (object.category != null) - message.category = String(object.category); - if (object.availableLocations) { - if (!Array.isArray(object.availableLocations)) - throw TypeError(".google.cloud.documentai.v1.ProcessorType.availableLocations: array expected"); - message.availableLocations = []; - for (var i = 0; i < object.availableLocations.length; ++i) { - if (typeof object.availableLocations[i] !== "object") - throw TypeError(".google.cloud.documentai.v1.ProcessorType.availableLocations: object expected"); - message.availableLocations[i] = $root.google.cloud.documentai.v1.ProcessorType.LocationInfo.fromObject(object.availableLocations[i]); - } - } - if (object.allowCreation != null) - message.allowCreation = Boolean(object.allowCreation); - 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.sampleDocumentUris) { - if (!Array.isArray(object.sampleDocumentUris)) - throw TypeError(".google.cloud.documentai.v1.ProcessorType.sampleDocumentUris: array expected"); - message.sampleDocumentUris = []; - for (var i = 0; i < object.sampleDocumentUris.length; ++i) - message.sampleDocumentUris[i] = String(object.sampleDocumentUris[i]); - } - return message; - }; - - /** - * Creates a plain object from a ProcessorType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessorType - * @static - * @param {google.cloud.documentai.v1.ProcessorType} message ProcessorType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessorType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.availableLocations = []; - object.sampleDocumentUris = []; - } - if (options.defaults) { - object.name = ""; - object.type = ""; - object.category = ""; - object.allowCreation = false; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.category != null && message.hasOwnProperty("category")) - object.category = message.category; - if (message.availableLocations && message.availableLocations.length) { - object.availableLocations = []; - for (var j = 0; j < message.availableLocations.length; ++j) - object.availableLocations[j] = $root.google.cloud.documentai.v1.ProcessorType.LocationInfo.toObject(message.availableLocations[j], options); - } - if (message.allowCreation != null && message.hasOwnProperty("allowCreation")) - object.allowCreation = message.allowCreation; - 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.sampleDocumentUris && message.sampleDocumentUris.length) { - object.sampleDocumentUris = []; - for (var j = 0; j < message.sampleDocumentUris.length; ++j) - object.sampleDocumentUris[j] = message.sampleDocumentUris[j]; - } - return object; - }; - - /** - * Converts this ProcessorType to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessorType - * @instance - * @returns {Object.} JSON object - */ - ProcessorType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessorType - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessorType - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessorType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorType"; - }; - - ProcessorType.LocationInfo = (function() { - - /** - * Properties of a LocationInfo. - * @memberof google.cloud.documentai.v1.ProcessorType - * @interface ILocationInfo - * @property {string|null} [locationId] LocationInfo locationId - */ - - /** - * Constructs a new LocationInfo. - * @memberof google.cloud.documentai.v1.ProcessorType - * @classdesc Represents a LocationInfo. - * @implements ILocationInfo - * @constructor - * @param {google.cloud.documentai.v1.ProcessorType.ILocationInfo=} [properties] Properties to set - */ - function LocationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LocationInfo locationId. - * @member {string} locationId - * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo - * @instance - */ - LocationInfo.prototype.locationId = ""; - - /** - * Creates a new LocationInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorType.ILocationInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1.ProcessorType.LocationInfo} LocationInfo instance - */ - LocationInfo.create = function create(properties) { - return new LocationInfo(properties); - }; - - /** - * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.LocationInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorType.ILocationInfo} message LocationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.locationId); - return writer; - }; - - /** - * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1.ProcessorType.LocationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorType.ILocationInfo} message LocationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LocationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo - * @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.ProcessorType.LocationInfo} LocationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationInfo.decode = function decode(reader, 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.ProcessorType.LocationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.locationId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LocationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1.ProcessorType.LocationInfo} LocationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LocationInfo message. - * @function verify - * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LocationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.locationId != null && message.hasOwnProperty("locationId")) - if (!$util.isString(message.locationId)) - return "locationId: string expected"; - return null; - }; - - /** - * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1.ProcessorType.LocationInfo} LocationInfo - */ - LocationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1.ProcessorType.LocationInfo) - return object; - var message = new $root.google.cloud.documentai.v1.ProcessorType.LocationInfo(); - if (object.locationId != null) - message.locationId = String(object.locationId); - return message; - }; - - /** - * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo - * @static - * @param {google.cloud.documentai.v1.ProcessorType.LocationInfo} message LocationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.locationId = ""; - if (message.locationId != null && message.hasOwnProperty("locationId")) - object.locationId = message.locationId; - return object; - }; - - /** - * Converts this LocationInfo to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo - * @instance - * @returns {Object.} JSON object - */ - LocationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LocationInfo - * @function getTypeUrl - * @memberof google.cloud.documentai.v1.ProcessorType.LocationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LocationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1.ProcessorType.LocationInfo"; - }; - - return LocationInfo; - })(); - - return ProcessorType; - })(); - - return v1; - })(); - - documentai.v1beta3 = (function() { - - /** - * Namespace v1beta3. - * @memberof google.cloud.documentai - * @namespace - */ - var v1beta3 = {}; - - v1beta3.Barcode = (function() { - - /** - * Properties of a Barcode. - * @memberof google.cloud.documentai.v1beta3 - * @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.v1beta3 - * @classdesc Represents a Barcode. - * @implements IBarcode - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Barcode - * @instance - */ - Barcode.prototype.format = ""; - - /** - * Barcode valueFormat. - * @member {string} valueFormat - * @memberof google.cloud.documentai.v1beta3.Barcode - * @instance - */ - Barcode.prototype.valueFormat = ""; - - /** - * Barcode rawValue. - * @member {string} rawValue - * @memberof google.cloud.documentai.v1beta3.Barcode - * @instance - */ - Barcode.prototype.rawValue = ""; - - /** - * Creates a new Barcode instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Barcode - * @static - * @param {google.cloud.documentai.v1beta3.IBarcode=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Barcode} Barcode instance - */ - Barcode.create = function create(properties) { - return new Barcode(properties); - }; - - /** - * Encodes the specified Barcode message. Does not implicitly {@link google.cloud.documentai.v1beta3.Barcode.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Barcode - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Barcode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Barcode - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Barcode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Barcode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Barcode} Barcode - */ - Barcode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Barcode) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Barcode - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Barcode"; - }; - - return Barcode; - })(); - - v1beta3.Dataset = (function() { - - /** - * Properties of a Dataset. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDataset - * @property {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig|null} [gcsManagedConfig] Dataset gcsManagedConfig - * @property {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig|null} [documentWarehouseConfig] Dataset documentWarehouseConfig - * @property {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null} [unmanagedDatasetConfig] Dataset unmanagedDatasetConfig - * @property {string|null} [name] Dataset name - * @property {google.cloud.documentai.v1beta3.Dataset.State|null} [state] Dataset state - * @property {boolean|null} [satisfiesPzs] Dataset satisfiesPzs - * @property {boolean|null} [satisfiesPzi] Dataset satisfiesPzi - */ - - /** - * Constructs a new Dataset. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a Dataset. - * @implements IDataset - * @constructor - * @param {google.cloud.documentai.v1beta3.IDataset=} [properties] Properties to set - */ - function Dataset(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Dataset gcsManagedConfig. - * @member {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig|null|undefined} gcsManagedConfig - * @memberof google.cloud.documentai.v1beta3.Dataset - * @instance - */ - Dataset.prototype.gcsManagedConfig = null; - - /** - * Dataset documentWarehouseConfig. - * @member {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig|null|undefined} documentWarehouseConfig - * @memberof google.cloud.documentai.v1beta3.Dataset - * @instance - */ - Dataset.prototype.documentWarehouseConfig = null; - - /** - * Dataset unmanagedDatasetConfig. - * @member {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null|undefined} unmanagedDatasetConfig - * @memberof google.cloud.documentai.v1beta3.Dataset - * @instance - */ - Dataset.prototype.unmanagedDatasetConfig = null; - - /** - * Dataset name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.Dataset - * @instance - */ - Dataset.prototype.name = ""; - - /** - * Dataset state. - * @member {google.cloud.documentai.v1beta3.Dataset.State} state - * @memberof google.cloud.documentai.v1beta3.Dataset - * @instance - */ - Dataset.prototype.state = 0; - - /** - * Dataset satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.documentai.v1beta3.Dataset - * @instance - */ - Dataset.prototype.satisfiesPzs = false; - - /** - * Dataset satisfiesPzi. - * @member {boolean} satisfiesPzi - * @memberof google.cloud.documentai.v1beta3.Dataset - * @instance - */ - Dataset.prototype.satisfiesPzi = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Dataset storageSource. - * @member {"gcsManagedConfig"|"documentWarehouseConfig"|"unmanagedDatasetConfig"|undefined} storageSource - * @memberof google.cloud.documentai.v1beta3.Dataset - * @instance - */ - Object.defineProperty(Dataset.prototype, "storageSource", { - get: $util.oneOfGetter($oneOfFields = ["gcsManagedConfig", "documentWarehouseConfig", "unmanagedDatasetConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Dataset instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Dataset - * @static - * @param {google.cloud.documentai.v1beta3.IDataset=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Dataset} Dataset instance - */ - Dataset.create = function create(properties) { - return new Dataset(properties); - }; - - /** - * Encodes the specified Dataset message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Dataset - * @static - * @param {google.cloud.documentai.v1beta3.IDataset} message Dataset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Dataset.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.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.gcsManagedConfig != null && Object.hasOwnProperty.call(message, "gcsManagedConfig")) - $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.encode(message.gcsManagedConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.documentWarehouseConfig != null && Object.hasOwnProperty.call(message, "documentWarehouseConfig")) - $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.encode(message.documentWarehouseConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.unmanagedDatasetConfig != null && Object.hasOwnProperty.call(message, "unmanagedDatasetConfig")) - $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.encode(message.unmanagedDatasetConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.satisfiesPzs); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.satisfiesPzi); - return writer; - }; - - /** - * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Dataset - * @static - * @param {google.cloud.documentai.v1beta3.IDataset} message Dataset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Dataset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Dataset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Dataset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Dataset} Dataset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Dataset.decode = function decode(reader, 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.v1beta3.Dataset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.gcsManagedConfig = $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.documentWarehouseConfig = $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.unmanagedDatasetConfig = $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 8: { - message.satisfiesPzs = reader.bool(); - break; - } - case 9: { - message.satisfiesPzi = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Dataset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Dataset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Dataset} Dataset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Dataset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Dataset message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Dataset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Dataset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsManagedConfig != null && message.hasOwnProperty("gcsManagedConfig")) { - properties.storageSource = 1; - { - var error = $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.verify(message.gcsManagedConfig); - if (error) - return "gcsManagedConfig." + error; - } - } - if (message.documentWarehouseConfig != null && message.hasOwnProperty("documentWarehouseConfig")) { - if (properties.storageSource === 1) - return "storageSource: multiple values"; - properties.storageSource = 1; - { - var error = $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.verify(message.documentWarehouseConfig); - if (error) - return "documentWarehouseConfig." + error; - } - } - if (message.unmanagedDatasetConfig != null && message.hasOwnProperty("unmanagedDatasetConfig")) { - if (properties.storageSource === 1) - return "storageSource: multiple values"; - properties.storageSource = 1; - { - var error = $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.verify(message.unmanagedDatasetConfig); - if (error) - return "unmanagedDatasetConfig." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; - return null; - }; - - /** - * Creates a Dataset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Dataset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Dataset} Dataset - */ - Dataset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Dataset) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Dataset(); - if (object.gcsManagedConfig != null) { - if (typeof object.gcsManagedConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Dataset.gcsManagedConfig: object expected"); - message.gcsManagedConfig = $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.fromObject(object.gcsManagedConfig); - } - if (object.documentWarehouseConfig != null) { - if (typeof object.documentWarehouseConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Dataset.documentWarehouseConfig: object expected"); - message.documentWarehouseConfig = $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.fromObject(object.documentWarehouseConfig); - } - if (object.unmanagedDatasetConfig != null) { - if (typeof object.unmanagedDatasetConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Dataset.unmanagedDatasetConfig: object expected"); - message.unmanagedDatasetConfig = $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.fromObject(object.unmanagedDatasetConfig); - } - if (object.name != null) - message.name = String(object.name); - 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 "UNINITIALIZED": - case 1: - message.state = 1; - break; - case "INITIALIZING": - case 2: - message.state = 2; - break; - case "INITIALIZED": - case 3: - message.state = 3; - break; - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); - return message; - }; - - /** - * Creates a plain object from a Dataset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Dataset - * @static - * @param {google.cloud.documentai.v1beta3.Dataset} message Dataset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Dataset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.satisfiesPzs = false; - object.satisfiesPzi = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.Dataset.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.Dataset.State[message.state] : message.state; - if (message.gcsManagedConfig != null && message.hasOwnProperty("gcsManagedConfig")) { - object.gcsManagedConfig = $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.toObject(message.gcsManagedConfig, options); - if (options.oneofs) - object.storageSource = "gcsManagedConfig"; - } - if (message.documentWarehouseConfig != null && message.hasOwnProperty("documentWarehouseConfig")) { - object.documentWarehouseConfig = $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.toObject(message.documentWarehouseConfig, options); - if (options.oneofs) - object.storageSource = "documentWarehouseConfig"; - } - if (message.unmanagedDatasetConfig != null && message.hasOwnProperty("unmanagedDatasetConfig")) { - object.unmanagedDatasetConfig = $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.toObject(message.unmanagedDatasetConfig, options); - if (options.oneofs) - object.storageSource = "unmanagedDatasetConfig"; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; - return object; - }; - - /** - * Converts this Dataset to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Dataset - * @instance - * @returns {Object.} JSON object - */ - Dataset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Dataset - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Dataset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset"; - }; - - Dataset.GCSManagedConfig = (function() { - - /** - * Properties of a GCSManagedConfig. - * @memberof google.cloud.documentai.v1beta3.Dataset - * @interface IGCSManagedConfig - * @property {google.cloud.documentai.v1beta3.IGcsPrefix|null} [gcsPrefix] GCSManagedConfig gcsPrefix - */ - - /** - * Constructs a new GCSManagedConfig. - * @memberof google.cloud.documentai.v1beta3.Dataset - * @classdesc Represents a GCSManagedConfig. - * @implements IGCSManagedConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig=} [properties] Properties to set - */ - function GCSManagedConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GCSManagedConfig gcsPrefix. - * @member {google.cloud.documentai.v1beta3.IGcsPrefix|null|undefined} gcsPrefix - * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig - * @instance - */ - GCSManagedConfig.prototype.gcsPrefix = null; - - /** - * Creates a new GCSManagedConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} GCSManagedConfig instance - */ - GCSManagedConfig.create = function create(properties) { - return new GCSManagedConfig(properties); - }; - - /** - * Encodes the specified GCSManagedConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig} message GCSManagedConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCSManagedConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) - $root.google.cloud.documentai.v1beta3.GcsPrefix.encode(message.gcsPrefix, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GCSManagedConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig} message GCSManagedConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCSManagedConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GCSManagedConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} GCSManagedConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCSManagedConfig.decode = function decode(reader, 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.v1beta3.Dataset.GCSManagedConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GCSManagedConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} GCSManagedConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCSManagedConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GCSManagedConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GCSManagedConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - var error = $root.google.cloud.documentai.v1beta3.GcsPrefix.verify(message.gcsPrefix); - if (error) - return "gcsPrefix." + error; - } - return null; - }; - - /** - * Creates a GCSManagedConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} GCSManagedConfig - */ - GCSManagedConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig(); - if (object.gcsPrefix != null) { - if (typeof object.gcsPrefix !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.gcsPrefix: object expected"); - message.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.fromObject(object.gcsPrefix); - } - return message; - }; - - /** - * Creates a plain object from a GCSManagedConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig} message GCSManagedConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GCSManagedConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.gcsPrefix = null; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) - object.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.toObject(message.gcsPrefix, options); - return object; - }; - - /** - * Converts this GCSManagedConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig - * @instance - * @returns {Object.} JSON object - */ - GCSManagedConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GCSManagedConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GCSManagedConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig"; - }; - - return GCSManagedConfig; - })(); - - Dataset.DocumentWarehouseConfig = (function() { - - /** - * Properties of a DocumentWarehouseConfig. - * @memberof google.cloud.documentai.v1beta3.Dataset - * @interface IDocumentWarehouseConfig - * @property {string|null} [collection] DocumentWarehouseConfig collection - * @property {string|null} [schema] DocumentWarehouseConfig schema - */ - - /** - * Constructs a new DocumentWarehouseConfig. - * @memberof google.cloud.documentai.v1beta3.Dataset - * @classdesc Represents a DocumentWarehouseConfig. - * @implements IDocumentWarehouseConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig=} [properties] Properties to set - */ - function DocumentWarehouseConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DocumentWarehouseConfig collection. - * @member {string} collection - * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig - * @instance - */ - DocumentWarehouseConfig.prototype.collection = ""; - - /** - * DocumentWarehouseConfig schema. - * @member {string} schema - * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig - * @instance - */ - DocumentWarehouseConfig.prototype.schema = ""; - - /** - * Creates a new DocumentWarehouseConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} DocumentWarehouseConfig instance - */ - DocumentWarehouseConfig.create = function create(properties) { - return new DocumentWarehouseConfig(properties); - }; - - /** - * Encodes the specified DocumentWarehouseConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig} message DocumentWarehouseConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentWarehouseConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.collection != null && Object.hasOwnProperty.call(message, "collection")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.collection); - if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.schema); - return writer; - }; - - /** - * Encodes the specified DocumentWarehouseConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig} message DocumentWarehouseConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentWarehouseConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentWarehouseConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} DocumentWarehouseConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentWarehouseConfig.decode = function decode(reader, 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.v1beta3.Dataset.DocumentWarehouseConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.collection = reader.string(); - break; - } - case 2: { - message.schema = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentWarehouseConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} DocumentWarehouseConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentWarehouseConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentWarehouseConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentWarehouseConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.collection != null && message.hasOwnProperty("collection")) - if (!$util.isString(message.collection)) - return "collection: string expected"; - if (message.schema != null && message.hasOwnProperty("schema")) - if (!$util.isString(message.schema)) - return "schema: string expected"; - return null; - }; - - /** - * Creates a DocumentWarehouseConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} DocumentWarehouseConfig - */ - DocumentWarehouseConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig(); - if (object.collection != null) - message.collection = String(object.collection); - if (object.schema != null) - message.schema = String(object.schema); - return message; - }; - - /** - * Creates a plain object from a DocumentWarehouseConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig} message DocumentWarehouseConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentWarehouseConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.collection = ""; - object.schema = ""; - } - if (message.collection != null && message.hasOwnProperty("collection")) - object.collection = message.collection; - if (message.schema != null && message.hasOwnProperty("schema")) - object.schema = message.schema; - return object; - }; - - /** - * Converts this DocumentWarehouseConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig - * @instance - * @returns {Object.} JSON object - */ - DocumentWarehouseConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentWarehouseConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentWarehouseConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig"; - }; - - return DocumentWarehouseConfig; - })(); - - Dataset.UnmanagedDatasetConfig = (function() { - - /** - * Properties of an UnmanagedDatasetConfig. - * @memberof google.cloud.documentai.v1beta3.Dataset - * @interface IUnmanagedDatasetConfig - */ - - /** - * Constructs a new UnmanagedDatasetConfig. - * @memberof google.cloud.documentai.v1beta3.Dataset - * @classdesc Represents an UnmanagedDatasetConfig. - * @implements IUnmanagedDatasetConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig=} [properties] Properties to set - */ - function UnmanagedDatasetConfig(properties) { - if (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 UnmanagedDatasetConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig} UnmanagedDatasetConfig instance - */ - UnmanagedDatasetConfig.create = function create(properties) { - return new UnmanagedDatasetConfig(properties); - }; - - /** - * Encodes the specified UnmanagedDatasetConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig} message UnmanagedDatasetConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UnmanagedDatasetConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified UnmanagedDatasetConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig} message UnmanagedDatasetConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UnmanagedDatasetConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UnmanagedDatasetConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig} UnmanagedDatasetConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UnmanagedDatasetConfig.decode = function decode(reader, 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.v1beta3.Dataset.UnmanagedDatasetConfig(); - 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 UnmanagedDatasetConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig} UnmanagedDatasetConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UnmanagedDatasetConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UnmanagedDatasetConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UnmanagedDatasetConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an UnmanagedDatasetConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig} UnmanagedDatasetConfig - */ - UnmanagedDatasetConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig) - return object; - return new $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig(); - }; - - /** - * Creates a plain object from an UnmanagedDatasetConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig} message UnmanagedDatasetConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UnmanagedDatasetConfig.toObject = function toObject() { - return {}; - }; - - /** - * Converts this UnmanagedDatasetConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig - * @instance - * @returns {Object.} JSON object - */ - UnmanagedDatasetConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UnmanagedDatasetConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UnmanagedDatasetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig"; - }; - - return UnmanagedDatasetConfig; - })(); - - /** - * State enum. - * @name google.cloud.documentai.v1beta3.Dataset.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} UNINITIALIZED=1 UNINITIALIZED value - * @property {number} INITIALIZING=2 INITIALIZING value - * @property {number} INITIALIZED=3 INITIALIZED value - */ - Dataset.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "UNINITIALIZED"] = 1; - values[valuesById[2] = "INITIALIZING"] = 2; - values[valuesById[3] = "INITIALIZED"] = 3; - return values; - })(); - - return Dataset; - })(); - - v1beta3.DocumentId = (function() { - - /** - * Properties of a DocumentId. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDocumentId - * @property {google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId|null} [gcsManagedDocId] DocumentId gcsManagedDocId - * @property {google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId|null} [unmanagedDocId] DocumentId unmanagedDocId - * @property {google.cloud.documentai.v1beta3.IRevisionRef|null} [revisionRef] DocumentId revisionRef - */ - - /** - * Constructs a new DocumentId. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DocumentId. - * @implements IDocumentId - * @constructor - * @param {google.cloud.documentai.v1beta3.IDocumentId=} [properties] Properties to set - */ - function DocumentId(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DocumentId gcsManagedDocId. - * @member {google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId|null|undefined} gcsManagedDocId - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @instance - */ - DocumentId.prototype.gcsManagedDocId = null; - - /** - * DocumentId unmanagedDocId. - * @member {google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId|null|undefined} unmanagedDocId - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @instance - */ - DocumentId.prototype.unmanagedDocId = null; - - /** - * DocumentId revisionRef. - * @member {google.cloud.documentai.v1beta3.IRevisionRef|null|undefined} revisionRef - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @instance - */ - DocumentId.prototype.revisionRef = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DocumentId type. - * @member {"gcsManagedDocId"|"unmanagedDocId"|undefined} type - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @instance - */ - Object.defineProperty(DocumentId.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["gcsManagedDocId", "unmanagedDocId"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DocumentId instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentId=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentId} DocumentId instance - */ - DocumentId.create = function create(properties) { - return new DocumentId(properties); - }; - - /** - * Encodes the specified DocumentId message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentId} message DocumentId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentId.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsManagedDocId != null && Object.hasOwnProperty.call(message, "gcsManagedDocId")) - $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.encode(message.gcsManagedDocId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.revisionRef != null && Object.hasOwnProperty.call(message, "revisionRef")) - $root.google.cloud.documentai.v1beta3.RevisionRef.encode(message.revisionRef, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.unmanagedDocId != null && Object.hasOwnProperty.call(message, "unmanagedDocId")) - $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.encode(message.unmanagedDocId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DocumentId message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentId} message DocumentId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentId.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentId message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DocumentId} DocumentId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentId.decode = function decode(reader, 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.v1beta3.DocumentId(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsManagedDocId = $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.decode(reader, reader.uint32()); - break; - } - case 4: { - message.unmanagedDocId = $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.decode(reader, reader.uint32()); - break; - } - case 3: { - message.revisionRef = $root.google.cloud.documentai.v1beta3.RevisionRef.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentId message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentId} DocumentId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentId.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentId message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentId.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsManagedDocId != null && message.hasOwnProperty("gcsManagedDocId")) { - properties.type = 1; - { - var error = $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.verify(message.gcsManagedDocId); - if (error) - return "gcsManagedDocId." + error; - } - } - if (message.unmanagedDocId != null && message.hasOwnProperty("unmanagedDocId")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.verify(message.unmanagedDocId); - if (error) - return "unmanagedDocId." + error; - } - } - if (message.revisionRef != null && message.hasOwnProperty("revisionRef")) { - var error = $root.google.cloud.documentai.v1beta3.RevisionRef.verify(message.revisionRef); - if (error) - return "revisionRef." + error; - } - return null; - }; - - /** - * Creates a DocumentId message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentId} DocumentId - */ - DocumentId.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentId) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentId(); - if (object.gcsManagedDocId != null) { - if (typeof object.gcsManagedDocId !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DocumentId.gcsManagedDocId: object expected"); - message.gcsManagedDocId = $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.fromObject(object.gcsManagedDocId); - } - if (object.unmanagedDocId != null) { - if (typeof object.unmanagedDocId !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DocumentId.unmanagedDocId: object expected"); - message.unmanagedDocId = $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.fromObject(object.unmanagedDocId); - } - if (object.revisionRef != null) { - if (typeof object.revisionRef !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DocumentId.revisionRef: object expected"); - message.revisionRef = $root.google.cloud.documentai.v1beta3.RevisionRef.fromObject(object.revisionRef); - } - return message; - }; - - /** - * Creates a plain object from a DocumentId message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @static - * @param {google.cloud.documentai.v1beta3.DocumentId} message DocumentId - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentId.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.revisionRef = null; - if (message.gcsManagedDocId != null && message.hasOwnProperty("gcsManagedDocId")) { - object.gcsManagedDocId = $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.toObject(message.gcsManagedDocId, options); - if (options.oneofs) - object.type = "gcsManagedDocId"; - } - if (message.revisionRef != null && message.hasOwnProperty("revisionRef")) - object.revisionRef = $root.google.cloud.documentai.v1beta3.RevisionRef.toObject(message.revisionRef, options); - if (message.unmanagedDocId != null && message.hasOwnProperty("unmanagedDocId")) { - object.unmanagedDocId = $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.toObject(message.unmanagedDocId, options); - if (options.oneofs) - object.type = "unmanagedDocId"; - } - return object; - }; - - /** - * Converts this DocumentId to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @instance - * @returns {Object.} JSON object - */ - DocumentId.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentId - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentId"; - }; - - DocumentId.GCSManagedDocumentId = (function() { - - /** - * Properties of a GCSManagedDocumentId. - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @interface IGCSManagedDocumentId - * @property {string|null} [gcsUri] GCSManagedDocumentId gcsUri - * @property {string|null} [cwDocId] GCSManagedDocumentId cwDocId - */ - - /** - * Constructs a new GCSManagedDocumentId. - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @classdesc Represents a GCSManagedDocumentId. - * @implements IGCSManagedDocumentId - * @constructor - * @param {google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId=} [properties] Properties to set - */ - function GCSManagedDocumentId(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GCSManagedDocumentId gcsUri. - * @member {string} gcsUri - * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId - * @instance - */ - GCSManagedDocumentId.prototype.gcsUri = ""; - - /** - * GCSManagedDocumentId cwDocId. - * @member {string} cwDocId - * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId - * @instance - */ - GCSManagedDocumentId.prototype.cwDocId = ""; - - /** - * Creates a new GCSManagedDocumentId instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId - * @static - * @param {google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId} GCSManagedDocumentId instance - */ - GCSManagedDocumentId.create = function create(properties) { - return new GCSManagedDocumentId(properties); - }; - - /** - * Encodes the specified GCSManagedDocumentId message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId - * @static - * @param {google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId} message GCSManagedDocumentId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCSManagedDocumentId.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); - if (message.cwDocId != null && Object.hasOwnProperty.call(message, "cwDocId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.cwDocId); - return writer; - }; - - /** - * Encodes the specified GCSManagedDocumentId message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId - * @static - * @param {google.cloud.documentai.v1beta3.DocumentId.IGCSManagedDocumentId} message GCSManagedDocumentId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCSManagedDocumentId.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GCSManagedDocumentId message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId} GCSManagedDocumentId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCSManagedDocumentId.decode = function decode(reader, 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.v1beta3.DocumentId.GCSManagedDocumentId(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsUri = reader.string(); - break; - } - case 2: { - message.cwDocId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GCSManagedDocumentId message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId} GCSManagedDocumentId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCSManagedDocumentId.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GCSManagedDocumentId message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GCSManagedDocumentId.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - if (message.cwDocId != null && message.hasOwnProperty("cwDocId")) - if (!$util.isString(message.cwDocId)) - return "cwDocId: string expected"; - return null; - }; - - /** - * Creates a GCSManagedDocumentId message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId} GCSManagedDocumentId - */ - GCSManagedDocumentId.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId(); - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.cwDocId != null) - message.cwDocId = String(object.cwDocId); - return message; - }; - - /** - * Creates a plain object from a GCSManagedDocumentId message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId - * @static - * @param {google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId} message GCSManagedDocumentId - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GCSManagedDocumentId.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcsUri = ""; - object.cwDocId = ""; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - object.gcsUri = message.gcsUri; - if (message.cwDocId != null && message.hasOwnProperty("cwDocId")) - object.cwDocId = message.cwDocId; - return object; - }; - - /** - * Converts this GCSManagedDocumentId to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId - * @instance - * @returns {Object.} JSON object - */ - GCSManagedDocumentId.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GCSManagedDocumentId - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GCSManagedDocumentId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentId.GCSManagedDocumentId"; - }; - - return GCSManagedDocumentId; - })(); - - DocumentId.UnmanagedDocumentId = (function() { - - /** - * Properties of an UnmanagedDocumentId. - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @interface IUnmanagedDocumentId - * @property {string|null} [docId] UnmanagedDocumentId docId - */ - - /** - * Constructs a new UnmanagedDocumentId. - * @memberof google.cloud.documentai.v1beta3.DocumentId - * @classdesc Represents an UnmanagedDocumentId. - * @implements IUnmanagedDocumentId - * @constructor - * @param {google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId=} [properties] Properties to set - */ - function UnmanagedDocumentId(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UnmanagedDocumentId docId. - * @member {string} docId - * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId - * @instance - */ - UnmanagedDocumentId.prototype.docId = ""; - - /** - * Creates a new UnmanagedDocumentId instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId - * @static - * @param {google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId} UnmanagedDocumentId instance - */ - UnmanagedDocumentId.create = function create(properties) { - return new UnmanagedDocumentId(properties); - }; - - /** - * Encodes the specified UnmanagedDocumentId message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId - * @static - * @param {google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId} message UnmanagedDocumentId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UnmanagedDocumentId.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.docId != null && Object.hasOwnProperty.call(message, "docId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.docId); - return writer; - }; - - /** - * Encodes the specified UnmanagedDocumentId message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId - * @static - * @param {google.cloud.documentai.v1beta3.DocumentId.IUnmanagedDocumentId} message UnmanagedDocumentId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UnmanagedDocumentId.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UnmanagedDocumentId message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId} UnmanagedDocumentId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UnmanagedDocumentId.decode = function decode(reader, 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.v1beta3.DocumentId.UnmanagedDocumentId(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.docId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UnmanagedDocumentId message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId} UnmanagedDocumentId - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UnmanagedDocumentId.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UnmanagedDocumentId message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UnmanagedDocumentId.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.docId != null && message.hasOwnProperty("docId")) - if (!$util.isString(message.docId)) - return "docId: string expected"; - return null; - }; - - /** - * Creates an UnmanagedDocumentId message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId} UnmanagedDocumentId - */ - UnmanagedDocumentId.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId(); - if (object.docId != null) - message.docId = String(object.docId); - return message; - }; - - /** - * Creates a plain object from an UnmanagedDocumentId message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId - * @static - * @param {google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId} message UnmanagedDocumentId - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UnmanagedDocumentId.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.docId = ""; - if (message.docId != null && message.hasOwnProperty("docId")) - object.docId = message.docId; - return object; - }; - - /** - * Converts this UnmanagedDocumentId to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId - * @instance - * @returns {Object.} JSON object - */ - UnmanagedDocumentId.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UnmanagedDocumentId - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UnmanagedDocumentId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentId.UnmanagedDocumentId"; - }; - - return UnmanagedDocumentId; - })(); - - return DocumentId; - })(); - - v1beta3.DatasetSchema = (function() { - - /** - * Properties of a DatasetSchema. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDatasetSchema - * @property {string|null} [name] DatasetSchema name - * @property {google.cloud.documentai.v1beta3.IDocumentSchema|null} [documentSchema] DatasetSchema documentSchema - * @property {boolean|null} [satisfiesPzs] DatasetSchema satisfiesPzs - * @property {boolean|null} [satisfiesPzi] DatasetSchema satisfiesPzi - */ - - /** - * Constructs a new DatasetSchema. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DatasetSchema. - * @implements IDatasetSchema - * @constructor - * @param {google.cloud.documentai.v1beta3.IDatasetSchema=} [properties] Properties to set - */ - function DatasetSchema(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DatasetSchema name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @instance - */ - DatasetSchema.prototype.name = ""; - - /** - * DatasetSchema documentSchema. - * @member {google.cloud.documentai.v1beta3.IDocumentSchema|null|undefined} documentSchema - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @instance - */ - DatasetSchema.prototype.documentSchema = null; - - /** - * DatasetSchema satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @instance - */ - DatasetSchema.prototype.satisfiesPzs = false; - - /** - * DatasetSchema satisfiesPzi. - * @member {boolean} satisfiesPzi - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @instance - */ - DatasetSchema.prototype.satisfiesPzi = false; - - /** - * Creates a new DatasetSchema instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @static - * @param {google.cloud.documentai.v1beta3.IDatasetSchema=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DatasetSchema} DatasetSchema instance - */ - DatasetSchema.create = function create(properties) { - return new DatasetSchema(properties); - }; - - /** - * Encodes the specified DatasetSchema message. Does not implicitly {@link google.cloud.documentai.v1beta3.DatasetSchema.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @static - * @param {google.cloud.documentai.v1beta3.IDatasetSchema} message DatasetSchema message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatasetSchema.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.documentai.v1beta3.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.satisfiesPzs); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.satisfiesPzi); - return writer; - }; - - /** - * Encodes the specified DatasetSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DatasetSchema.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @static - * @param {google.cloud.documentai.v1beta3.IDatasetSchema} message DatasetSchema message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatasetSchema.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DatasetSchema message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DatasetSchema} DatasetSchema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatasetSchema.decode = function decode(reader, 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.v1beta3.DatasetSchema(); - 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.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.decode(reader, reader.uint32()); - break; - } - case 4: { - message.satisfiesPzs = reader.bool(); - break; - } - case 5: { - message.satisfiesPzi = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DatasetSchema message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DatasetSchema} DatasetSchema - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatasetSchema.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DatasetSchema message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DatasetSchema.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.documentai.v1beta3.DocumentSchema.verify(message.documentSchema); - if (error) - return "documentSchema." + error; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; - return null; - }; - - /** - * Creates a DatasetSchema message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DatasetSchema} DatasetSchema - */ - DatasetSchema.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DatasetSchema) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DatasetSchema(); - if (object.name != null) - message.name = String(object.name); - if (object.documentSchema != null) { - if (typeof object.documentSchema !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DatasetSchema.documentSchema: object expected"); - message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.fromObject(object.documentSchema); - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); - return message; - }; - - /** - * Creates a plain object from a DatasetSchema message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @static - * @param {google.cloud.documentai.v1beta3.DatasetSchema} message DatasetSchema - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DatasetSchema.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.documentSchema = null; - object.satisfiesPzs = false; - object.satisfiesPzi = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) - object.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.toObject(message.documentSchema, options); - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; - return object; - }; - - /** - * Converts this DatasetSchema to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @instance - * @returns {Object.} JSON object - */ - DatasetSchema.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DatasetSchema - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DatasetSchema - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DatasetSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DatasetSchema"; - }; - - return DatasetSchema; - })(); - - v1beta3.BatchDatasetDocuments = (function() { - - /** - * Properties of a BatchDatasetDocuments. - * @memberof google.cloud.documentai.v1beta3 - * @interface IBatchDatasetDocuments - * @property {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds|null} [individualDocumentIds] BatchDatasetDocuments individualDocumentIds - * @property {string|null} [filter] BatchDatasetDocuments filter - */ - - /** - * Constructs a new BatchDatasetDocuments. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a BatchDatasetDocuments. - * @implements IBatchDatasetDocuments - * @constructor - * @param {google.cloud.documentai.v1beta3.IBatchDatasetDocuments=} [properties] Properties to set - */ - function BatchDatasetDocuments(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDatasetDocuments individualDocumentIds. - * @member {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds|null|undefined} individualDocumentIds - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @instance - */ - BatchDatasetDocuments.prototype.individualDocumentIds = null; - - /** - * BatchDatasetDocuments filter. - * @member {string|null|undefined} filter - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @instance - */ - BatchDatasetDocuments.prototype.filter = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BatchDatasetDocuments criteria. - * @member {"individualDocumentIds"|"filter"|undefined} criteria - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @instance - */ - Object.defineProperty(BatchDatasetDocuments.prototype, "criteria", { - get: $util.oneOfGetter($oneOfFields = ["individualDocumentIds", "filter"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BatchDatasetDocuments instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDatasetDocuments=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments} BatchDatasetDocuments instance - */ - BatchDatasetDocuments.create = function create(properties) { - return new BatchDatasetDocuments(properties); - }; - - /** - * Encodes the specified BatchDatasetDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDatasetDocuments} message BatchDatasetDocuments message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDatasetDocuments.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.individualDocumentIds != null && Object.hasOwnProperty.call(message, "individualDocumentIds")) - $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.encode(message.individualDocumentIds, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - return writer; - }; - - /** - * Encodes the specified BatchDatasetDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDatasetDocuments} message BatchDatasetDocuments message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDatasetDocuments.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchDatasetDocuments message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments} BatchDatasetDocuments - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDatasetDocuments.decode = function decode(reader, 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.v1beta3.BatchDatasetDocuments(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.individualDocumentIds = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.decode(reader, reader.uint32()); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchDatasetDocuments message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments} BatchDatasetDocuments - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDatasetDocuments.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchDatasetDocuments message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDatasetDocuments.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.individualDocumentIds != null && message.hasOwnProperty("individualDocumentIds")) { - properties.criteria = 1; - { - var error = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.verify(message.individualDocumentIds); - if (error) - return "individualDocumentIds." + error; - } - } - if (message.filter != null && message.hasOwnProperty("filter")) { - if (properties.criteria === 1) - return "criteria: multiple values"; - properties.criteria = 1; - if (!$util.isString(message.filter)) - return "filter: string expected"; - } - return null; - }; - - /** - * Creates a BatchDatasetDocuments message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments} BatchDatasetDocuments - */ - BatchDatasetDocuments.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments) - return object; - var message = new $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments(); - if (object.individualDocumentIds != null) { - if (typeof object.individualDocumentIds !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchDatasetDocuments.individualDocumentIds: object expected"); - message.individualDocumentIds = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.fromObject(object.individualDocumentIds); - } - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a BatchDatasetDocuments message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @static - * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments} message BatchDatasetDocuments - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDatasetDocuments.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.individualDocumentIds != null && message.hasOwnProperty("individualDocumentIds")) { - object.individualDocumentIds = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.toObject(message.individualDocumentIds, options); - if (options.oneofs) - object.criteria = "individualDocumentIds"; - } - if (message.filter != null && message.hasOwnProperty("filter")) { - object.filter = message.filter; - if (options.oneofs) - object.criteria = "filter"; - } - return object; - }; - - /** - * Converts this BatchDatasetDocuments to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @instance - * @returns {Object.} JSON object - */ - BatchDatasetDocuments.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchDatasetDocuments - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchDatasetDocuments.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDatasetDocuments"; - }; - - BatchDatasetDocuments.IndividualDocumentIds = (function() { - - /** - * Properties of an IndividualDocumentIds. - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @interface IIndividualDocumentIds - * @property {Array.|null} [documentIds] IndividualDocumentIds documentIds - */ - - /** - * Constructs a new IndividualDocumentIds. - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments - * @classdesc Represents an IndividualDocumentIds. - * @implements IIndividualDocumentIds - * @constructor - * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds=} [properties] Properties to set - */ - function IndividualDocumentIds(properties) { - this.documentIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IndividualDocumentIds documentIds. - * @member {Array.} documentIds - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds - * @instance - */ - IndividualDocumentIds.prototype.documentIds = $util.emptyArray; - - /** - * Creates a new IndividualDocumentIds instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds - * @static - * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds} IndividualDocumentIds instance - */ - IndividualDocumentIds.create = function create(properties) { - return new IndividualDocumentIds(properties); - }; - - /** - * Encodes the specified IndividualDocumentIds message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds - * @static - * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds} message IndividualDocumentIds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualDocumentIds.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentIds != null && message.documentIds.length) - for (var i = 0; i < message.documentIds.length; ++i) - $root.google.cloud.documentai.v1beta3.DocumentId.encode(message.documentIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IndividualDocumentIds message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds - * @static - * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IIndividualDocumentIds} message IndividualDocumentIds message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualDocumentIds.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IndividualDocumentIds message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds} IndividualDocumentIds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualDocumentIds.decode = function decode(reader, 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.v1beta3.BatchDatasetDocuments.IndividualDocumentIds(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.documentIds && message.documentIds.length)) - message.documentIds = []; - message.documentIds.push($root.google.cloud.documentai.v1beta3.DocumentId.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IndividualDocumentIds message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds} IndividualDocumentIds - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualDocumentIds.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IndividualDocumentIds message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndividualDocumentIds.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentIds != null && message.hasOwnProperty("documentIds")) { - if (!Array.isArray(message.documentIds)) - return "documentIds: array expected"; - for (var i = 0; i < message.documentIds.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.DocumentId.verify(message.documentIds[i]); - if (error) - return "documentIds." + error; - } - } - return null; - }; - - /** - * Creates an IndividualDocumentIds message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds} IndividualDocumentIds - */ - IndividualDocumentIds.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds) - return object; - var message = new $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds(); - if (object.documentIds) { - if (!Array.isArray(object.documentIds)) - throw TypeError(".google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.documentIds: array expected"); - message.documentIds = []; - for (var i = 0; i < object.documentIds.length; ++i) { - if (typeof object.documentIds[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds.documentIds: object expected"); - message.documentIds[i] = $root.google.cloud.documentai.v1beta3.DocumentId.fromObject(object.documentIds[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an IndividualDocumentIds message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds - * @static - * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds} message IndividualDocumentIds - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndividualDocumentIds.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documentIds = []; - if (message.documentIds && message.documentIds.length) { - object.documentIds = []; - for (var j = 0; j < message.documentIds.length; ++j) - object.documentIds[j] = $root.google.cloud.documentai.v1beta3.DocumentId.toObject(message.documentIds[j], options); - } - return object; - }; - - /** - * Converts this IndividualDocumentIds to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds - * @instance - * @returns {Object.} JSON object - */ - IndividualDocumentIds.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IndividualDocumentIds - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndividualDocumentIds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDatasetDocuments.IndividualDocumentIds"; - }; - - return IndividualDocumentIds; - })(); - - return BatchDatasetDocuments; - })(); - - v1beta3.Document = (function() { - - /** - * Properties of a Document. - * @memberof google.cloud.documentai.v1beta3 - * @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.v1beta3.Document.IShardInfo|null} [shardInfo] Document shardInfo - * @property {google.rpc.IStatus|null} [error] Document error - * @property {Array.|null} [revisions] Document revisions - * @property {google.cloud.documentai.v1beta3.Document.IDocumentLayout|null} [documentLayout] Document documentLayout - * @property {google.cloud.documentai.v1beta3.Document.IChunkedDocument|null} [chunkedDocument] Document chunkedDocument - * @property {Array.|null} [blobAssets] Document blobAssets - * @property {google.cloud.documentai.v1beta3.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.v1beta3 - * @classdesc Represents a Document. - * @implements IDocument - * @constructor - * @param {google.cloud.documentai.v1beta3.IDocument=} [properties] Properties to set - */ - function Document(properties) { - this.textStyles = []; - this.pages = []; - this.entities = []; - this.entityRelations = []; - this.textChanges = []; - this.revisions = []; - this.blobAssets = []; - 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.v1beta3.Document - * @instance - */ - Document.prototype.uri = null; - - /** - * Document content. - * @member {Uint8Array|null|undefined} content - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.content = null; - - /** - * Document docid. - * @member {string} docid - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.docid = ""; - - /** - * Document mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.mimeType = ""; - - /** - * Document text. - * @member {string} text - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.text = ""; - - /** - * Document textStyles. - * @member {Array.} textStyles - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.textStyles = $util.emptyArray; - - /** - * Document pages. - * @member {Array.} pages - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.pages = $util.emptyArray; - - /** - * Document entities. - * @member {Array.} entities - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.entities = $util.emptyArray; - - /** - * Document entityRelations. - * @member {Array.} entityRelations - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.entityRelations = $util.emptyArray; - - /** - * Document textChanges. - * @member {Array.} textChanges - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.textChanges = $util.emptyArray; - - /** - * Document shardInfo. - * @member {google.cloud.documentai.v1beta3.Document.IShardInfo|null|undefined} shardInfo - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.shardInfo = null; - - /** - * Document error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.error = null; - - /** - * Document revisions. - * @member {Array.} revisions - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.revisions = $util.emptyArray; - - /** - * Document documentLayout. - * @member {google.cloud.documentai.v1beta3.Document.IDocumentLayout|null|undefined} documentLayout - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.documentLayout = null; - - /** - * Document chunkedDocument. - * @member {google.cloud.documentai.v1beta3.Document.IChunkedDocument|null|undefined} chunkedDocument - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.chunkedDocument = null; - - /** - * Document blobAssets. - * @member {Array.} blobAssets - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.blobAssets = $util.emptyArray; - - /** - * Document entityValidationOutput. - * @member {google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null|undefined} entityValidationOutput - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.entityValidationOutput = null; - - /** - * Document entitiesRevisions. - * @member {Array.} entitiesRevisions - * @memberof google.cloud.documentai.v1beta3.Document - * @instance - */ - Document.prototype.entitiesRevisions = $util.emptyArray; - - /** - * Document entitiesRevisionId. - * @member {string} entitiesRevisionId - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document - * @static - * @param {google.cloud.documentai.v1beta3.IDocument=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document} Document instance - */ - Document.create = function create(properties) { - return new Document(properties); - }; - - /** - * Encodes the specified Document message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.encode(message.chunkedDocument, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.blobAssets != null && message.blobAssets.length) - for (var i = 0; i < message.blobAssets.length; ++i) - $root.google.cloud.documentai.v1beta3.Document.BlobAsset.encode(message.blobAssets[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.entityValidationOutput != null && Object.hasOwnProperty.call(message, "entityValidationOutput")) - $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.pages && message.pages.length)) - message.pages = []; - message.pages.push($root.google.cloud.documentai.v1beta3.Document.Page.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.documentai.v1beta3.Document.Entity.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.entityRelations && message.entityRelations.length)) - message.entityRelations = []; - message.entityRelations.push($root.google.cloud.documentai.v1beta3.Document.EntityRelation.decode(reader, reader.uint32())); - break; - } - case 14: { - if (!(message.textChanges && message.textChanges.length)) - message.textChanges = []; - message.textChanges.push($root.google.cloud.documentai.v1beta3.Document.TextChange.decode(reader, reader.uint32())); - break; - } - case 9: { - message.shardInfo = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.decode(reader, reader.uint32())); - break; - } - case 17: { - message.documentLayout = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.decode(reader, reader.uint32()); - break; - } - case 18: { - message.chunkedDocument = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.decode(reader, reader.uint32()); - break; - } - case 19: { - if (!(message.blobAssets && message.blobAssets.length)) - message.blobAssets = []; - message.blobAssets.push($root.google.cloud.documentai.v1beta3.Document.BlobAsset.decode(reader, reader.uint32())); - break; - } - case 21: { - message.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.decode(reader, reader.uint32()); - break; - } - case 22: { - if (!(message.entitiesRevisions && message.entitiesRevisions.length)) - message.entitiesRevisions = []; - message.entitiesRevisions.push($root.google.cloud.documentai.v1beta3.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.v1beta3.Document - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextChange.verify(message.textChanges[i]); - if (error) - return "textChanges." + error; - } - } - if (message.shardInfo != null && message.hasOwnProperty("shardInfo")) { - var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.verify(message.revisions[i]); - if (error) - return "revisions." + error; - } - } - if (message.documentLayout != null && message.hasOwnProperty("documentLayout")) { - var error = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.verify(message.documentLayout); - if (error) - return "documentLayout." + error; - } - if (message.chunkedDocument != null && message.hasOwnProperty("chunkedDocument")) { - var error = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.verify(message.chunkedDocument); - if (error) - return "chunkedDocument." + error; - } - if (message.blobAssets != null && message.hasOwnProperty("blobAssets")) { - if (!Array.isArray(message.blobAssets)) - return "blobAssets: array expected"; - for (var i = 0; i < message.blobAssets.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.Document.BlobAsset.verify(message.blobAssets[i]); - if (error) - return "blobAssets." + error; - } - } - if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) { - var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document} Document - */ - Document.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.textStyles: object expected"); - message.textStyles[i] = $root.google.cloud.documentai.v1beta3.Document.Style.fromObject(object.textStyles[i]); - } - } - if (object.pages) { - if (!Array.isArray(object.pages)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.pages: object expected"); - message.pages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.fromObject(object.pages[i]); - } - } - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.entities: object expected"); - message.entities[i] = $root.google.cloud.documentai.v1beta3.Document.Entity.fromObject(object.entities[i]); - } - } - if (object.entityRelations) { - if (!Array.isArray(object.entityRelations)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.entityRelations: object expected"); - message.entityRelations[i] = $root.google.cloud.documentai.v1beta3.Document.EntityRelation.fromObject(object.entityRelations[i]); - } - } - if (object.textChanges) { - if (!Array.isArray(object.textChanges)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.textChanges: object expected"); - message.textChanges[i] = $root.google.cloud.documentai.v1beta3.Document.TextChange.fromObject(object.textChanges[i]); - } - } - if (object.shardInfo != null) { - if (typeof object.shardInfo !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.shardInfo: object expected"); - message.shardInfo = $root.google.cloud.documentai.v1beta3.Document.ShardInfo.fromObject(object.shardInfo); - } - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.revisions: object expected"); - message.revisions[i] = $root.google.cloud.documentai.v1beta3.Document.Revision.fromObject(object.revisions[i]); - } - } - if (object.documentLayout != null) { - if (typeof object.documentLayout !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.documentLayout: object expected"); - message.documentLayout = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.fromObject(object.documentLayout); - } - if (object.chunkedDocument != null) { - if (typeof object.chunkedDocument !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.chunkedDocument: object expected"); - message.chunkedDocument = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.fromObject(object.chunkedDocument); - } - if (object.blobAssets) { - if (!Array.isArray(object.blobAssets)) - throw TypeError(".google.cloud.documentai.v1beta3.Document.blobAssets: array expected"); - message.blobAssets = []; - for (var i = 0; i < object.blobAssets.length; ++i) { - if (typeof object.blobAssets[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.blobAssets: object expected"); - message.blobAssets[i] = $root.google.cloud.documentai.v1beta3.Document.BlobAsset.fromObject(object.blobAssets[i]); - } - } - if (object.entityValidationOutput != null) { - if (typeof object.entityValidationOutput !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.entityValidationOutput: object expected"); - message.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.fromObject(object.entityValidationOutput); - } - if (object.entitiesRevisions) { - if (!Array.isArray(object.entitiesRevisions)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.entitiesRevisions: object expected"); - message.entitiesRevisions[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document - * @static - * @param {google.cloud.documentai.v1beta3.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.blobAssets = []; - 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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityRelation.toObject(message.entityRelations[j], options); - } - if (message.shardInfo != null && message.hasOwnProperty("shardInfo")) - object.shardInfo = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.toObject(message.documentLayout, options); - if (message.chunkedDocument != null && message.hasOwnProperty("chunkedDocument")) - object.chunkedDocument = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.toObject(message.chunkedDocument, options); - if (message.blobAssets && message.blobAssets.length) { - object.blobAssets = []; - for (var j = 0; j < message.blobAssets.length; ++j) - object.blobAssets[j] = $root.google.cloud.documentai.v1beta3.Document.BlobAsset.toObject(message.blobAssets[j], options); - } - if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) - object.entityValidationOutput = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document"; - }; - - Document.ShardInfo = (function() { - - /** - * Properties of a ShardInfo. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document - * @classdesc Represents a ShardInfo. - * @implements IShardInfo - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ShardInfo - * @static - * @param {google.cloud.documentai.v1beta3.Document.IShardInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.ShardInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ShardInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ShardInfo - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ShardInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ShardInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.ShardInfo} ShardInfo - */ - ShardInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ShardInfo) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ShardInfo - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ShardInfo"; - }; - - return ShardInfo; - })(); - - Document.Style = (function() { - - /** - * Properties of a Style. - * @memberof google.cloud.documentai.v1beta3.Document - * @interface IStyle - * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.IFontSize|null} [fontSize] Style fontSize - * @property {string|null} [fontFamily] Style fontFamily - */ - - /** - * Constructs a new Style. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents a Style. - * @implements IStyle - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextAnchor|null|undefined} textAnchor - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @instance - */ - Style.prototype.textAnchor = null; - - /** - * Style color. - * @member {google.type.IColor|null|undefined} color - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @instance - */ - Style.prototype.color = null; - - /** - * Style backgroundColor. - * @member {google.type.IColor|null|undefined} backgroundColor - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @instance - */ - Style.prototype.backgroundColor = null; - - /** - * Style fontWeight. - * @member {string} fontWeight - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @instance - */ - Style.prototype.fontWeight = ""; - - /** - * Style textStyle. - * @member {string} textStyle - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @instance - */ - Style.prototype.textStyle = ""; - - /** - * Style textDecoration. - * @member {string} textDecoration - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @instance - */ - Style.prototype.textDecoration = ""; - - /** - * Style fontSize. - * @member {google.cloud.documentai.v1beta3.Document.Style.IFontSize|null|undefined} fontSize - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @instance - */ - Style.prototype.fontSize = null; - - /** - * Style fontFamily. - * @member {string} fontFamily - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @instance - */ - Style.prototype.fontFamily = ""; - - /** - * Creates a new Style instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @static - * @param {google.cloud.documentai.v1beta3.Document.IStyle=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Style} Style - */ - Style.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Style) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Style(); - if (object.textAnchor != null) { - if (typeof object.textAnchor !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Style.textAnchor: object expected"); - message.textAnchor = $root.google.cloud.documentai.v1beta3.Document.TextAnchor.fromObject(object.textAnchor); - } - if (object.color != null) { - if (typeof object.color !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Style.fontSize: object expected"); - message.fontSize = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Style - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style"; - }; - - Style.FontSize = (function() { - - /** - * Properties of a FontSize. - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @interface IFontSize - * @property {number|null} [size] FontSize size - * @property {string|null} [unit] FontSize unit - */ - - /** - * Constructs a new FontSize. - * @memberof google.cloud.documentai.v1beta3.Document.Style - * @classdesc Represents a FontSize. - * @implements IFontSize - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.FontSize - * @instance - */ - FontSize.prototype.size = 0; - - /** - * FontSize unit. - * @member {string} unit - * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize - * @instance - */ - FontSize.prototype.unit = ""; - - /** - * Creates a new FontSize instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize - * @static - * @param {google.cloud.documentai.v1beta3.Document.Style.IFontSize=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.FontSize.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.FontSize.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Style.FontSize - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style.FontSize - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Style.FontSize - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Style.FontSize} FontSize - */ - FontSize.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Style.FontSize) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Style.FontSize - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Style.FontSize"; - }; - - return FontSize; - })(); - - return Style; - })(); - - Document.Page = (function() { - - /** - * Properties of a Page. - * @memberof google.cloud.documentai.v1beta3.Document - * @interface IPage - * @property {number|null} [pageNumber] Page pageNumber - * @property {google.cloud.documentai.v1beta3.Document.Page.IImage|null} [image] Page image - * @property {Array.|null} [transforms] Page transforms - * @property {google.cloud.documentai.v1beta3.Document.Page.IDimension|null} [dimension] Page dimension - * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.IImageQualityScores|null} [imageQualityScores] Page imageQualityScores - * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] Page provenance - */ - - /** - * Constructs a new Page. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents a Page. - * @implements IPage - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page - * @instance - */ - Page.prototype.pageNumber = 0; - - /** - * Page image. - * @member {google.cloud.documentai.v1beta3.Document.Page.IImage|null|undefined} image - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.image = null; - - /** - * Page transforms. - * @member {Array.} transforms - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.transforms = $util.emptyArray; - - /** - * Page dimension. - * @member {google.cloud.documentai.v1beta3.Document.Page.IDimension|null|undefined} dimension - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.dimension = null; - - /** - * Page layout. - * @member {google.cloud.documentai.v1beta3.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.layout = null; - - /** - * Page detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.detectedLanguages = $util.emptyArray; - - /** - * Page blocks. - * @member {Array.} blocks - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.blocks = $util.emptyArray; - - /** - * Page paragraphs. - * @member {Array.} paragraphs - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.paragraphs = $util.emptyArray; - - /** - * Page lines. - * @member {Array.} lines - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.lines = $util.emptyArray; - - /** - * Page tokens. - * @member {Array.} tokens - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.tokens = $util.emptyArray; - - /** - * Page visualElements. - * @member {Array.} visualElements - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.visualElements = $util.emptyArray; - - /** - * Page tables. - * @member {Array.} tables - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.tables = $util.emptyArray; - - /** - * Page formFields. - * @member {Array.} formFields - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.formFields = $util.emptyArray; - - /** - * Page symbols. - * @member {Array.} symbols - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.symbols = $util.emptyArray; - - /** - * Page detectedBarcodes. - * @member {Array.} detectedBarcodes - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.detectedBarcodes = $util.emptyArray; - - /** - * Page imageQualityScores. - * @member {google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores|null|undefined} imageQualityScores - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.imageQualityScores = null; - - /** - * Page provenance. - * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @instance - */ - Page.prototype.provenance = null; - - /** - * Creates a new Page instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @static - * @param {google.cloud.documentai.v1beta3.Document.IPage=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Matrix.decode(reader, reader.uint32())); - break; - } - case 2: { - message.dimension = $root.google.cloud.documentai.v1beta3.Document.Page.Dimension.decode(reader, reader.uint32()); - break; - } - case 3: { - message.layout = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedBarcode.decode(reader, reader.uint32())); - break; - } - case 17: { - message.imageQualityScores = $root.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.decode(reader, reader.uint32()); - break; - } - case 16: { - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Dimension.verify(message.dimension); - if (error) - return "dimension." + error; - } - if (message.layout != null && message.hasOwnProperty("layout")) { - var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.verify(message.imageQualityScores); - if (error) - return "imageQualityScores." + error; - } - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page} Page - */ - Page.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.image: object expected"); - message.image = $root.google.cloud.documentai.v1beta3.Document.Page.Image.fromObject(object.image); - } - if (object.transforms) { - if (!Array.isArray(object.transforms)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.transforms: object expected"); - message.transforms[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Matrix.fromObject(object.transforms[i]); - } - } - if (object.dimension != null) { - if (typeof object.dimension !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.dimension: object expected"); - message.dimension = $root.google.cloud.documentai.v1beta3.Document.Page.Dimension.fromObject(object.dimension); - } - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - if (object.blocks) { - if (!Array.isArray(object.blocks)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.blocks: object expected"); - message.blocks[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Block.fromObject(object.blocks[i]); - } - } - if (object.paragraphs) { - if (!Array.isArray(object.paragraphs)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.paragraphs: object expected"); - message.paragraphs[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Paragraph.fromObject(object.paragraphs[i]); - } - } - if (object.lines) { - if (!Array.isArray(object.lines)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.lines: object expected"); - message.lines[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Line.fromObject(object.lines[i]); - } - } - if (object.tokens) { - if (!Array.isArray(object.tokens)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.tokens: object expected"); - message.tokens[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Token.fromObject(object.tokens[i]); - } - } - if (object.visualElements) { - if (!Array.isArray(object.visualElements)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.visualElements: object expected"); - message.visualElements[i] = $root.google.cloud.documentai.v1beta3.Document.Page.VisualElement.fromObject(object.visualElements[i]); - } - } - if (object.tables) { - if (!Array.isArray(object.tables)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.tables: object expected"); - message.tables[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Table.fromObject(object.tables[i]); - } - } - if (object.formFields) { - if (!Array.isArray(object.formFields)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.formFields: object expected"); - message.formFields[i] = $root.google.cloud.documentai.v1beta3.Document.Page.FormField.fromObject(object.formFields[i]); - } - } - if (object.symbols) { - if (!Array.isArray(object.symbols)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.symbols: object expected"); - message.symbols[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Symbol.fromObject(object.symbols[i]); - } - } - if (object.detectedBarcodes) { - if (!Array.isArray(object.detectedBarcodes)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.detectedBarcodes: object expected"); - message.detectedBarcodes[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.fromObject(object.detectedBarcodes[i]); - } - } - if (object.imageQualityScores != null) { - if (typeof object.imageQualityScores !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.imageQualityScores: object expected"); - message.imageQualityScores = $root.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.fromObject(object.imageQualityScores); - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Dimension.toObject(message.dimension, options); - if (message.layout != null && message.hasOwnProperty("layout")) - object.layout = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Symbol.toObject(message.symbols[j], options); - } - if (message.image != null && message.hasOwnProperty("image")) - object.image = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedBarcode.toObject(message.detectedBarcodes[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); - if (message.imageQualityScores != null && message.hasOwnProperty("imageQualityScores")) - object.imageQualityScores = $root.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.toObject(message.imageQualityScores, options); - return object; - }; - - /** - * Converts this Page to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page"; - }; - - Page.Dimension = (function() { - - /** - * Properties of a Dimension. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page - * @classdesc Represents a Dimension. - * @implements IDimension - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Dimension - * @instance - */ - Dimension.prototype.width = 0; - - /** - * Dimension height. - * @member {number} height - * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension - * @instance - */ - Dimension.prototype.height = 0; - - /** - * Dimension unit. - * @member {string} unit - * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension - * @instance - */ - Dimension.prototype.unit = ""; - - /** - * Creates a new Dimension instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IDimension=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Dimension.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Dimension.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Dimension - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Dimension - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Dimension - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Dimension} Dimension - */ - Dimension.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Dimension) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Dimension - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Dimension"; - }; - - return Dimension; - })(); - - Page.Image = (function() { - - /** - * Properties of an Image. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page - * @classdesc Represents an Image. - * @implements IImage - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Image - * @instance - */ - Image.prototype.content = $util.newBuffer([]); - - /** - * Image mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1beta3.Document.Page.Image - * @instance - */ - Image.prototype.mimeType = ""; - - /** - * Image width. - * @member {number} width - * @memberof google.cloud.documentai.v1beta3.Document.Page.Image - * @instance - */ - Image.prototype.width = 0; - - /** - * Image height. - * @member {number} height - * @memberof google.cloud.documentai.v1beta3.Document.Page.Image - * @instance - */ - Image.prototype.height = 0; - - /** - * Creates a new Image instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.Image - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IImage=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Image.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Image - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Image.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Image - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Image - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Image} Image - */ - Image.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Image) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Image - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Image"; - }; - - return Image; - })(); - - Page.Matrix = (function() { - - /** - * Properties of a Matrix. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page - * @classdesc Represents a Matrix. - * @implements IMatrix - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Matrix - * @instance - */ - Matrix.prototype.rows = 0; - - /** - * Matrix cols. - * @member {number} cols - * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix - * @instance - */ - Matrix.prototype.cols = 0; - - /** - * Matrix type. - * @member {number} type - * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix - * @instance - */ - Matrix.prototype.type = 0; - - /** - * Matrix data. - * @member {Uint8Array} data - * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix - * @instance - */ - Matrix.prototype.data = $util.newBuffer([]); - - /** - * Creates a new Matrix instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IMatrix=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Matrix.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Matrix.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Matrix - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Matrix - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Matrix - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Matrix} Matrix - */ - Matrix.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Matrix) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Matrix - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Matrix"; - }; - - return Matrix; - })(); - - Page.Layout = (function() { - - /** - * Properties of a Layout. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @interface ILayout - * @property {google.cloud.documentai.v1beta3.Document.ITextAnchor|null} [textAnchor] Layout textAnchor - * @property {number|null} [confidence] Layout confidence - * @property {google.cloud.documentai.v1beta3.IBoundingPoly|null} [boundingPoly] Layout boundingPoly - * @property {google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation|null} [orientation] Layout orientation - */ - - /** - * Constructs a new Layout. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents a Layout. - * @implements ILayout - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextAnchor|null|undefined} textAnchor - * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout - * @instance - */ - Layout.prototype.textAnchor = null; - - /** - * Layout confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout - * @instance - */ - Layout.prototype.confidence = 0; - - /** - * Layout boundingPoly. - * @member {google.cloud.documentai.v1beta3.IBoundingPoly|null|undefined} boundingPoly - * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout - * @instance - */ - Layout.prototype.boundingPoly = null; - - /** - * Layout orientation. - * @member {google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation} orientation - * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout - * @instance - */ - Layout.prototype.orientation = 0; - - /** - * Creates a new Layout instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.ILayout=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Layout - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.decode(reader, reader.uint32()); - break; - } - case 2: { - message.confidence = reader.float(); - break; - } - case 3: { - message.boundingPoly = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Layout} Layout - */ - Layout.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Layout) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Layout(); - if (object.textAnchor != null) { - if (typeof object.textAnchor !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Layout.textAnchor: object expected"); - message.textAnchor = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout.boundingPoly: object expected"); - message.boundingPoly = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.BoundingPoly.toObject(message.boundingPoly, options); - if (message.orientation != null && message.hasOwnProperty("orientation")) - object.orientation = options.enums === String ? $root.google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation[message.orientation] === undefined ? message.orientation : $root.google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation[message.orientation] : message.orientation; - return object; - }; - - /** - * Converts this Layout to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout"; - }; - - /** - * Orientation enum. - * @name google.cloud.documentai.v1beta3.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.v1beta3.Document.Page - * @interface IBlock - * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [layout] Block layout - * @property {Array.|null} [detectedLanguages] Block detectedLanguages - * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] Block provenance - */ - - /** - * Constructs a new Block. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents a Block. - * @implements IBlock - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1beta3.Document.Page.Block - * @instance - */ - Block.prototype.layout = null; - - /** - * Block detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Block - * @instance - */ - Block.prototype.detectedLanguages = $util.emptyArray; - - /** - * Block provenance. - * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1beta3.Document.Page.Block - * @instance - */ - Block.prototype.provenance = null; - - /** - * Creates a new Block instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.Block - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IBlock=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Block.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Block - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Block.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Block - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 3: { - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Block - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Block - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Block} Block - */ - Block.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Block) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Block(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Block.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Block.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Block.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Block - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); - return object; - }; - - /** - * Converts this Block to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Block"; - }; - - return Block; - })(); - - Page.Paragraph = (function() { - - /** - * Properties of a Paragraph. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @interface IParagraph - * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [layout] Paragraph layout - * @property {Array.|null} [detectedLanguages] Paragraph detectedLanguages - * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] Paragraph provenance - */ - - /** - * Constructs a new Paragraph. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents a Paragraph. - * @implements IParagraph - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph - * @instance - */ - Paragraph.prototype.layout = null; - - /** - * Paragraph detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph - * @instance - */ - Paragraph.prototype.detectedLanguages = $util.emptyArray; - - /** - * Paragraph provenance. - * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph - * @instance - */ - Paragraph.prototype.provenance = null; - - /** - * Creates a new Paragraph instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IParagraph=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Paragraph.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Paragraph.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Paragraph - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 3: { - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Paragraph - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Paragraph - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Paragraph} Paragraph - */ - Paragraph.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Paragraph) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Paragraph(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Paragraph.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Paragraph.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Paragraph.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Paragraph - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); - return object; - }; - - /** - * Converts this Paragraph to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Paragraph"; - }; - - return Paragraph; - })(); - - Page.Line = (function() { - - /** - * Properties of a Line. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @interface ILine - * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [layout] Line layout - * @property {Array.|null} [detectedLanguages] Line detectedLanguages - * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] Line provenance - */ - - /** - * Constructs a new Line. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents a Line. - * @implements ILine - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1beta3.Document.Page.Line - * @instance - */ - Line.prototype.layout = null; - - /** - * Line detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Line - * @instance - */ - Line.prototype.detectedLanguages = $util.emptyArray; - - /** - * Line provenance. - * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1beta3.Document.Page.Line - * @instance - */ - Line.prototype.provenance = null; - - /** - * Creates a new Line instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.Line - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.ILine=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Line.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Line - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Line.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Line - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 3: { - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Line - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Line - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Line} Line - */ - Line.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Line) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Line(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Line.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Line.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Line.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Line - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); - return object; - }; - - /** - * Converts this Line to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Line"; - }; - - return Line; - })(); - - Page.Token = (function() { - - /** - * Properties of a Token. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @interface IToken - * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [layout] Token layout - * @property {google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak|null} [detectedBreak] Token detectedBreak - * @property {Array.|null} [detectedLanguages] Token detectedLanguages - * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] Token provenance - * @property {google.cloud.documentai.v1beta3.Document.Page.Token.IStyleInfo|null} [styleInfo] Token styleInfo - */ - - /** - * Constructs a new Token. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents a Token. - * @implements IToken - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token - * @instance - */ - Token.prototype.layout = null; - - /** - * Token detectedBreak. - * @member {google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak|null|undefined} detectedBreak - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token - * @instance - */ - Token.prototype.detectedBreak = null; - - /** - * Token detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token - * @instance - */ - Token.prototype.detectedLanguages = $util.emptyArray; - - /** - * Token provenance. - * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token - * @instance - */ - Token.prototype.provenance = null; - - /** - * Token styleInfo. - * @member {google.cloud.documentai.v1beta3.Document.Page.Token.IStyleInfo|null|undefined} styleInfo - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token - * @instance - */ - Token.prototype.styleInfo = null; - - /** - * Creates a new Token instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IToken=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - message.detectedBreak = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 4: { - message.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.decode(reader, reader.uint32()); - break; - } - case 5: { - message.styleInfo = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.verify(message.layout); - if (error) - return "layout." + error; - } - if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) { - var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.verify(message.provenance); - if (error) - return "provenance." + error; - } - if (message.styleInfo != null && message.hasOwnProperty("styleInfo")) { - var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Token} Token - */ - Token.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Token) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Token(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Token.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); - } - if (object.detectedBreak != null) { - if (typeof object.detectedBreak !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Token.detectedBreak: object expected"); - message.detectedBreak = $root.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.fromObject(object.detectedBreak); - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Token.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.fromObject(object.provenance); - } - if (object.styleInfo != null) { - if (typeof object.styleInfo !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Token.styleInfo: object expected"); - message.styleInfo = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout.toObject(message.layout, options); - if (message.detectedBreak != null && message.hasOwnProperty("detectedBreak")) - object.detectedBreak = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); - if (message.styleInfo != null && message.hasOwnProperty("styleInfo")) - object.styleInfo = $root.google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo.toObject(message.styleInfo, options); - return object; - }; - - /** - * Converts this Token to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token"; - }; - - Token.DetectedBreak = (function() { - - /** - * Properties of a DetectedBreak. - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token - * @interface IDetectedBreak - * @property {google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type|null} [type] DetectedBreak type - */ - - /** - * Constructs a new DetectedBreak. - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token - * @classdesc Represents a DetectedBreak. - * @implements IDetectedBreak - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak.Type} type - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak - * @instance - */ - DetectedBreak.prototype.type = 0; - - /** - * Creates a new DetectedBreak instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.Token.IDetectedBreak=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak} DetectedBreak - */ - DetectedBreak.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak.Type[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type[message.type] : message.type; - return object; - }; - - /** - * Converts this DetectedBreak to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.DetectedBreak"; - }; - - /** - * Type enum. - * @name google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token - * @classdesc Represents a StyleInfo. - * @implements IStyleInfo - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.fontSize = 0; - - /** - * StyleInfo pixelFontSize. - * @member {number} pixelFontSize - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.pixelFontSize = 0; - - /** - * StyleInfo letterSpacing. - * @member {number} letterSpacing - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.letterSpacing = 0; - - /** - * StyleInfo fontType. - * @member {string} fontType - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.fontType = ""; - - /** - * StyleInfo bold. - * @member {boolean} bold - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.bold = false; - - /** - * StyleInfo italic. - * @member {boolean} italic - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.italic = false; - - /** - * StyleInfo underlined. - * @member {boolean} underlined - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.underlined = false; - - /** - * StyleInfo strikeout. - * @member {boolean} strikeout - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.strikeout = false; - - /** - * StyleInfo subscript. - * @member {boolean} subscript - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.subscript = false; - - /** - * StyleInfo superscript. - * @member {boolean} superscript - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.superscript = false; - - /** - * StyleInfo smallcaps. - * @member {boolean} smallcaps - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.smallcaps = false; - - /** - * StyleInfo fontWeight. - * @member {number} fontWeight - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.fontWeight = 0; - - /** - * StyleInfo handwritten. - * @member {boolean} handwritten - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.handwritten = false; - - /** - * StyleInfo textColor. - * @member {google.type.IColor|null|undefined} textColor - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.textColor = null; - - /** - * StyleInfo backgroundColor. - * @member {google.type.IColor|null|undefined} backgroundColor - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @instance - */ - StyleInfo.prototype.backgroundColor = null; - - /** - * Creates a new StyleInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.Token.IStyleInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo} StyleInfo - */ - StyleInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Token.StyleInfo"; - }; - - return StyleInfo; - })(); - - return Token; - })(); - - Page.Symbol = (function() { - - /** - * Properties of a Symbol. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @interface ISymbol - * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [layout] Symbol layout - * @property {Array.|null} [detectedLanguages] Symbol detectedLanguages - */ - - /** - * Constructs a new Symbol. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents a Symbol. - * @implements ISymbol - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1beta3.Document.Page.Symbol - * @instance - */ - Symbol.prototype.layout = null; - - /** - * Symbol detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Symbol - * @instance - */ - Symbol.prototype.detectedLanguages = $util.emptyArray; - - /** - * Creates a new Symbol instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.Symbol - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.ISymbol=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Symbol.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Symbol - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Symbol.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Symbol - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Symbol - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Symbol - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Symbol} Symbol - */ - Symbol.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Symbol) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Symbol(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Symbol.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Symbol.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Symbol - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - return object; - }; - - /** - * Converts this Symbol to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Symbol"; - }; - - return Symbol; - })(); - - Page.VisualElement = (function() { - - /** - * Properties of a VisualElement. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @interface IVisualElement - * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page - * @classdesc Represents a VisualElement. - * @implements IVisualElement - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement - * @instance - */ - VisualElement.prototype.layout = null; - - /** - * VisualElement type. - * @member {string} type - * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement - * @instance - */ - VisualElement.prototype.type = ""; - - /** - * VisualElement detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement - * @instance - */ - VisualElement.prototype.detectedLanguages = $util.emptyArray; - - /** - * Creates a new VisualElement instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IVisualElement=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.VisualElement.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.VisualElement.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.VisualElement - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.VisualElement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.VisualElement - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.VisualElement} VisualElement - */ - VisualElement.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.VisualElement) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Page.VisualElement(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.VisualElement.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.VisualElement.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.VisualElement - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - return object; - }; - - /** - * Converts this VisualElement to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.VisualElement"; - }; - - return VisualElement; - })(); - - Page.Table = (function() { - - /** - * Properties of a Table. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @interface ITable - * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.IProvenance|null} [provenance] Table provenance - */ - - /** - * Constructs a new Table. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents a Table. - * @implements ITable - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @instance - */ - Table.prototype.layout = null; - - /** - * Table headerRows. - * @member {Array.} headerRows - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @instance - */ - Table.prototype.headerRows = $util.emptyArray; - - /** - * Table bodyRows. - * @member {Array.} bodyRows - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @instance - */ - Table.prototype.bodyRows = $util.emptyArray; - - /** - * Table detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @instance - */ - Table.prototype.detectedLanguages = $util.emptyArray; - - /** - * Table provenance. - * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @instance - */ - Table.prototype.provenance = null; - - /** - * Creates a new Table instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.ITable=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.decode(reader, reader.uint32())); - break; - } - case 5: { - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Table} Table - */ - Table.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Table) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Table(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Table.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); - } - if (object.headerRows) { - if (!Array.isArray(object.headerRows)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.headerRows: object expected"); - message.headerRows[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow.fromObject(object.headerRows[i]); - } - } - if (object.bodyRows) { - if (!Array.isArray(object.bodyRows)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.bodyRows: object expected"); - message.bodyRows[i] = $root.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow.fromObject(object.bodyRows[i]); - } - } - if (object.detectedLanguages) { - if (!Array.isArray(object.detectedLanguages)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.detectedLanguages[i]); - } - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Table.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); - return object; - }; - - /** - * Converts this Table to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table"; - }; - - Table.TableRow = (function() { - - /** - * Properties of a TableRow. - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @interface ITableRow - * @property {Array.|null} [cells] TableRow cells - */ - - /** - * Constructs a new TableRow. - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @classdesc Represents a TableRow. - * @implements ITableRow - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableRow - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.Table.ITableRow=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableRow.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableRow - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableRow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableRow - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableRow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Table.TableRow} TableRow - */ - TableRow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Table.TableRow(); - if (object.cells) { - if (!Array.isArray(object.cells)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableRow.cells: object expected"); - message.cells[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableRow - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableCell.toObject(message.cells[j], options); - } - return object; - }; - - /** - * Converts this TableRow to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableRow"; - }; - - return TableRow; - })(); - - Table.TableCell = (function() { - - /** - * Properties of a TableCell. - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table - * @interface ITableCell - * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table - * @classdesc Represents a TableCell. - * @implements ITableCell - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell - * @instance - */ - TableCell.prototype.layout = null; - - /** - * TableCell rowSpan. - * @member {number} rowSpan - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell - * @instance - */ - TableCell.prototype.rowSpan = 0; - - /** - * TableCell colSpan. - * @member {number} colSpan - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell - * @instance - */ - TableCell.prototype.colSpan = 0; - - /** - * TableCell detectedLanguages. - * @member {Array.} detectedLanguages - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableCell - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.Table.ITableCell=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableCell.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableCell.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.Table.TableCell - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableCell - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableCell - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.Table.TableCell} TableCell - */ - TableCell.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.Table.TableCell) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Table.TableCell(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.Table.TableCell.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableCell.detectedLanguages: object expected"); - message.detectedLanguages[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Table.TableCell - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.toObject(message.detectedLanguages[j], options); - } - return object; - }; - - /** - * Converts this TableCell to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Table.TableCell"; - }; - - return TableCell; - })(); - - return Table; - })(); - - Page.FormField = (function() { - - /** - * Properties of a FormField. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @interface IFormField - * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [fieldName] FormField fieldName - * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.IProvenance|null} [provenance] FormField provenance - */ - - /** - * Constructs a new FormField. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents a FormField. - * @implements IFormField - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} fieldName - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField - * @instance - */ - FormField.prototype.fieldName = null; - - /** - * FormField fieldValue. - * @member {google.cloud.documentai.v1beta3.Document.Page.ILayout|null|undefined} fieldValue - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField - * @instance - */ - FormField.prototype.fieldValue = null; - - /** - * FormField nameDetectedLanguages. - * @member {Array.} nameDetectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField - * @instance - */ - FormField.prototype.nameDetectedLanguages = $util.emptyArray; - - /** - * FormField valueDetectedLanguages. - * @member {Array.} valueDetectedLanguages - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField - * @instance - */ - FormField.prototype.valueDetectedLanguages = $util.emptyArray; - - /** - * FormField valueType. - * @member {string} valueType - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField - * @instance - */ - FormField.prototype.valueType = ""; - - /** - * FormField correctedKeyText. - * @member {string} correctedKeyText - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField - * @instance - */ - FormField.prototype.correctedKeyText = ""; - - /** - * FormField correctedValueText. - * @member {string} correctedValueText - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField - * @instance - */ - FormField.prototype.correctedValueText = ""; - - /** - * FormField provenance. - * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField - * @instance - */ - FormField.prototype.provenance = null; - - /** - * Creates a new FormField instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IFormField=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.FormField.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.FormField.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.FormField - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - message.fieldValue = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.FormField - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.verify(message.fieldName); - if (error) - return "fieldName." + error; - } - if (message.fieldValue != null && message.hasOwnProperty("fieldValue")) { - var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.FormField - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.FormField} FormField - */ - FormField.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.FormField) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Page.FormField(); - if (object.fieldName != null) { - if (typeof object.fieldName !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.FormField.fieldName: object expected"); - message.fieldName = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.fieldName); - } - if (object.fieldValue != null) { - if (typeof object.fieldValue !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.FormField.fieldValue: object expected"); - message.fieldValue = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.fieldValue); - } - if (object.nameDetectedLanguages) { - if (!Array.isArray(object.nameDetectedLanguages)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.FormField.nameDetectedLanguages: object expected"); - message.nameDetectedLanguages[i] = $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage.fromObject(object.nameDetectedLanguages[i]); - } - } - if (object.valueDetectedLanguages) { - if (!Array.isArray(object.valueDetectedLanguages)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.FormField.valueDetectedLanguages: object expected"); - message.valueDetectedLanguages[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.FormField.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.FormField - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout.toObject(message.fieldName, options); - if (message.fieldValue != null && message.hasOwnProperty("fieldValue")) - object.fieldValue = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.toObject(message.provenance, options); - return object; - }; - - /** - * Converts this FormField to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.FormField"; - }; - - return FormField; - })(); - - Page.DetectedBarcode = (function() { - - /** - * Properties of a DetectedBarcode. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @interface IDetectedBarcode - * @property {google.cloud.documentai.v1beta3.Document.Page.ILayout|null} [layout] DetectedBarcode layout - * @property {google.cloud.documentai.v1beta3.IBarcode|null} [barcode] DetectedBarcode barcode - */ - - /** - * Constructs a new DetectedBarcode. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents a DetectedBarcode. - * @implements IDetectedBarcode - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ILayout|null|undefined} layout - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode - * @instance - */ - DetectedBarcode.prototype.layout = null; - - /** - * DetectedBarcode barcode. - * @member {google.cloud.documentai.v1beta3.IBarcode|null|undefined} barcode - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode - * @instance - */ - DetectedBarcode.prototype.barcode = null; - - /** - * Creates a new DetectedBarcode instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IDetectedBarcode=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedBarcode.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedBarcode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.decode(reader, reader.uint32()); - break; - } - case 2: { - message.barcode = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedBarcode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.Layout.verify(message.layout); - if (error) - return "layout." + error; - } - if (message.barcode != null && message.hasOwnProperty("barcode")) { - var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedBarcode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode} DetectedBarcode - */ - DetectedBarcode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode(); - if (object.layout != null) { - if (typeof object.layout !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.layout: object expected"); - message.layout = $root.google.cloud.documentai.v1beta3.Document.Page.Layout.fromObject(object.layout); - } - if (object.barcode != null) { - if (typeof object.barcode !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode.barcode: object expected"); - message.barcode = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedBarcode - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.Layout.toObject(message.layout, options); - if (message.barcode != null && message.hasOwnProperty("barcode")) - object.barcode = $root.google.cloud.documentai.v1beta3.Barcode.toObject(message.barcode, options); - return object; - }; - - /** - * Converts this DetectedBarcode to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedBarcode"; - }; - - return DetectedBarcode; - })(); - - Page.DetectedLanguage = (function() { - - /** - * Properties of a DetectedLanguage. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @interface IDetectedLanguage - * @property {string|null} [languageCode] DetectedLanguage languageCode - * @property {number|null} [confidence] DetectedLanguage confidence - */ - - /** - * Constructs a new DetectedLanguage. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents a DetectedLanguage. - * @implements IDetectedLanguage - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedLanguage - * @instance - */ - DetectedLanguage.prototype.languageCode = ""; - - /** - * DetectedLanguage confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage - * @instance - */ - DetectedLanguage.prototype.confidence = 0; - - /** - * Creates a new DetectedLanguage instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IDetectedLanguage=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedLanguage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage} DetectedLanguage - */ - DetectedLanguage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.DetectedLanguage - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.DetectedLanguage"; - }; - - return DetectedLanguage; - })(); - - Page.ImageQualityScores = (function() { - - /** - * Properties of an ImageQualityScores. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @interface IImageQualityScores - * @property {number|null} [qualityScore] ImageQualityScores qualityScore - * @property {Array.|null} [detectedDefects] ImageQualityScores detectedDefects - */ - - /** - * Constructs a new ImageQualityScores. - * @memberof google.cloud.documentai.v1beta3.Document.Page - * @classdesc Represents an ImageQualityScores. - * @implements IImageQualityScores - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores - * @instance - */ - ImageQualityScores.prototype.qualityScore = 0; - - /** - * ImageQualityScores detectedDefects. - * @member {Array.} detectedDefects - * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores - * @instance - */ - ImageQualityScores.prototype.detectedDefects = $util.emptyArray; - - /** - * Creates a new ImageQualityScores instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.IImageQualityScores=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores} ImageQualityScores - */ - ImageQualityScores.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.detectedDefects: object expected"); - message.detectedDefects[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect.toObject(message.detectedDefects[j], options); - } - return object; - }; - - /** - * Converts this ImageQualityScores to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores"; - }; - - ImageQualityScores.DetectedDefect = (function() { - - /** - * Properties of a DetectedDefect. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores - * @classdesc Represents a DetectedDefect. - * @implements IDetectedDefect - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect - * @instance - */ - DetectedDefect.prototype.type = ""; - - /** - * DetectedDefect confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect - * @instance - */ - DetectedDefect.prototype.confidence = 0; - - /** - * Creates a new DetectedDefect instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.IDetectedDefect=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect} DetectedDefect - */ - DetectedDefect.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Page.ImageQualityScores.DetectedDefect"; - }; - - return DetectedDefect; - })(); - - return ImageQualityScores; - })(); - - return Page; - })(); - - Document.Entity = (function() { - - /** - * Properties of an Entity. - * @memberof google.cloud.documentai.v1beta3.Document - * @interface IEntity - * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document.IPageAnchor|null} [pageAnchor] Entity pageAnchor - * @property {string|null} [id] Entity id - * @property {google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue|null} [normalizedValue] Entity normalizedValue - * @property {Array.|null} [properties] Entity properties - * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] Entity provenance - * @property {boolean|null} [redacted] Entity redacted - * @property {google.cloud.documentai.v1beta3.Document.Entity.Method|null} [method] Entity method - */ - - /** - * Constructs a new Entity. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents an Entity. - * @implements IEntity - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextAnchor|null|undefined} textAnchor - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance - */ - Entity.prototype.textAnchor = null; - - /** - * Entity type. - * @member {string} type - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance - */ - Entity.prototype.type = ""; - - /** - * Entity mentionText. - * @member {string} mentionText - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance - */ - Entity.prototype.mentionText = ""; - - /** - * Entity mentionId. - * @member {string} mentionId - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance - */ - Entity.prototype.mentionId = ""; - - /** - * Entity confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance - */ - Entity.prototype.confidence = 0; - - /** - * Entity pageAnchor. - * @member {google.cloud.documentai.v1beta3.Document.IPageAnchor|null|undefined} pageAnchor - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance - */ - Entity.prototype.pageAnchor = null; - - /** - * Entity id. - * @member {string} id - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance - */ - Entity.prototype.id = ""; - - /** - * Entity normalizedValue. - * @member {google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue|null|undefined} normalizedValue - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance - */ - Entity.prototype.normalizedValue = null; - - /** - * Entity properties. - * @member {Array.} properties - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance - */ - Entity.prototype.properties = $util.emptyArray; - - /** - * Entity provenance. - * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance - */ - Entity.prototype.provenance = null; - - /** - * Entity redacted. - * @member {boolean} redacted - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance - */ - Entity.prototype.redacted = false; - - /** - * Entity method. - * @member {google.cloud.documentai.v1beta3.Document.Entity.Method} method - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @instance - */ - Entity.prototype.method = 0; - - /** - * Creates a new Entity instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @static - * @param {google.cloud.documentai.v1beta3.Document.IEntity=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Entity - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.decode(reader, reader.uint32()); - break; - } - case 7: { - message.id = reader.string(); - break; - } - case 9: { - message.normalizedValue = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.decode(reader, reader.uint32())); - break; - } - case 11: { - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.verify(message.properties[i]); - if (error) - return "properties." + error; - } - } - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Entity} Entity - */ - Entity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Entity) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Entity(); - if (object.textAnchor != null) { - if (typeof object.textAnchor !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Entity.textAnchor: object expected"); - message.textAnchor = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.pageAnchor: object expected"); - message.pageAnchor = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.normalizedValue: object expected"); - message.normalizedValue = $root.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue.fromObject(object.normalizedValue); - } - if (object.properties) { - if (!Array.isArray(object.properties)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.properties: object expected"); - message.properties[i] = $root.google.cloud.documentai.v1beta3.Document.Entity.fromObject(object.properties[i]); - } - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.Entity.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.toObject(message.properties[j], options); - } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.Method[message.method] === undefined ? message.method : $root.google.cloud.documentai.v1beta3.Document.Entity.Method[message.method] : message.method; - return object; - }; - - /** - * Converts this Entity to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Entity"; - }; - - Entity.NormalizedValue = (function() { - - /** - * Properties of a NormalizedValue. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity - * @classdesc Represents a NormalizedValue. - * @implements INormalizedValue - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.moneyValue = null; - - /** - * NormalizedValue dateValue. - * @member {google.type.IDate|null|undefined} dateValue - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.dateValue = null; - - /** - * NormalizedValue datetimeValue. - * @member {google.type.IDateTime|null|undefined} datetimeValue - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.datetimeValue = null; - - /** - * NormalizedValue addressValue. - * @member {google.type.IPostalAddress|null|undefined} addressValue - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.addressValue = null; - - /** - * NormalizedValue booleanValue. - * @member {boolean|null|undefined} booleanValue - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.booleanValue = null; - - /** - * NormalizedValue integerValue. - * @member {number|null|undefined} integerValue - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.integerValue = null; - - /** - * NormalizedValue floatValue. - * @member {number|null|undefined} floatValue - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.floatValue = null; - - /** - * NormalizedValue signatureValue. - * @member {boolean|null|undefined} signatureValue - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue - * @instance - */ - NormalizedValue.prototype.signatureValue = null; - - /** - * NormalizedValue text. - * @member {string} text - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.NormalizedValue - * @static - * @param {google.cloud.documentai.v1beta3.Document.Entity.INormalizedValue=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.NormalizedValue.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Entity.NormalizedValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.NormalizedValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.NormalizedValue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue} NormalizedValue - */ - NormalizedValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue(); - if (object.moneyValue != null) { - if (typeof object.moneyValue !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.NormalizedValue - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.NormalizedValue"; - }; - - return NormalizedValue; - })(); - - /** - * Method enum. - * @name google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document - * @classdesc Represents an EntityRelation. - * @implements IEntityRelation - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityRelation - * @instance - */ - EntityRelation.prototype.subjectId = ""; - - /** - * EntityRelation objectId. - * @member {string} objectId - * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation - * @instance - */ - EntityRelation.prototype.objectId = ""; - - /** - * EntityRelation relation. - * @member {string} relation - * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation - * @instance - */ - EntityRelation.prototype.relation = ""; - - /** - * Creates a new EntityRelation instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation - * @static - * @param {google.cloud.documentai.v1beta3.Document.IEntityRelation=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityRelation.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityRelation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.EntityRelation - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityRelation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.EntityRelation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.EntityRelation} EntityRelation - */ - EntityRelation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.EntityRelation) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityRelation - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityRelation"; - }; - - return EntityRelation; - })(); - - Document.TextAnchor = (function() { - - /** - * Properties of a TextAnchor. - * @memberof google.cloud.documentai.v1beta3.Document - * @interface ITextAnchor - * @property {Array.|null} [textSegments] TextAnchor textSegments - * @property {string|null} [content] TextAnchor content - */ - - /** - * Constructs a new TextAnchor. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents a TextAnchor. - * @implements ITextAnchor - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor - * @instance - */ - TextAnchor.prototype.textSegments = $util.emptyArray; - - /** - * TextAnchor content. - * @member {string} content - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor - * @instance - */ - TextAnchor.prototype.content = ""; - - /** - * Creates a new TextAnchor instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor - * @static - * @param {google.cloud.documentai.v1beta3.Document.ITextAnchor=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.TextAnchor} TextAnchor - */ - TextAnchor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.TextAnchor) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.TextAnchor(); - if (object.textSegments) { - if (!Array.isArray(object.textSegments)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor.textSegments: object expected"); - message.textSegments[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor"; - }; - - TextAnchor.TextSegment = (function() { - - /** - * Properties of a TextSegment. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor - * @classdesc Represents a TextSegment. - * @implements ITextSegment - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment - * @static - * @param {google.cloud.documentai.v1beta3.Document.TextAnchor.ITextSegment=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment} TextSegment - */ - TextSegment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextAnchor.TextSegment"; - }; - - return TextSegment; - })(); - - return TextAnchor; - })(); - - Document.PageAnchor = (function() { - - /** - * Properties of a PageAnchor. - * @memberof google.cloud.documentai.v1beta3.Document - * @interface IPageAnchor - * @property {Array.|null} [pageRefs] PageAnchor pageRefs - */ - - /** - * Constructs a new PageAnchor. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents a PageAnchor. - * @implements IPageAnchor - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor - * @instance - */ - PageAnchor.prototype.pageRefs = $util.emptyArray; - - /** - * Creates a new PageAnchor instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor - * @static - * @param {google.cloud.documentai.v1beta3.Document.IPageAnchor=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.PageAnchor} PageAnchor - */ - PageAnchor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.PageAnchor) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.PageAnchor(); - if (object.pageRefs) { - if (!Array.isArray(object.pageRefs)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.pageRefs: object expected"); - message.pageRefs[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.PageRef.toObject(message.pageRefs[j], options); - } - return object; - }; - - /** - * Converts this PageAnchor to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor"; - }; - - PageAnchor.PageRef = (function() { - - /** - * Properties of a PageRef. - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor - * @interface IPageRef - * @property {number|Long|null} [page] PageRef page - * @property {google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType|null} [layoutType] PageRef layoutType - * @property {string|null} [layoutId] PageRef layoutId - * @property {google.cloud.documentai.v1beta3.IBoundingPoly|null} [boundingPoly] PageRef boundingPoly - * @property {number|null} [confidence] PageRef confidence - */ - - /** - * Constructs a new PageRef. - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor - * @classdesc Represents a PageRef. - * @implements IPageRef - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.PageRef - * @instance - */ - PageRef.prototype.page = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PageRef layoutType. - * @member {google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType} layoutType - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef - * @instance - */ - PageRef.prototype.layoutType = 0; - - /** - * PageRef layoutId. - * @member {string} layoutId - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef - * @instance - */ - PageRef.prototype.layoutId = ""; - - /** - * PageRef boundingPoly. - * @member {google.cloud.documentai.v1beta3.IBoundingPoly|null|undefined} boundingPoly - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef - * @instance - */ - PageRef.prototype.boundingPoly = null; - - /** - * PageRef confidence. - * @member {number} confidence - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef - * @instance - */ - PageRef.prototype.confidence = 0; - - /** - * Creates a new PageRef instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef - * @static - * @param {google.cloud.documentai.v1beta3.Document.PageAnchor.IPageRef=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.PageRef.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.PageRef.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.PageRef - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.PageRef - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef} PageRef - */ - PageRef.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.PageRef.boundingPoly: object expected"); - message.boundingPoly = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.PageRef - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.PageAnchor.PageRef.LayoutType[message.layoutType] === undefined ? message.layoutType : $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.PageAnchor.PageRef"; - }; - - /** - * LayoutType enum. - * @name google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.OperationType|null} [type] Provenance type - */ - - /** - * Constructs a new Provenance. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents a Provenance. - * @implements IProvenance - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance - * @instance - */ - Provenance.prototype.revision = 0; - - /** - * Provenance id. - * @member {number} id - * @memberof google.cloud.documentai.v1beta3.Document.Provenance - * @instance - */ - Provenance.prototype.id = 0; - - /** - * Provenance parents. - * @member {Array.} parents - * @memberof google.cloud.documentai.v1beta3.Document.Provenance - * @instance - */ - Provenance.prototype.parents = $util.emptyArray; - - /** - * Provenance type. - * @member {google.cloud.documentai.v1beta3.Document.Provenance.OperationType} type - * @memberof google.cloud.documentai.v1beta3.Document.Provenance - * @instance - */ - Provenance.prototype.type = 0; - - /** - * Creates a new Provenance instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Provenance - * @static - * @param {google.cloud.documentai.v1beta3.Document.IProvenance=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Provenance - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Provenance - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Provenance} Provenance - */ - Provenance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Provenance) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.parents: object expected"); - message.parents[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.Parent.toObject(message.parents[j], options); - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.documentai.v1beta3.Document.Provenance.OperationType[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1beta3.Document.Provenance.OperationType[message.type] : message.type; - return object; - }; - - /** - * Converts this Provenance to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance"; - }; - - Provenance.Parent = (function() { - - /** - * Properties of a Parent. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance - * @classdesc Represents a Parent. - * @implements IParent - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.Parent - * @instance - */ - Parent.prototype.revision = 0; - - /** - * Parent index. - * @member {number} index - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent - * @instance - */ - Parent.prototype.index = 0; - - /** - * Parent id. - * @member {number} id - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent - * @instance - */ - Parent.prototype.id = 0; - - /** - * Creates a new Parent instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent - * @static - * @param {google.cloud.documentai.v1beta3.Document.Provenance.IParent=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.Parent.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.Parent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Provenance.Parent - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.Parent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.Parent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Provenance.Parent} Parent - */ - Parent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Provenance.Parent) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Provenance.Parent - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.Parent"; - }; - - return Parent; - })(); - - /** - * OperationType enum. - * @name google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.IHumanReview|null} [humanReview] Revision humanReview - */ - - /** - * Constructs a new Revision. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents a Revision. - * @implements IRevision - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision - * @instance - */ - Revision.prototype.agent = null; - - /** - * Revision processor. - * @member {string|null|undefined} processor - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @instance - */ - Revision.prototype.processor = null; - - /** - * Revision id. - * @member {string} id - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @instance - */ - Revision.prototype.id = ""; - - /** - * Revision parent. - * @member {Array.} parent - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @instance - */ - Revision.prototype.parent = $util.emptyArray; - - /** - * Revision parentIds. - * @member {Array.} parentIds - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @instance - */ - Revision.prototype.parentIds = $util.emptyArray; - - /** - * Revision createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @instance - */ - Revision.prototype.createTime = null; - - /** - * Revision humanReview. - * @member {google.cloud.documentai.v1beta3.Document.Revision.IHumanReview|null|undefined} humanReview - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Revision - * @static - * @param {google.cloud.documentai.v1beta3.Document.IRevision=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Revision} Revision - */ - Revision.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Revision) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.humanReview: object expected"); - message.humanReview = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision"; - }; - - Revision.HumanReview = (function() { - - /** - * Properties of a HumanReview. - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @interface IHumanReview - * @property {string|null} [state] HumanReview state - * @property {string|null} [stateMessage] HumanReview stateMessage - */ - - /** - * Constructs a new HumanReview. - * @memberof google.cloud.documentai.v1beta3.Document.Revision - * @classdesc Represents a HumanReview. - * @implements IHumanReview - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.HumanReview - * @instance - */ - HumanReview.prototype.state = ""; - - /** - * HumanReview stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview - * @instance - */ - HumanReview.prototype.stateMessage = ""; - - /** - * Creates a new HumanReview instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview - * @static - * @param {google.cloud.documentai.v1beta3.Document.Revision.IHumanReview=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.HumanReview.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.HumanReview.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Revision.HumanReview - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.HumanReview - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.HumanReview - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Revision.HumanReview} HumanReview - */ - HumanReview.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Revision.HumanReview) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.Revision.HumanReview - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Revision.HumanReview"; - }; - - return HumanReview; - })(); - - return Revision; - })(); - - Document.TextChange = (function() { - - /** - * Properties of a TextChange. - * @memberof google.cloud.documentai.v1beta3.Document - * @interface ITextChange - * @property {google.cloud.documentai.v1beta3.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.v1beta3.Document - * @classdesc Represents a TextChange. - * @implements ITextChange - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ITextAnchor|null|undefined} textAnchor - * @memberof google.cloud.documentai.v1beta3.Document.TextChange - * @instance - */ - TextChange.prototype.textAnchor = null; - - /** - * TextChange changedText. - * @member {string} changedText - * @memberof google.cloud.documentai.v1beta3.Document.TextChange - * @instance - */ - TextChange.prototype.changedText = ""; - - /** - * TextChange provenance. - * @member {Array.} provenance - * @memberof google.cloud.documentai.v1beta3.Document.TextChange - * @instance - */ - TextChange.prototype.provenance = $util.emptyArray; - - /** - * Creates a new TextChange instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.TextChange - * @static - * @param {google.cloud.documentai.v1beta3.Document.ITextChange=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.TextChange.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.TextChange - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextChange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.TextChange - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextChange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.TextChange - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.TextChange} TextChange - */ - TextChange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.TextChange) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.TextChange(); - if (object.textAnchor != null) { - if (typeof object.textAnchor !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.TextChange.textAnchor: object expected"); - message.textAnchor = $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.TextChange.provenance: object expected"); - message.provenance[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.TextChange - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Provenance.toObject(message.provenance[j], options); - } - return object; - }; - - /** - * Converts this TextChange to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.TextChange"; - }; - - return TextChange; - })(); - - Document.Annotations = (function() { - - /** - * Properties of an Annotations. - * @memberof google.cloud.documentai.v1beta3.Document - * @interface IAnnotations - * @property {string|null} [description] Annotations description - */ - - /** - * Constructs a new Annotations. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents an Annotations. - * @implements IAnnotations - * @constructor - * @param {google.cloud.documentai.v1beta3.Document.IAnnotations=} [properties] Properties to set - */ - function Annotations(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotations description. - * @member {string} description - * @memberof google.cloud.documentai.v1beta3.Document.Annotations - * @instance - */ - Annotations.prototype.description = ""; - - /** - * Creates a new Annotations instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.Annotations - * @static - * @param {google.cloud.documentai.v1beta3.Document.IAnnotations=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.Annotations} Annotations instance - */ - Annotations.create = function create(properties) { - return new Annotations(properties); - }; - - /** - * Encodes the specified Annotations message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Annotations.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.Annotations - * @static - * @param {google.cloud.documentai.v1beta3.Document.IAnnotations} message Annotations message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotations.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); - return writer; - }; - - /** - * Encodes the specified Annotations message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.Annotations.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Annotations - * @static - * @param {google.cloud.documentai.v1beta3.Document.IAnnotations} message Annotations message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotations.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotations message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.Annotations - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Document.Annotations} Annotations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotations.decode = function decode(reader, 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.v1beta3.Document.Annotations(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.description = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotations message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.Annotations - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Document.Annotations} Annotations - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotations.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotations message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.Annotations - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotations.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"; - return null; - }; - - /** - * Creates an Annotations message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.Annotations - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.Annotations} Annotations - */ - Annotations.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.Annotations) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.Annotations(); - if (object.description != null) - message.description = String(object.description); - return message; - }; - - /** - * Creates a plain object from an Annotations message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.Annotations - * @static - * @param {google.cloud.documentai.v1beta3.Document.Annotations} message Annotations - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotations.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.description = ""; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this Annotations to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.Annotations - * @instance - * @returns {Object.} JSON object - */ - Annotations.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotations - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.Annotations - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.Annotations"; - }; - - return Annotations; - })(); - - Document.DocumentLayout = (function() { - - /** - * Properties of a DocumentLayout. - * @memberof google.cloud.documentai.v1beta3.Document - * @interface IDocumentLayout - * @property {Array.|null} [blocks] DocumentLayout blocks - */ - - /** - * Constructs a new DocumentLayout. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents a DocumentLayout. - * @implements IDocumentLayout - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout - * @instance - */ - DocumentLayout.prototype.blocks = $util.emptyArray; - - /** - * Creates a new DocumentLayout instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout - * @static - * @param {google.cloud.documentai.v1beta3.Document.IDocumentLayout=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout} DocumentLayout - */ - DocumentLayout.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout(); - if (object.blocks) { - if (!Array.isArray(object.blocks)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.blocks: object expected"); - message.blocks[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); - } - return object; - }; - - /** - * Converts this DocumentLayout to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout"; - }; - - DocumentLayout.DocumentLayoutBlock = (function() { - - /** - * Properties of a DocumentLayoutBlock. - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout - * @interface IDocumentLayoutBlock - * @property {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null} [textBlock] DocumentLayoutBlock textBlock - * @property {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null} [tableBlock] DocumentLayoutBlock tableBlock - * @property {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null} [listBlock] DocumentLayoutBlock listBlock - * @property {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock|null} [imageBlock] DocumentLayoutBlock imageBlock - * @property {string|null} [blockId] DocumentLayoutBlock blockId - * @property {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null} [pageSpan] DocumentLayoutBlock pageSpan - * @property {google.cloud.documentai.v1beta3.IBoundingPoly|null} [boundingBox] DocumentLayoutBlock boundingBox - */ - - /** - * Constructs a new DocumentLayoutBlock. - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout - * @classdesc Represents a DocumentLayoutBlock. - * @implements IDocumentLayoutBlock - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock|null|undefined} textBlock - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - DocumentLayoutBlock.prototype.textBlock = null; - - /** - * DocumentLayoutBlock tableBlock. - * @member {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock|null|undefined} tableBlock - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - DocumentLayoutBlock.prototype.tableBlock = null; - - /** - * DocumentLayoutBlock listBlock. - * @member {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock|null|undefined} listBlock - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - DocumentLayoutBlock.prototype.listBlock = null; - - /** - * DocumentLayoutBlock imageBlock. - * @member {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock|null|undefined} imageBlock - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - DocumentLayoutBlock.prototype.imageBlock = null; - - /** - * DocumentLayoutBlock blockId. - * @member {string} blockId - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - DocumentLayoutBlock.prototype.blockId = ""; - - /** - * DocumentLayoutBlock pageSpan. - * @member {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan|null|undefined} pageSpan - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - DocumentLayoutBlock.prototype.pageSpan = null; - - /** - * DocumentLayoutBlock boundingBox. - * @member {google.cloud.documentai.v1beta3.IBoundingPoly|null|undefined} boundingBox - * @memberof google.cloud.documentai.v1beta3.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"|"imageBlock"|undefined} block - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @instance - */ - Object.defineProperty(DocumentLayoutBlock.prototype, "block", { - get: $util.oneOfGetter($oneOfFields = ["textBlock", "tableBlock", "listBlock", "imageBlock"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DocumentLayoutBlock instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.IDocumentLayoutBlock=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.BoundingPoly.encode(message.boundingBox, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.imageBlock != null && Object.hasOwnProperty.call(message, "imageBlock")) - $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.encode(message.imageBlock, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DocumentLayoutBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.decode(reader, reader.uint32()); - break; - } - case 3: { - message.tableBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.decode(reader, reader.uint32()); - break; - } - case 4: { - message.listBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.decode(reader, reader.uint32()); - break; - } - case 7: { - message.imageBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.decode(reader, reader.uint32()); - break; - } - case 1: { - message.blockId = reader.string(); - break; - } - case 5: { - message.pageSpan = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.decode(reader, reader.uint32()); - break; - } - case 6: { - message.boundingBox = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify(message.listBlock); - if (error) - return "listBlock." + error; - } - } - if (message.imageBlock != null && message.hasOwnProperty("imageBlock")) { - if (properties.block === 1) - return "block: multiple values"; - properties.block = 1; - { - var error = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.verify(message.imageBlock); - if (error) - return "imageBlock." + 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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock} DocumentLayoutBlock - */ - DocumentLayoutBlock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock(); - if (object.textBlock != null) { - if (typeof object.textBlock !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.textBlock: object expected"); - message.textBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.fromObject(object.textBlock); - } - if (object.tableBlock != null) { - if (typeof object.tableBlock !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.tableBlock: object expected"); - message.tableBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.fromObject(object.tableBlock); - } - if (object.listBlock != null) { - if (typeof object.listBlock !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.listBlock: object expected"); - message.listBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.fromObject(object.listBlock); - } - if (object.imageBlock != null) { - if (typeof object.imageBlock !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.imageBlock: object expected"); - message.imageBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.fromObject(object.imageBlock); - } - if (object.blockId != null) - message.blockId = String(object.blockId); - if (object.pageSpan != null) { - if (typeof object.pageSpan !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.pageSpan: object expected"); - message.pageSpan = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.fromObject(object.pageSpan); - } - if (object.boundingBox != null) { - if (typeof object.boundingBox !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.boundingBox: object expected"); - message.boundingBox = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.toObject(message.pageSpan, options); - if (message.boundingBox != null && message.hasOwnProperty("boundingBox")) - object.boundingBox = $root.google.cloud.documentai.v1beta3.BoundingPoly.toObject(message.boundingBox, options); - if (message.imageBlock != null && message.hasOwnProperty("imageBlock")) { - object.imageBlock = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.toObject(message.imageBlock, options); - if (options.oneofs) - object.block = "imageBlock"; - } - return object; - }; - - /** - * Converts this DocumentLayoutBlock to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock"; - }; - - DocumentLayoutBlock.LayoutPageSpan = (function() { - - /** - * Properties of a LayoutPageSpan. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutPageSpan. - * @implements ILayoutPageSpan - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @instance - */ - LayoutPageSpan.prototype.pageStart = 0; - - /** - * LayoutPageSpan pageEnd. - * @member {number} pageEnd - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @instance - */ - LayoutPageSpan.prototype.pageEnd = 0; - - /** - * Creates a new LayoutPageSpan instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutPageSpan=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan} LayoutPageSpan - */ - LayoutPageSpan.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutPageSpan"; - }; - - return LayoutPageSpan; - })(); - - DocumentLayoutBlock.LayoutTextBlock = (function() { - - /** - * Properties of a LayoutTextBlock. - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @interface ILayoutTextBlock - * @property {string|null} [text] LayoutTextBlock text - * @property {string|null} [type] LayoutTextBlock type - * @property {Array.|null} [blocks] LayoutTextBlock blocks - * @property {google.cloud.documentai.v1beta3.Document.IAnnotations|null} [annotations] LayoutTextBlock annotations - */ - - /** - * Constructs a new LayoutTextBlock. - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutTextBlock. - * @implements ILayoutTextBlock - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @instance - */ - LayoutTextBlock.prototype.text = ""; - - /** - * LayoutTextBlock type. - * @member {string} type - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @instance - */ - LayoutTextBlock.prototype.type = ""; - - /** - * LayoutTextBlock blocks. - * @member {Array.} blocks - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @instance - */ - LayoutTextBlock.prototype.blocks = $util.emptyArray; - - /** - * LayoutTextBlock annotations. - * @member {google.cloud.documentai.v1beta3.Document.IAnnotations|null|undefined} annotations - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @instance - */ - LayoutTextBlock.prototype.annotations = null; - - /** - * Creates a new LayoutTextBlock instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTextBlock=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.encode(message.blocks[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - $root.google.cloud.documentai.v1beta3.Document.Annotations.encode(message.annotations, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LayoutTextBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.decode(reader, reader.uint32())); - break; - } - case 4: { - message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.verify(message.blocks[i]); - if (error) - return "blocks." + error; - } - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - var error = $root.google.cloud.documentai.v1beta3.Document.Annotations.verify(message.annotations); - if (error) - return "annotations." + 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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock} LayoutTextBlock - */ - LayoutTextBlock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.blocks: object expected"); - message.blocks[i] = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.fromObject(object.blocks[i]); - } - } - if (object.annotations != null) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock.annotations: object expected"); - message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.fromObject(object.annotations); - } - return message; - }; - - /** - * Creates a plain object from a LayoutTextBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock - * @static - * @param {google.cloud.documentai.v1beta3.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 = ""; - object.annotations = null; - } - 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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); - } - if (message.annotations != null && message.hasOwnProperty("annotations")) - object.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.toObject(message.annotations, options); - return object; - }; - - /** - * Converts this LayoutTextBlock to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTextBlock"; - }; - - return LayoutTextBlock; - })(); - - DocumentLayoutBlock.LayoutTableBlock = (function() { - - /** - * Properties of a LayoutTableBlock. - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @interface ILayoutTableBlock - * @property {Array.|null} [headerRows] LayoutTableBlock headerRows - * @property {Array.|null} [bodyRows] LayoutTableBlock bodyRows - * @property {string|null} [caption] LayoutTableBlock caption - * @property {google.cloud.documentai.v1beta3.Document.IAnnotations|null} [annotations] LayoutTableBlock annotations - */ - - /** - * Constructs a new LayoutTableBlock. - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutTableBlock. - * @implements ILayoutTableBlock - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @instance - */ - LayoutTableBlock.prototype.headerRows = $util.emptyArray; - - /** - * LayoutTableBlock bodyRows. - * @member {Array.} bodyRows - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @instance - */ - LayoutTableBlock.prototype.bodyRows = $util.emptyArray; - - /** - * LayoutTableBlock caption. - * @member {string} caption - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @instance - */ - LayoutTableBlock.prototype.caption = ""; - - /** - * LayoutTableBlock annotations. - * @member {google.cloud.documentai.v1beta3.Document.IAnnotations|null|undefined} annotations - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @instance - */ - LayoutTableBlock.prototype.annotations = null; - - /** - * Creates a new LayoutTableBlock instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableBlock=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - $root.google.cloud.documentai.v1beta3.Document.Annotations.encode(message.annotations, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LayoutTableBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.decode(reader, reader.uint32())); - break; - } - case 3: { - message.caption = reader.string(); - break; - } - case 4: { - message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.decode(reader, reader.uint32()); - 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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - var error = $root.google.cloud.documentai.v1beta3.Document.Annotations.verify(message.annotations); - if (error) - return "annotations." + error; - } - return null; - }; - - /** - * Creates a LayoutTableBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock} LayoutTableBlock - */ - LayoutTableBlock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock(); - if (object.headerRows) { - if (!Array.isArray(object.headerRows)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.headerRows: object expected"); - message.headerRows[i] = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.fromObject(object.headerRows[i]); - } - } - if (object.bodyRows) { - if (!Array.isArray(object.bodyRows)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.bodyRows: object expected"); - message.bodyRows[i] = $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.fromObject(object.bodyRows[i]); - } - } - if (object.caption != null) - message.caption = String(object.caption); - if (object.annotations != null) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock.annotations: object expected"); - message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.fromObject(object.annotations); - } - return message; - }; - - /** - * Creates a plain object from a LayoutTableBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock - * @static - * @param {google.cloud.documentai.v1beta3.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 = ""; - object.annotations = null; - } - if (message.headerRows && message.headerRows.length) { - object.headerRows = []; - for (var j = 0; j < message.headerRows.length; ++j) - object.headerRows[j] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.toObject(message.bodyRows[j], options); - } - if (message.caption != null && message.hasOwnProperty("caption")) - object.caption = message.caption; - if (message.annotations != null && message.hasOwnProperty("annotations")) - object.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.toObject(message.annotations, options); - return object; - }; - - /** - * Converts this LayoutTableBlock to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableBlock"; - }; - - return LayoutTableBlock; - })(); - - DocumentLayoutBlock.LayoutTableRow = (function() { - - /** - * Properties of a LayoutTableRow. - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @interface ILayoutTableRow - * @property {Array.|null} [cells] LayoutTableRow cells - */ - - /** - * Constructs a new LayoutTableRow. - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutTableRow. - * @implements ILayoutTableRow - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableRow=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow} LayoutTableRow - */ - LayoutTableRow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow(); - if (object.cells) { - if (!Array.isArray(object.cells)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow.cells: object expected"); - message.cells[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.toObject(message.cells[j], options); - } - return object; - }; - - /** - * Converts this LayoutTableRow to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableRow"; - }; - - return LayoutTableRow; - })(); - - DocumentLayoutBlock.LayoutTableCell = (function() { - - /** - * Properties of a LayoutTableCell. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutTableCell. - * @implements ILayoutTableCell - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @instance - */ - LayoutTableCell.prototype.blocks = $util.emptyArray; - - /** - * LayoutTableCell rowSpan. - * @member {number} rowSpan - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @instance - */ - LayoutTableCell.prototype.rowSpan = 0; - - /** - * LayoutTableCell colSpan. - * @member {number} colSpan - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @instance - */ - LayoutTableCell.prototype.colSpan = 0; - - /** - * Creates a new LayoutTableCell instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutTableCell=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell} LayoutTableCell - */ - LayoutTableCell.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell(); - if (object.blocks) { - if (!Array.isArray(object.blocks)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell.blocks: object expected"); - message.blocks[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutTableCell"; - }; - - return LayoutTableCell; - })(); - - DocumentLayoutBlock.LayoutListBlock = (function() { - - /** - * Properties of a LayoutListBlock. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutListBlock. - * @implements ILayoutListBlock - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @instance - */ - LayoutListBlock.prototype.listEntries = $util.emptyArray; - - /** - * LayoutListBlock type. - * @member {string} type - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @instance - */ - LayoutListBlock.prototype.type = ""; - - /** - * Creates a new LayoutListBlock instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListBlock=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock} LayoutListBlock - */ - LayoutListBlock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock(); - if (object.listEntries) { - if (!Array.isArray(object.listEntries)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock.listEntries: object expected"); - message.listEntries[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListBlock"; - }; - - return LayoutListBlock; - })(); - - DocumentLayoutBlock.LayoutListEntry = (function() { - - /** - * Properties of a LayoutListEntry. - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @interface ILayoutListEntry - * @property {Array.|null} [blocks] LayoutListEntry blocks - */ - - /** - * Constructs a new LayoutListEntry. - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutListEntry. - * @implements ILayoutListEntry - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutListEntry=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry} LayoutListEntry - */ - LayoutListEntry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry(); - if (object.blocks) { - if (!Array.isArray(object.blocks)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry.blocks: object expected"); - message.blocks[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.toObject(message.blocks[j], options); - } - return object; - }; - - /** - * Converts this LayoutListEntry to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutListEntry"; - }; - - return LayoutListEntry; - })(); - - DocumentLayoutBlock.LayoutImageBlock = (function() { - - /** - * Properties of a LayoutImageBlock. - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @interface ILayoutImageBlock - * @property {string|null} [blobAssetId] LayoutImageBlock blobAssetId - * @property {string|null} [gcsUri] LayoutImageBlock gcsUri - * @property {string|null} [dataUri] LayoutImageBlock dataUri - * @property {string|null} [mimeType] LayoutImageBlock mimeType - * @property {string|null} [imageText] LayoutImageBlock imageText - * @property {google.cloud.documentai.v1beta3.Document.IAnnotations|null} [annotations] LayoutImageBlock annotations - */ - - /** - * Constructs a new LayoutImageBlock. - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock - * @classdesc Represents a LayoutImageBlock. - * @implements ILayoutImageBlock - * @constructor - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock=} [properties] Properties to set - */ - function LayoutImageBlock(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LayoutImageBlock blobAssetId. - * @member {string|null|undefined} blobAssetId - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @instance - */ - LayoutImageBlock.prototype.blobAssetId = null; - - /** - * LayoutImageBlock gcsUri. - * @member {string|null|undefined} gcsUri - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @instance - */ - LayoutImageBlock.prototype.gcsUri = null; - - /** - * LayoutImageBlock dataUri. - * @member {string|null|undefined} dataUri - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @instance - */ - LayoutImageBlock.prototype.dataUri = null; - - /** - * LayoutImageBlock mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @instance - */ - LayoutImageBlock.prototype.mimeType = ""; - - /** - * LayoutImageBlock imageText. - * @member {string} imageText - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @instance - */ - LayoutImageBlock.prototype.imageText = ""; - - /** - * LayoutImageBlock annotations. - * @member {google.cloud.documentai.v1beta3.Document.IAnnotations|null|undefined} annotations - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @instance - */ - LayoutImageBlock.prototype.annotations = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * LayoutImageBlock imageSource. - * @member {"blobAssetId"|"gcsUri"|"dataUri"|undefined} imageSource - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @instance - */ - Object.defineProperty(LayoutImageBlock.prototype, "imageSource", { - get: $util.oneOfGetter($oneOfFields = ["blobAssetId", "gcsUri", "dataUri"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new LayoutImageBlock instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @static - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock} LayoutImageBlock instance - */ - LayoutImageBlock.create = function create(properties) { - return new LayoutImageBlock(properties); - }; - - /** - * Encodes the specified LayoutImageBlock message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @static - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock} message LayoutImageBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutImageBlock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); - if (message.imageText != null && Object.hasOwnProperty.call(message, "imageText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.imageText); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - $root.google.cloud.documentai.v1beta3.Document.Annotations.encode(message.annotations, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.blobAssetId != null && Object.hasOwnProperty.call(message, "blobAssetId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.blobAssetId); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.gcsUri); - if (message.dataUri != null && Object.hasOwnProperty.call(message, "dataUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.dataUri); - return writer; - }; - - /** - * Encodes the specified LayoutImageBlock message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @static - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.ILayoutImageBlock} message LayoutImageBlock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutImageBlock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LayoutImageBlock message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock} LayoutImageBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutImageBlock.decode = function decode(reader, 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.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.blobAssetId = reader.string(); - break; - } - case 5: { - message.gcsUri = reader.string(); - break; - } - case 6: { - message.dataUri = reader.string(); - break; - } - case 1: { - message.mimeType = reader.string(); - break; - } - case 2: { - message.imageText = reader.string(); - break; - } - case 3: { - message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LayoutImageBlock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock} LayoutImageBlock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutImageBlock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LayoutImageBlock message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LayoutImageBlock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.blobAssetId != null && message.hasOwnProperty("blobAssetId")) { - properties.imageSource = 1; - if (!$util.isString(message.blobAssetId)) - return "blobAssetId: string expected"; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - if (properties.imageSource === 1) - return "imageSource: multiple values"; - properties.imageSource = 1; - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - } - if (message.dataUri != null && message.hasOwnProperty("dataUri")) { - if (properties.imageSource === 1) - return "imageSource: multiple values"; - properties.imageSource = 1; - if (!$util.isString(message.dataUri)) - return "dataUri: string expected"; - } - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.imageText != null && message.hasOwnProperty("imageText")) - if (!$util.isString(message.imageText)) - return "imageText: string expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - var error = $root.google.cloud.documentai.v1beta3.Document.Annotations.verify(message.annotations); - if (error) - return "annotations." + error; - } - return null; - }; - - /** - * Creates a LayoutImageBlock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock} LayoutImageBlock - */ - LayoutImageBlock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock(); - if (object.blobAssetId != null) - message.blobAssetId = String(object.blobAssetId); - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.dataUri != null) - message.dataUri = String(object.dataUri); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.imageText != null) - message.imageText = String(object.imageText); - if (object.annotations != null) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock.annotations: object expected"); - message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.fromObject(object.annotations); - } - return message; - }; - - /** - * Creates a plain object from a LayoutImageBlock message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @static - * @param {google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock} message LayoutImageBlock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LayoutImageBlock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.mimeType = ""; - object.imageText = ""; - object.annotations = null; - } - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.imageText != null && message.hasOwnProperty("imageText")) - object.imageText = message.imageText; - if (message.annotations != null && message.hasOwnProperty("annotations")) - object.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.toObject(message.annotations, options); - if (message.blobAssetId != null && message.hasOwnProperty("blobAssetId")) { - object.blobAssetId = message.blobAssetId; - if (options.oneofs) - object.imageSource = "blobAssetId"; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - object.gcsUri = message.gcsUri; - if (options.oneofs) - object.imageSource = "gcsUri"; - } - if (message.dataUri != null && message.hasOwnProperty("dataUri")) { - object.dataUri = message.dataUri; - if (options.oneofs) - object.imageSource = "dataUri"; - } - return object; - }; - - /** - * Converts this LayoutImageBlock to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @instance - * @returns {Object.} JSON object - */ - LayoutImageBlock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LayoutImageBlock - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LayoutImageBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.DocumentLayout.DocumentLayoutBlock.LayoutImageBlock"; - }; - - return LayoutImageBlock; - })(); - - return DocumentLayoutBlock; - })(); - - return DocumentLayout; - })(); - - Document.ChunkedDocument = (function() { - - /** - * Properties of a ChunkedDocument. - * @memberof google.cloud.documentai.v1beta3.Document - * @interface IChunkedDocument - * @property {Array.|null} [chunks] ChunkedDocument chunks - */ - - /** - * Constructs a new ChunkedDocument. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents a ChunkedDocument. - * @implements IChunkedDocument - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument - * @instance - */ - ChunkedDocument.prototype.chunks = $util.emptyArray; - - /** - * Creates a new ChunkedDocument instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument - * @static - * @param {google.cloud.documentai.v1beta3.Document.IChunkedDocument=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument} ChunkedDocument - */ - ChunkedDocument.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument(); - if (object.chunks) { - if (!Array.isArray(object.chunks)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.chunks: object expected"); - message.chunks[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.toObject(message.chunks[j], options); - } - return object; - }; - - /** - * Converts this ChunkedDocument to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument"; - }; - - ChunkedDocument.Chunk = (function() { - - /** - * Properties of a Chunk. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null} [pageSpan] Chunk pageSpan - * @property {Array.|null} [pageHeaders] Chunk pageHeaders - * @property {Array.|null} [pageFooters] Chunk pageFooters - * @property {Array.|null} [chunkFields] Chunk chunkFields - */ - - /** - * Constructs a new Chunk. - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument - * @classdesc Represents a Chunk. - * @implements IChunk - * @constructor - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.IChunk=} [properties] Properties to set - */ - function Chunk(properties) { - this.sourceBlockIds = []; - this.pageHeaders = []; - this.pageFooters = []; - this.chunkFields = []; - if (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.v1beta3.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.chunkId = ""; - - /** - * Chunk sourceBlockIds. - * @member {Array.} sourceBlockIds - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.sourceBlockIds = $util.emptyArray; - - /** - * Chunk content. - * @member {string} content - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.content = ""; - - /** - * Chunk pageSpan. - * @member {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null|undefined} pageSpan - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.pageSpan = null; - - /** - * Chunk pageHeaders. - * @member {Array.} pageHeaders - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.pageHeaders = $util.emptyArray; - - /** - * Chunk pageFooters. - * @member {Array.} pageFooters - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.pageFooters = $util.emptyArray; - - /** - * Chunk chunkFields. - * @member {Array.} chunkFields - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @instance - */ - Chunk.prototype.chunkFields = $util.emptyArray; - - /** - * Creates a new Chunk instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.IChunk=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.encode(message.pageFooters[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.chunkFields != null && message.chunkFields.length) - for (var i = 0; i < message.chunkFields.length; ++i) - $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.encode(message.chunkFields[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.chunkFields && message.chunkFields.length)) - message.chunkFields = []; - message.chunkFields.push($root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.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.v1beta3.Document.ChunkedDocument.Chunk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify(message.pageFooters[i]); - if (error) - return "pageFooters." + error; - } - } - if (message.chunkFields != null && message.hasOwnProperty("chunkFields")) { - if (!Array.isArray(message.chunkFields)) - return "chunkFields: array expected"; - for (var i = 0; i < message.chunkFields.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.verify(message.chunkFields[i]); - if (error) - return "chunkFields." + 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.v1beta3.Document.ChunkedDocument.Chunk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk} Chunk - */ - Chunk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.pageSpan: object expected"); - message.pageSpan = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan.fromObject(object.pageSpan); - } - if (object.pageHeaders) { - if (!Array.isArray(object.pageHeaders)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.pageHeaders: object expected"); - message.pageHeaders[i] = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader.fromObject(object.pageHeaders[i]); - } - } - if (object.pageFooters) { - if (!Array.isArray(object.pageFooters)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.pageFooters: object expected"); - message.pageFooters[i] = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.fromObject(object.pageFooters[i]); - } - } - if (object.chunkFields) { - if (!Array.isArray(object.chunkFields)) - throw TypeError(".google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.chunkFields: array expected"); - message.chunkFields = []; - for (var i = 0; i < object.chunkFields.length; ++i) { - if (typeof object.chunkFields[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.chunkFields: object expected"); - message.chunkFields[i] = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.fromObject(object.chunkFields[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.v1beta3.Document.ChunkedDocument.Chunk - * @static - * @param {google.cloud.documentai.v1beta3.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 = []; - object.chunkFields = []; - } - 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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.toObject(message.pageFooters[j], options); - } - if (message.chunkFields && message.chunkFields.length) { - object.chunkFields = []; - for (var j = 0; j < message.chunkFields.length; ++j) - object.chunkFields[j] = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.toObject(message.chunkFields[j], options); - } - return object; - }; - - /** - * Converts this Chunk to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk"; - }; - - Chunk.ChunkPageSpan = (function() { - - /** - * Properties of a ChunkPageSpan. - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk - * @classdesc Represents a ChunkPageSpan. - * @implements IChunkPageSpan - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @instance - */ - ChunkPageSpan.prototype.pageStart = 0; - - /** - * ChunkPageSpan pageEnd. - * @member {number} pageEnd - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @instance - */ - ChunkPageSpan.prototype.pageEnd = 0; - - /** - * Creates a new ChunkPageSpan instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan} ChunkPageSpan - */ - ChunkPageSpan.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan"; - }; - - return ChunkPageSpan; - })(); - - Chunk.ChunkPageHeader = (function() { - - /** - * Properties of a ChunkPageHeader. - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @interface IChunkPageHeader - * @property {string|null} [text] ChunkPageHeader text - * @property {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null} [pageSpan] ChunkPageHeader pageSpan - */ - - /** - * Constructs a new ChunkPageHeader. - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @classdesc Represents a ChunkPageHeader. - * @implements IChunkPageHeader - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @instance - */ - ChunkPageHeader.prototype.text = ""; - - /** - * ChunkPageHeader pageSpan. - * @member {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null|undefined} pageSpan - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @instance - */ - ChunkPageHeader.prototype.pageSpan = null; - - /** - * Creates a new ChunkPageHeader instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageHeader=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader} ChunkPageHeader - */ - ChunkPageHeader.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader.pageSpan: object expected"); - message.pageSpan = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan.toObject(message.pageSpan, options); - return object; - }; - - /** - * Converts this ChunkPageHeader to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageHeader"; - }; - - return ChunkPageHeader; - })(); - - Chunk.ChunkPageFooter = (function() { - - /** - * Properties of a ChunkPageFooter. - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @interface IChunkPageFooter - * @property {string|null} [text] ChunkPageFooter text - * @property {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null} [pageSpan] ChunkPageFooter pageSpan - */ - - /** - * Constructs a new ChunkPageFooter. - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @classdesc Represents a ChunkPageFooter. - * @implements IChunkPageFooter - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @instance - */ - ChunkPageFooter.prototype.text = ""; - - /** - * ChunkPageFooter pageSpan. - * @member {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageSpan|null|undefined} pageSpan - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @instance - */ - ChunkPageFooter.prototype.pageSpan = null; - - /** - * Creates a new ChunkPageFooter instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkPageFooter=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter} ChunkPageFooter - */ - ChunkPageFooter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter.pageSpan: object expected"); - message.pageSpan = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageSpan.toObject(message.pageSpan, options); - return object; - }; - - /** - * Converts this ChunkPageFooter to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.ChunkedDocument.Chunk.ChunkPageFooter"; - }; - - return ChunkPageFooter; - })(); - - Chunk.ImageChunkField = (function() { - - /** - * Properties of an ImageChunkField. - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @interface IImageChunkField - * @property {string|null} [blobAssetId] ImageChunkField blobAssetId - * @property {string|null} [gcsUri] ImageChunkField gcsUri - * @property {string|null} [dataUri] ImageChunkField dataUri - * @property {google.cloud.documentai.v1beta3.Document.IAnnotations|null} [annotations] ImageChunkField annotations - */ - - /** - * Constructs a new ImageChunkField. - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @classdesc Represents an ImageChunkField. - * @implements IImageChunkField - * @constructor - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField=} [properties] Properties to set - */ - function ImageChunkField(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImageChunkField blobAssetId. - * @member {string|null|undefined} blobAssetId - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @instance - */ - ImageChunkField.prototype.blobAssetId = null; - - /** - * ImageChunkField gcsUri. - * @member {string|null|undefined} gcsUri - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @instance - */ - ImageChunkField.prototype.gcsUri = null; - - /** - * ImageChunkField dataUri. - * @member {string|null|undefined} dataUri - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @instance - */ - ImageChunkField.prototype.dataUri = null; - - /** - * ImageChunkField annotations. - * @member {google.cloud.documentai.v1beta3.Document.IAnnotations|null|undefined} annotations - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @instance - */ - ImageChunkField.prototype.annotations = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ImageChunkField imageSource. - * @member {"blobAssetId"|"gcsUri"|"dataUri"|undefined} imageSource - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @instance - */ - Object.defineProperty(ImageChunkField.prototype, "imageSource", { - get: $util.oneOfGetter($oneOfFields = ["blobAssetId", "gcsUri", "dataUri"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ImageChunkField instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField} ImageChunkField instance - */ - ImageChunkField.create = function create(properties) { - return new ImageChunkField(properties); - }; - - /** - * Encodes the specified ImageChunkField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField} message ImageChunkField message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImageChunkField.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.blobAssetId != null && Object.hasOwnProperty.call(message, "blobAssetId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.blobAssetId); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.gcsUri); - if (message.dataUri != null && Object.hasOwnProperty.call(message, "dataUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataUri); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - $root.google.cloud.documentai.v1beta3.Document.Annotations.encode(message.annotations, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ImageChunkField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField} message ImageChunkField message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImageChunkField.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImageChunkField message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField} ImageChunkField - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImageChunkField.decode = function decode(reader, 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.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.blobAssetId = reader.string(); - break; - } - case 2: { - message.gcsUri = reader.string(); - break; - } - case 3: { - message.dataUri = reader.string(); - break; - } - case 4: { - message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImageChunkField message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField} ImageChunkField - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImageChunkField.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImageChunkField message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImageChunkField.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.blobAssetId != null && message.hasOwnProperty("blobAssetId")) { - properties.imageSource = 1; - if (!$util.isString(message.blobAssetId)) - return "blobAssetId: string expected"; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - if (properties.imageSource === 1) - return "imageSource: multiple values"; - properties.imageSource = 1; - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - } - if (message.dataUri != null && message.hasOwnProperty("dataUri")) { - if (properties.imageSource === 1) - return "imageSource: multiple values"; - properties.imageSource = 1; - if (!$util.isString(message.dataUri)) - return "dataUri: string expected"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - var error = $root.google.cloud.documentai.v1beta3.Document.Annotations.verify(message.annotations); - if (error) - return "annotations." + error; - } - return null; - }; - - /** - * Creates an ImageChunkField message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField} ImageChunkField - */ - ImageChunkField.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField(); - if (object.blobAssetId != null) - message.blobAssetId = String(object.blobAssetId); - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.dataUri != null) - message.dataUri = String(object.dataUri); - if (object.annotations != null) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.annotations: object expected"); - message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.fromObject(object.annotations); - } - return message; - }; - - /** - * Creates a plain object from an ImageChunkField message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField} message ImageChunkField - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImageChunkField.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.annotations = null; - if (message.blobAssetId != null && message.hasOwnProperty("blobAssetId")) { - object.blobAssetId = message.blobAssetId; - if (options.oneofs) - object.imageSource = "blobAssetId"; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) { - object.gcsUri = message.gcsUri; - if (options.oneofs) - object.imageSource = "gcsUri"; - } - if (message.dataUri != null && message.hasOwnProperty("dataUri")) { - object.dataUri = message.dataUri; - if (options.oneofs) - object.imageSource = "dataUri"; - } - if (message.annotations != null && message.hasOwnProperty("annotations")) - object.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.toObject(message.annotations, options); - return object; - }; - - /** - * Converts this ImageChunkField to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @instance - * @returns {Object.} JSON object - */ - ImageChunkField.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImageChunkField - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImageChunkField.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField"; - }; - - return ImageChunkField; - })(); - - Chunk.TableChunkField = (function() { - - /** - * Properties of a TableChunkField. - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @interface ITableChunkField - * @property {google.cloud.documentai.v1beta3.Document.IAnnotations|null} [annotations] TableChunkField annotations - */ - - /** - * Constructs a new TableChunkField. - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @classdesc Represents a TableChunkField. - * @implements ITableChunkField - * @constructor - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField=} [properties] Properties to set - */ - function TableChunkField(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TableChunkField annotations. - * @member {google.cloud.documentai.v1beta3.Document.IAnnotations|null|undefined} annotations - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField - * @instance - */ - TableChunkField.prototype.annotations = null; - - /** - * Creates a new TableChunkField instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField} TableChunkField instance - */ - TableChunkField.create = function create(properties) { - return new TableChunkField(properties); - }; - - /** - * Encodes the specified TableChunkField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField} message TableChunkField message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableChunkField.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - $root.google.cloud.documentai.v1beta3.Document.Annotations.encode(message.annotations, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TableChunkField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField} message TableChunkField message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableChunkField.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TableChunkField message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField} TableChunkField - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableChunkField.decode = function decode(reader, 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.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TableChunkField message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField} TableChunkField - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableChunkField.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TableChunkField message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TableChunkField.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - var error = $root.google.cloud.documentai.v1beta3.Document.Annotations.verify(message.annotations); - if (error) - return "annotations." + error; - } - return null; - }; - - /** - * Creates a TableChunkField message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField} TableChunkField - */ - TableChunkField.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField(); - if (object.annotations != null) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.annotations: object expected"); - message.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.fromObject(object.annotations); - } - return message; - }; - - /** - * Creates a plain object from a TableChunkField message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField} message TableChunkField - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TableChunkField.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.annotations = null; - if (message.annotations != null && message.hasOwnProperty("annotations")) - object.annotations = $root.google.cloud.documentai.v1beta3.Document.Annotations.toObject(message.annotations, options); - return object; - }; - - /** - * Converts this TableChunkField to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField - * @instance - * @returns {Object.} JSON object - */ - TableChunkField.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TableChunkField - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TableChunkField.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField"; - }; - - return TableChunkField; - })(); - - Chunk.ChunkField = (function() { - - /** - * Properties of a ChunkField. - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @interface IChunkField - * @property {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField|null} [imageChunkField] ChunkField imageChunkField - * @property {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField|null} [tableChunkField] ChunkField tableChunkField - */ - - /** - * Constructs a new ChunkField. - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk - * @classdesc Represents a ChunkField. - * @implements IChunkField - * @constructor - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField=} [properties] Properties to set - */ - function ChunkField(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChunkField imageChunkField. - * @member {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IImageChunkField|null|undefined} imageChunkField - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @instance - */ - ChunkField.prototype.imageChunkField = null; - - /** - * ChunkField tableChunkField. - * @member {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ITableChunkField|null|undefined} tableChunkField - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @instance - */ - ChunkField.prototype.tableChunkField = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ChunkField fieldType. - * @member {"imageChunkField"|"tableChunkField"|undefined} fieldType - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @instance - */ - Object.defineProperty(ChunkField.prototype, "fieldType", { - get: $util.oneOfGetter($oneOfFields = ["imageChunkField", "tableChunkField"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ChunkField instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField} ChunkField instance - */ - ChunkField.create = function create(properties) { - return new ChunkField(properties); - }; - - /** - * Encodes the specified ChunkField message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField} message ChunkField message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkField.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.imageChunkField != null && Object.hasOwnProperty.call(message, "imageChunkField")) - $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.encode(message.imageChunkField, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.tableChunkField != null && Object.hasOwnProperty.call(message, "tableChunkField")) - $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.encode(message.tableChunkField, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ChunkField message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.IChunkField} message ChunkField message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkField.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChunkField message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField} ChunkField - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkField.decode = function decode(reader, 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.v1beta3.Document.ChunkedDocument.Chunk.ChunkField(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.imageChunkField = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.decode(reader, reader.uint32()); - break; - } - case 2: { - message.tableChunkField = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChunkField message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField} ChunkField - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkField.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChunkField message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChunkField.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.imageChunkField != null && message.hasOwnProperty("imageChunkField")) { - properties.fieldType = 1; - { - var error = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.verify(message.imageChunkField); - if (error) - return "imageChunkField." + error; - } - } - if (message.tableChunkField != null && message.hasOwnProperty("tableChunkField")) { - if (properties.fieldType === 1) - return "fieldType: multiple values"; - properties.fieldType = 1; - { - var error = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.verify(message.tableChunkField); - if (error) - return "tableChunkField." + error; - } - } - return null; - }; - - /** - * Creates a ChunkField message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField} ChunkField - */ - ChunkField.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField(); - if (object.imageChunkField != null) { - if (typeof object.imageChunkField !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.imageChunkField: object expected"); - message.imageChunkField = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.fromObject(object.imageChunkField); - } - if (object.tableChunkField != null) { - if (typeof object.tableChunkField !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField.tableChunkField: object expected"); - message.tableChunkField = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.fromObject(object.tableChunkField); - } - return message; - }; - - /** - * Creates a plain object from a ChunkField message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @static - * @param {google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField} message ChunkField - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChunkField.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.imageChunkField != null && message.hasOwnProperty("imageChunkField")) { - object.imageChunkField = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ImageChunkField.toObject(message.imageChunkField, options); - if (options.oneofs) - object.fieldType = "imageChunkField"; - } - if (message.tableChunkField != null && message.hasOwnProperty("tableChunkField")) { - object.tableChunkField = $root.google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.TableChunkField.toObject(message.tableChunkField, options); - if (options.oneofs) - object.fieldType = "tableChunkField"; - } - return object; - }; - - /** - * Converts this ChunkField to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @instance - * @returns {Object.} JSON object - */ - ChunkField.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChunkField - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChunkField.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.ChunkedDocument.Chunk.ChunkField"; - }; - - return ChunkField; - })(); - - return Chunk; - })(); - - return ChunkedDocument; - })(); - - Document.BlobAsset = (function() { - - /** - * Properties of a BlobAsset. - * @memberof google.cloud.documentai.v1beta3.Document - * @interface IBlobAsset - * @property {string|null} [assetId] BlobAsset assetId - * @property {Uint8Array|null} [content] BlobAsset content - * @property {string|null} [mimeType] BlobAsset mimeType - */ - - /** - * Constructs a new BlobAsset. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents a BlobAsset. - * @implements IBlobAsset - * @constructor - * @param {google.cloud.documentai.v1beta3.Document.IBlobAsset=} [properties] Properties to set - */ - function BlobAsset(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BlobAsset assetId. - * @member {string} assetId - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @instance - */ - BlobAsset.prototype.assetId = ""; - - /** - * BlobAsset content. - * @member {Uint8Array} content - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @instance - */ - BlobAsset.prototype.content = $util.newBuffer([]); - - /** - * BlobAsset mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @instance - */ - BlobAsset.prototype.mimeType = ""; - - /** - * Creates a new BlobAsset instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @static - * @param {google.cloud.documentai.v1beta3.Document.IBlobAsset=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Document.BlobAsset} BlobAsset instance - */ - BlobAsset.create = function create(properties) { - return new BlobAsset(properties); - }; - - /** - * Encodes the specified BlobAsset message. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.BlobAsset.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @static - * @param {google.cloud.documentai.v1beta3.Document.IBlobAsset} message BlobAsset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlobAsset.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.assetId != null && Object.hasOwnProperty.call(message, "assetId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.assetId); - 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); - return writer; - }; - - /** - * Encodes the specified BlobAsset message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.BlobAsset.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @static - * @param {google.cloud.documentai.v1beta3.Document.IBlobAsset} message BlobAsset message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BlobAsset.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BlobAsset message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Document.BlobAsset} BlobAsset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlobAsset.decode = function decode(reader, 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.v1beta3.Document.BlobAsset(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.assetId = reader.string(); - break; - } - case 2: { - message.content = reader.bytes(); - break; - } - case 3: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BlobAsset message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Document.BlobAsset} BlobAsset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BlobAsset.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BlobAsset message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BlobAsset.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.assetId != null && message.hasOwnProperty("assetId")) - if (!$util.isString(message.assetId)) - return "assetId: string 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"; - return null; - }; - - /** - * Creates a BlobAsset message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.BlobAsset} BlobAsset - */ - BlobAsset.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.BlobAsset) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.BlobAsset(); - if (object.assetId != null) - message.assetId = String(object.assetId); - 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); - return message; - }; - - /** - * Creates a plain object from a BlobAsset message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @static - * @param {google.cloud.documentai.v1beta3.Document.BlobAsset} message BlobAsset - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BlobAsset.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.assetId = ""; - if (options.bytes === String) - object.content = ""; - else { - object.content = []; - if (options.bytes !== Array) - object.content = $util.newBuffer(object.content); - } - object.mimeType = ""; - } - if (message.assetId != null && message.hasOwnProperty("assetId")) - object.assetId = message.assetId; - 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; - return object; - }; - - /** - * Converts this BlobAsset to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @instance - * @returns {Object.} JSON object - */ - BlobAsset.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BlobAsset - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Document.BlobAsset - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BlobAsset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Document.BlobAsset"; - }; - - return BlobAsset; - })(); - - Document.EntityValidationOutput = (function() { - - /** - * Properties of an EntityValidationOutput. - * @memberof google.cloud.documentai.v1beta3.Document - * @interface IEntityValidationOutput - * @property {Array.|null} [validationResults] EntityValidationOutput validationResults - * @property {boolean|null} [passAllRules] EntityValidationOutput passAllRules - */ - - /** - * Constructs a new EntityValidationOutput. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents an EntityValidationOutput. - * @implements IEntityValidationOutput - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput - * @instance - */ - EntityValidationOutput.prototype.validationResults = $util.emptyArray; - - /** - * EntityValidationOutput passAllRules. - * @member {boolean} passAllRules - * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput - * @instance - */ - EntityValidationOutput.prototype.passAllRules = false; - - /** - * Creates a new EntityValidationOutput instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput - * @static - * @param {google.cloud.documentai.v1beta3.Document.IEntityValidationOutput=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.EntityValidationOutput} EntityValidationOutput - */ - EntityValidationOutput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput(); - if (object.validationResults) { - if (!Array.isArray(object.validationResults)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.validationResults: object expected"); - message.validationResults[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput"; - }; - - EntityValidationOutput.ValidationResult = (function() { - - /** - * Properties of a ValidationResult. - * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput - * @interface IValidationResult - * @property {string|null} [ruleName] ValidationResult ruleName - * @property {string|null} [ruleDescription] ValidationResult ruleDescription - * @property {google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult.ValidationResultType|null} [validationResultType] ValidationResult validationResultType - * @property {string|null} [validationDetails] ValidationResult validationDetails - */ - - /** - * Constructs a new ValidationResult. - * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput - * @classdesc Represents a ValidationResult. - * @implements IValidationResult - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult - * @instance - */ - ValidationResult.prototype.ruleName = ""; - - /** - * ValidationResult ruleDescription. - * @member {string} ruleDescription - * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult - * @instance - */ - ValidationResult.prototype.ruleDescription = ""; - - /** - * ValidationResult validationResultType. - * @member {google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult.ValidationResultType} validationResultType - * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult - * @instance - */ - ValidationResult.prototype.validationResultType = 0; - - /** - * ValidationResult validationDetails. - * @member {string} validationDetails - * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult - * @instance - */ - ValidationResult.prototype.validationDetails = ""; - - /** - * Creates a new ValidationResult instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult - * @static - * @param {google.cloud.documentai.v1beta3.Document.EntityValidationOutput.IValidationResult=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult} ValidationResult - */ - ValidationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.ValidationResult) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult.ValidationResultType[message.validationResultType] === undefined ? message.validationResultType : $root.google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput.ValidationResult"; - }; - - /** - * ValidationResultType enum. - * @name google.cloud.documentai.v1beta3.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.v1beta3.Document - * @interface IEntitiesRevision - * @property {string|null} [revisionId] EntitiesRevision revisionId - * @property {Array.|null} [entities] EntitiesRevision entities - * @property {google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null} [entityValidationOutput] EntitiesRevision entityValidationOutput - * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] EntitiesRevision provenance - */ - - /** - * Constructs a new EntitiesRevision. - * @memberof google.cloud.documentai.v1beta3.Document - * @classdesc Represents an EntitiesRevision. - * @implements IEntitiesRevision - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntitiesRevision - * @instance - */ - EntitiesRevision.prototype.revisionId = ""; - - /** - * EntitiesRevision entities. - * @member {Array.} entities - * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision - * @instance - */ - EntitiesRevision.prototype.entities = $util.emptyArray; - - /** - * EntitiesRevision entityValidationOutput. - * @member {google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null|undefined} entityValidationOutput - * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision - * @instance - */ - EntitiesRevision.prototype.entityValidationOutput = null; - - /** - * EntitiesRevision provenance. - * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance - * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision - * @instance - */ - EntitiesRevision.prototype.provenance = null; - - /** - * Creates a new EntitiesRevision instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision - * @static - * @param {google.cloud.documentai.v1beta3.Document.IEntitiesRevision=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.Document.EntitiesRevision.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.EntityValidationOutput.encode(message.entityValidationOutput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) - $root.google.cloud.documentai.v1beta3.Document.Provenance.encode(message.provenance, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EntitiesRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Document.EntitiesRevision.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.decode(reader, reader.uint32())); - break; - } - case 3: { - message.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.decode(reader, reader.uint32()); - break; - } - case 4: { - message.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.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.v1beta3.Document.EntitiesRevision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.Entity.verify(message.entities[i]); - if (error) - return "entities." + error; - } - } - if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) { - var error = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.verify(message.entityValidationOutput); - if (error) - return "entityValidationOutput." + error; - } - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.google.cloud.documentai.v1beta3.Document.Provenance.verify(message.provenance); - if (error) - return "provenance." + 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.v1beta3.Document.EntitiesRevision - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Document.EntitiesRevision} EntitiesRevision - */ - EntitiesRevision.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Document.EntitiesRevision) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Document.EntitiesRevision(); - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.Document.EntitiesRevision.entities: object expected"); - message.entities[i] = $root.google.cloud.documentai.v1beta3.Document.Entity.fromObject(object.entities[i]); - } - } - if (object.entityValidationOutput != null) { - if (typeof object.entityValidationOutput !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.EntitiesRevision.entityValidationOutput: object expected"); - message.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.fromObject(object.entityValidationOutput); - } - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Document.EntitiesRevision.provenance: object expected"); - message.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.fromObject(object.provenance); - } - return message; - }; - - /** - * Creates a plain object from an EntitiesRevision message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision - * @static - * @param {google.cloud.documentai.v1beta3.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; - object.provenance = 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.v1beta3.Document.Entity.toObject(message.entities[j], options); - } - if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) - object.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.toObject(message.entityValidationOutput, options); - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); - return object; - }; - - /** - * Converts this EntitiesRevision to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Document.EntitiesRevision"; - }; - - return EntitiesRevision; - })(); - - return Document; - })(); - - v1beta3.RevisionRef = (function() { - - /** - * Properties of a RevisionRef. - * @memberof google.cloud.documentai.v1beta3 - * @interface IRevisionRef - * @property {google.cloud.documentai.v1beta3.RevisionRef.RevisionCase|null} [revisionCase] RevisionRef revisionCase - * @property {string|null} [revisionId] RevisionRef revisionId - * @property {string|null} [latestProcessorVersion] RevisionRef latestProcessorVersion - */ - - /** - * Constructs a new RevisionRef. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a RevisionRef. - * @implements IRevisionRef - * @constructor - * @param {google.cloud.documentai.v1beta3.IRevisionRef=} [properties] Properties to set - */ - function RevisionRef(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RevisionRef revisionCase. - * @member {google.cloud.documentai.v1beta3.RevisionRef.RevisionCase|null|undefined} revisionCase - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @instance - */ - RevisionRef.prototype.revisionCase = null; - - /** - * RevisionRef revisionId. - * @member {string|null|undefined} revisionId - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @instance - */ - RevisionRef.prototype.revisionId = null; - - /** - * RevisionRef latestProcessorVersion. - * @member {string|null|undefined} latestProcessorVersion - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @instance - */ - RevisionRef.prototype.latestProcessorVersion = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RevisionRef source. - * @member {"revisionCase"|"revisionId"|"latestProcessorVersion"|undefined} source - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @instance - */ - Object.defineProperty(RevisionRef.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["revisionCase", "revisionId", "latestProcessorVersion"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RevisionRef instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @static - * @param {google.cloud.documentai.v1beta3.IRevisionRef=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.RevisionRef} RevisionRef instance - */ - RevisionRef.create = function create(properties) { - return new RevisionRef(properties); - }; - - /** - * Encodes the specified RevisionRef message. Does not implicitly {@link google.cloud.documentai.v1beta3.RevisionRef.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @static - * @param {google.cloud.documentai.v1beta3.IRevisionRef} message RevisionRef message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionRef.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.revisionCase != null && Object.hasOwnProperty.call(message, "revisionCase")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.revisionCase); - if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); - if (message.latestProcessorVersion != null && Object.hasOwnProperty.call(message, "latestProcessorVersion")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.latestProcessorVersion); - return writer; - }; - - /** - * Encodes the specified RevisionRef message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RevisionRef.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @static - * @param {google.cloud.documentai.v1beta3.IRevisionRef} message RevisionRef message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RevisionRef.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RevisionRef message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.RevisionRef} RevisionRef - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionRef.decode = function decode(reader, 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.v1beta3.RevisionRef(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.revisionCase = reader.int32(); - break; - } - case 2: { - message.revisionId = reader.string(); - break; - } - case 3: { - message.latestProcessorVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RevisionRef message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.RevisionRef} RevisionRef - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RevisionRef.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RevisionRef message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RevisionRef.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.revisionCase != null && message.hasOwnProperty("revisionCase")) { - properties.source = 1; - switch (message.revisionCase) { - default: - return "revisionCase: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.revisionId != null && message.hasOwnProperty("revisionId")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; - } - if (message.latestProcessorVersion != null && message.hasOwnProperty("latestProcessorVersion")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.latestProcessorVersion)) - return "latestProcessorVersion: string expected"; - } - return null; - }; - - /** - * Creates a RevisionRef message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.RevisionRef} RevisionRef - */ - RevisionRef.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.RevisionRef) - return object; - var message = new $root.google.cloud.documentai.v1beta3.RevisionRef(); - switch (object.revisionCase) { - default: - if (typeof object.revisionCase === "number") { - message.revisionCase = object.revisionCase; - break; - } - break; - case "REVISION_CASE_UNSPECIFIED": - case 0: - message.revisionCase = 0; - break; - case "LATEST_HUMAN_REVIEW": - case 1: - message.revisionCase = 1; - break; - case "LATEST_TIMESTAMP": - case 2: - message.revisionCase = 2; - break; - case "BASE_OCR_REVISION": - case 3: - message.revisionCase = 3; - break; - } - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - if (object.latestProcessorVersion != null) - message.latestProcessorVersion = String(object.latestProcessorVersion); - return message; - }; - - /** - * Creates a plain object from a RevisionRef message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @static - * @param {google.cloud.documentai.v1beta3.RevisionRef} message RevisionRef - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RevisionRef.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.revisionCase != null && message.hasOwnProperty("revisionCase")) { - object.revisionCase = options.enums === String ? $root.google.cloud.documentai.v1beta3.RevisionRef.RevisionCase[message.revisionCase] === undefined ? message.revisionCase : $root.google.cloud.documentai.v1beta3.RevisionRef.RevisionCase[message.revisionCase] : message.revisionCase; - if (options.oneofs) - object.source = "revisionCase"; - } - if (message.revisionId != null && message.hasOwnProperty("revisionId")) { - object.revisionId = message.revisionId; - if (options.oneofs) - object.source = "revisionId"; - } - if (message.latestProcessorVersion != null && message.hasOwnProperty("latestProcessorVersion")) { - object.latestProcessorVersion = message.latestProcessorVersion; - if (options.oneofs) - object.source = "latestProcessorVersion"; - } - return object; - }; - - /** - * Converts this RevisionRef to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @instance - * @returns {Object.} JSON object - */ - RevisionRef.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RevisionRef - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.RevisionRef - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RevisionRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.RevisionRef"; - }; - - /** - * RevisionCase enum. - * @name google.cloud.documentai.v1beta3.RevisionRef.RevisionCase - * @enum {number} - * @property {number} REVISION_CASE_UNSPECIFIED=0 REVISION_CASE_UNSPECIFIED value - * @property {number} LATEST_HUMAN_REVIEW=1 LATEST_HUMAN_REVIEW value - * @property {number} LATEST_TIMESTAMP=2 LATEST_TIMESTAMP value - * @property {number} BASE_OCR_REVISION=3 BASE_OCR_REVISION value - */ - RevisionRef.RevisionCase = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REVISION_CASE_UNSPECIFIED"] = 0; - values[valuesById[1] = "LATEST_HUMAN_REVIEW"] = 1; - values[valuesById[2] = "LATEST_TIMESTAMP"] = 2; - values[valuesById[3] = "BASE_OCR_REVISION"] = 3; - return values; - })(); - - return RevisionRef; - })(); - - v1beta3.Vertex = (function() { - - /** - * Properties of a Vertex. - * @memberof google.cloud.documentai.v1beta3 - * @interface IVertex - * @property {number|null} [x] Vertex x - * @property {number|null} [y] Vertex y - */ - - /** - * Constructs a new Vertex. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a Vertex. - * @implements IVertex - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Vertex - * @instance - */ - Vertex.prototype.x = 0; - - /** - * Vertex y. - * @member {number} y - * @memberof google.cloud.documentai.v1beta3.Vertex - * @instance - */ - Vertex.prototype.y = 0; - - /** - * Creates a new Vertex instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Vertex - * @static - * @param {google.cloud.documentai.v1beta3.IVertex=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Vertex} Vertex instance - */ - Vertex.create = function create(properties) { - return new Vertex(properties); - }; - - /** - * Encodes the specified Vertex message. Does not implicitly {@link google.cloud.documentai.v1beta3.Vertex.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Vertex - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.Vertex.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Vertex - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Vertex - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.Vertex - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Vertex} Vertex - */ - Vertex.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Vertex) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.Vertex - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Vertex"; - }; - - return Vertex; - })(); - - v1beta3.NormalizedVertex = (function() { - - /** - * Properties of a NormalizedVertex. - * @memberof google.cloud.documentai.v1beta3 - * @interface INormalizedVertex - * @property {number|null} [x] NormalizedVertex x - * @property {number|null} [y] NormalizedVertex y - */ - - /** - * Constructs a new NormalizedVertex. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a NormalizedVertex. - * @implements INormalizedVertex - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.NormalizedVertex - * @instance - */ - NormalizedVertex.prototype.x = 0; - - /** - * NormalizedVertex y. - * @member {number} y - * @memberof google.cloud.documentai.v1beta3.NormalizedVertex - * @instance - */ - NormalizedVertex.prototype.y = 0; - - /** - * Creates a new NormalizedVertex instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.NormalizedVertex - * @static - * @param {google.cloud.documentai.v1beta3.INormalizedVertex=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.NormalizedVertex} NormalizedVertex instance - */ - NormalizedVertex.create = function create(properties) { - return new NormalizedVertex(properties); - }; - - /** - * Encodes the specified NormalizedVertex message. Does not implicitly {@link google.cloud.documentai.v1beta3.NormalizedVertex.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.NormalizedVertex - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.NormalizedVertex.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.NormalizedVertex - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.NormalizedVertex - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.NormalizedVertex - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.NormalizedVertex} NormalizedVertex - */ - NormalizedVertex.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.NormalizedVertex) - return object; - var message = new $root.google.cloud.documentai.v1beta3.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.v1beta3.NormalizedVertex - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.NormalizedVertex"; - }; - - return NormalizedVertex; - })(); - - v1beta3.BoundingPoly = (function() { - - /** - * Properties of a BoundingPoly. - * @memberof google.cloud.documentai.v1beta3 - * @interface IBoundingPoly - * @property {Array.|null} [vertices] BoundingPoly vertices - * @property {Array.|null} [normalizedVertices] BoundingPoly normalizedVertices - */ - - /** - * Constructs a new BoundingPoly. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a BoundingPoly. - * @implements IBoundingPoly - * @constructor - * @param {google.cloud.documentai.v1beta3.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.v1beta3.BoundingPoly - * @instance - */ - BoundingPoly.prototype.vertices = $util.emptyArray; - - /** - * BoundingPoly normalizedVertices. - * @member {Array.} normalizedVertices - * @memberof google.cloud.documentai.v1beta3.BoundingPoly - * @instance - */ - BoundingPoly.prototype.normalizedVertices = $util.emptyArray; - - /** - * Creates a new BoundingPoly instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BoundingPoly - * @static - * @param {google.cloud.documentai.v1beta3.IBoundingPoly=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BoundingPoly} BoundingPoly instance - */ - BoundingPoly.create = function create(properties) { - return new BoundingPoly(properties); - }; - - /** - * Encodes the specified BoundingPoly message. Does not implicitly {@link google.cloud.documentai.v1beta3.BoundingPoly.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BoundingPoly - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.BoundingPoly.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BoundingPoly - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.Vertex.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.normalizedVertices && message.normalizedVertices.length)) - message.normalizedVertices = []; - message.normalizedVertices.push($root.google.cloud.documentai.v1beta3.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.v1beta3.BoundingPoly - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.BoundingPoly - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BoundingPoly} BoundingPoly - */ - BoundingPoly.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BoundingPoly) - return object; - var message = new $root.google.cloud.documentai.v1beta3.BoundingPoly(); - if (object.vertices) { - if (!Array.isArray(object.vertices)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.BoundingPoly.vertices: object expected"); - message.vertices[i] = $root.google.cloud.documentai.v1beta3.Vertex.fromObject(object.vertices[i]); - } - } - if (object.normalizedVertices) { - if (!Array.isArray(object.normalizedVertices)) - throw TypeError(".google.cloud.documentai.v1beta3.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.v1beta3.BoundingPoly.normalizedVertices: object expected"); - message.normalizedVertices[i] = $root.google.cloud.documentai.v1beta3.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.v1beta3.BoundingPoly - * @static - * @param {google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.NormalizedVertex.toObject(message.normalizedVertices[j], options); - } - return object; - }; - - /** - * Converts this BoundingPoly to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.v1beta3.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.v1beta3.BoundingPoly"; - }; - - return BoundingPoly; - })(); - - v1beta3.Documents = (function() { - - /** - * Properties of a Documents. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDocuments - * @property {Array.|null} [documents] Documents documents - */ - - /** - * Constructs a new Documents. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a Documents. - * @implements IDocuments - * @constructor - * @param {google.cloud.documentai.v1beta3.IDocuments=} [properties] Properties to set - */ - function Documents(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]]; - } - - /** - * Documents documents. - * @member {Array.} documents - * @memberof google.cloud.documentai.v1beta3.Documents - * @instance - */ - Documents.prototype.documents = $util.emptyArray; - - /** - * Creates a new Documents instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Documents - * @static - * @param {google.cloud.documentai.v1beta3.IDocuments=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Documents} Documents instance - */ - Documents.create = function create(properties) { - return new Documents(properties); - }; - - /** - * Encodes the specified Documents message. Does not implicitly {@link google.cloud.documentai.v1beta3.Documents.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Documents - * @static - * @param {google.cloud.documentai.v1beta3.IDocuments} message Documents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documents.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) - $root.google.cloud.documentai.v1beta3.Document.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Documents message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Documents.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Documents - * @static - * @param {google.cloud.documentai.v1beta3.IDocuments} message Documents message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Documents.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Documents message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Documents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Documents} Documents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documents.decode = function decode(reader, 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.v1beta3.Documents(); - 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($root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Documents message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Documents - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Documents} Documents - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Documents.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Documents message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Documents - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Documents.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) { - var error = $root.google.cloud.documentai.v1beta3.Document.verify(message.documents[i]); - if (error) - return "documents." + error; - } - } - return null; - }; - - /** - * Creates a Documents message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Documents - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Documents} Documents - */ - Documents.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Documents) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Documents(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".google.cloud.documentai.v1beta3.Documents.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) { - if (typeof object.documents[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Documents.documents: object expected"); - message.documents[i] = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.documents[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Documents message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Documents - * @static - * @param {google.cloud.documentai.v1beta3.Documents} message Documents - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Documents.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = $root.google.cloud.documentai.v1beta3.Document.toObject(message.documents[j], options); - } - return object; - }; - - /** - * Converts this Documents to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Documents - * @instance - * @returns {Object.} JSON object - */ - Documents.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Documents - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Documents - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Documents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Documents"; - }; - - return Documents; - })(); - - v1beta3.RawDocument = (function() { - - /** - * Properties of a RawDocument. - * @memberof google.cloud.documentai.v1beta3 - * @interface IRawDocument - * @property {Uint8Array|null} [content] RawDocument content - * @property {string|null} [mimeType] RawDocument mimeType - * @property {string|null} [displayName] RawDocument displayName - */ - - /** - * Constructs a new RawDocument. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a RawDocument. - * @implements IRawDocument - * @constructor - * @param {google.cloud.documentai.v1beta3.IRawDocument=} [properties] Properties to set - */ - function RawDocument(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RawDocument content. - * @member {Uint8Array} content - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @instance - */ - RawDocument.prototype.content = $util.newBuffer([]); - - /** - * RawDocument mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @instance - */ - RawDocument.prototype.mimeType = ""; - - /** - * RawDocument displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @instance - */ - RawDocument.prototype.displayName = ""; - - /** - * Creates a new RawDocument instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @static - * @param {google.cloud.documentai.v1beta3.IRawDocument=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.RawDocument} RawDocument instance - */ - RawDocument.create = function create(properties) { - return new RawDocument(properties); - }; - - /** - * Encodes the specified RawDocument message. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocument.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @static - * @param {google.cloud.documentai.v1beta3.IRawDocument} message RawDocument message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RawDocument.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified RawDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocument.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @static - * @param {google.cloud.documentai.v1beta3.IRawDocument} message RawDocument message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RawDocument.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RawDocument message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.RawDocument} RawDocument - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RawDocument.decode = function decode(reader, 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.v1beta3.RawDocument(); - 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.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RawDocument message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.RawDocument} RawDocument - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RawDocument.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RawDocument message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RawDocument.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates a RawDocument message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.RawDocument} RawDocument - */ - RawDocument.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.RawDocument) - return object; - var message = new $root.google.cloud.documentai.v1beta3.RawDocument(); - 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.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from a RawDocument message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @static - * @param {google.cloud.documentai.v1beta3.RawDocument} message RawDocument - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RawDocument.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.displayName = ""; - } - 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.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this RawDocument to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @instance - * @returns {Object.} JSON object - */ - RawDocument.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RawDocument - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.RawDocument - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RawDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.RawDocument"; - }; - - return RawDocument; - })(); - - v1beta3.GcsDocument = (function() { - - /** - * Properties of a GcsDocument. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGcsDocument - * @property {string|null} [gcsUri] GcsDocument gcsUri - * @property {string|null} [mimeType] GcsDocument mimeType - */ - - /** - * Constructs a new GcsDocument. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a GcsDocument. - * @implements IGcsDocument - * @constructor - * @param {google.cloud.documentai.v1beta3.IGcsDocument=} [properties] Properties to set - */ - function GcsDocument(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GcsDocument gcsUri. - * @member {string} gcsUri - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @instance - */ - GcsDocument.prototype.gcsUri = ""; - - /** - * GcsDocument mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @instance - */ - GcsDocument.prototype.mimeType = ""; - - /** - * Creates a new GcsDocument instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @static - * @param {google.cloud.documentai.v1beta3.IGcsDocument=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.GcsDocument} GcsDocument instance - */ - GcsDocument.create = function create(properties) { - return new GcsDocument(properties); - }; - - /** - * Encodes the specified GcsDocument message. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocument.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @static - * @param {google.cloud.documentai.v1beta3.IGcsDocument} message GcsDocument message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDocument.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - return writer; - }; - - /** - * Encodes the specified GcsDocument message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocument.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @static - * @param {google.cloud.documentai.v1beta3.IGcsDocument} message GcsDocument message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDocument.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsDocument message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.GcsDocument} GcsDocument - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDocument.decode = function decode(reader, 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.v1beta3.GcsDocument(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsUri = reader.string(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsDocument message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.GcsDocument} GcsDocument - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDocument.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsDocument message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsDocument.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - return null; - }; - - /** - * Creates a GcsDocument message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.GcsDocument} GcsDocument - */ - GcsDocument.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.GcsDocument) - return object; - var message = new $root.google.cloud.documentai.v1beta3.GcsDocument(); - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - return message; - }; - - /** - * Creates a plain object from a GcsDocument message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @static - * @param {google.cloud.documentai.v1beta3.GcsDocument} message GcsDocument - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsDocument.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcsUri = ""; - object.mimeType = ""; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - object.gcsUri = message.gcsUri; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - return object; - }; - - /** - * Converts this GcsDocument to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @instance - * @returns {Object.} JSON object - */ - GcsDocument.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsDocument - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.GcsDocument - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsDocument.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GcsDocument"; - }; - - return GcsDocument; - })(); - - v1beta3.GcsDocuments = (function() { - - /** - * Properties of a GcsDocuments. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGcsDocuments - * @property {Array.|null} [documents] GcsDocuments documents - */ - - /** - * Constructs a new GcsDocuments. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a GcsDocuments. - * @implements IGcsDocuments - * @constructor - * @param {google.cloud.documentai.v1beta3.IGcsDocuments=} [properties] Properties to set - */ - function GcsDocuments(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]]; - } - - /** - * GcsDocuments documents. - * @member {Array.} documents - * @memberof google.cloud.documentai.v1beta3.GcsDocuments - * @instance - */ - GcsDocuments.prototype.documents = $util.emptyArray; - - /** - * Creates a new GcsDocuments instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.GcsDocuments - * @static - * @param {google.cloud.documentai.v1beta3.IGcsDocuments=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.GcsDocuments} GcsDocuments instance - */ - GcsDocuments.create = function create(properties) { - return new GcsDocuments(properties); - }; - - /** - * Encodes the specified GcsDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocuments.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.GcsDocuments - * @static - * @param {google.cloud.documentai.v1beta3.IGcsDocuments} message GcsDocuments message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDocuments.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) - $root.google.cloud.documentai.v1beta3.GcsDocument.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GcsDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsDocuments.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.GcsDocuments - * @static - * @param {google.cloud.documentai.v1beta3.IGcsDocuments} message GcsDocuments message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsDocuments.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsDocuments message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.GcsDocuments - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.GcsDocuments} GcsDocuments - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDocuments.decode = function decode(reader, 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.v1beta3.GcsDocuments(); - 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($root.google.cloud.documentai.v1beta3.GcsDocument.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsDocuments message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.GcsDocuments - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.GcsDocuments} GcsDocuments - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsDocuments.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsDocuments message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.GcsDocuments - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsDocuments.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) { - var error = $root.google.cloud.documentai.v1beta3.GcsDocument.verify(message.documents[i]); - if (error) - return "documents." + error; - } - } - return null; - }; - - /** - * Creates a GcsDocuments message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.GcsDocuments - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.GcsDocuments} GcsDocuments - */ - GcsDocuments.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.GcsDocuments) - return object; - var message = new $root.google.cloud.documentai.v1beta3.GcsDocuments(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".google.cloud.documentai.v1beta3.GcsDocuments.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) { - if (typeof object.documents[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.GcsDocuments.documents: object expected"); - message.documents[i] = $root.google.cloud.documentai.v1beta3.GcsDocument.fromObject(object.documents[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GcsDocuments message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.GcsDocuments - * @static - * @param {google.cloud.documentai.v1beta3.GcsDocuments} message GcsDocuments - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsDocuments.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = $root.google.cloud.documentai.v1beta3.GcsDocument.toObject(message.documents[j], options); - } - return object; - }; - - /** - * Converts this GcsDocuments to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.GcsDocuments - * @instance - * @returns {Object.} JSON object - */ - GcsDocuments.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsDocuments - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.GcsDocuments - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsDocuments.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GcsDocuments"; - }; - - return GcsDocuments; - })(); - - v1beta3.GcsPrefix = (function() { - - /** - * Properties of a GcsPrefix. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGcsPrefix - * @property {string|null} [gcsUriPrefix] GcsPrefix gcsUriPrefix - */ - - /** - * Constructs a new GcsPrefix. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a GcsPrefix. - * @implements IGcsPrefix - * @constructor - * @param {google.cloud.documentai.v1beta3.IGcsPrefix=} [properties] Properties to set - */ - function GcsPrefix(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GcsPrefix gcsUriPrefix. - * @member {string} gcsUriPrefix - * @memberof google.cloud.documentai.v1beta3.GcsPrefix - * @instance - */ - GcsPrefix.prototype.gcsUriPrefix = ""; - - /** - * Creates a new GcsPrefix instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.GcsPrefix - * @static - * @param {google.cloud.documentai.v1beta3.IGcsPrefix=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.GcsPrefix} GcsPrefix instance - */ - GcsPrefix.create = function create(properties) { - return new GcsPrefix(properties); - }; - - /** - * Encodes the specified GcsPrefix message. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsPrefix.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.GcsPrefix - * @static - * @param {google.cloud.documentai.v1beta3.IGcsPrefix} message GcsPrefix message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsPrefix.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsUriPrefix != null && Object.hasOwnProperty.call(message, "gcsUriPrefix")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUriPrefix); - return writer; - }; - - /** - * Encodes the specified GcsPrefix message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GcsPrefix.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.GcsPrefix - * @static - * @param {google.cloud.documentai.v1beta3.IGcsPrefix} message GcsPrefix message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsPrefix.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsPrefix message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.GcsPrefix - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.GcsPrefix} GcsPrefix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsPrefix.decode = function decode(reader, 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.v1beta3.GcsPrefix(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsUriPrefix = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsPrefix message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.GcsPrefix - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.GcsPrefix} GcsPrefix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsPrefix.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsPrefix message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.GcsPrefix - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsPrefix.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsUriPrefix != null && message.hasOwnProperty("gcsUriPrefix")) - if (!$util.isString(message.gcsUriPrefix)) - return "gcsUriPrefix: string expected"; - return null; - }; - - /** - * Creates a GcsPrefix message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.GcsPrefix - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.GcsPrefix} GcsPrefix - */ - GcsPrefix.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.GcsPrefix) - return object; - var message = new $root.google.cloud.documentai.v1beta3.GcsPrefix(); - if (object.gcsUriPrefix != null) - message.gcsUriPrefix = String(object.gcsUriPrefix); - return message; - }; - - /** - * Creates a plain object from a GcsPrefix message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.GcsPrefix - * @static - * @param {google.cloud.documentai.v1beta3.GcsPrefix} message GcsPrefix - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsPrefix.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.gcsUriPrefix = ""; - if (message.gcsUriPrefix != null && message.hasOwnProperty("gcsUriPrefix")) - object.gcsUriPrefix = message.gcsUriPrefix; - return object; - }; - - /** - * Converts this GcsPrefix to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.GcsPrefix - * @instance - * @returns {Object.} JSON object - */ - GcsPrefix.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsPrefix - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.GcsPrefix - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsPrefix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GcsPrefix"; - }; - - return GcsPrefix; - })(); - - v1beta3.RawDocuments = (function() { - - /** - * Properties of a RawDocuments. - * @memberof google.cloud.documentai.v1beta3 - * @interface IRawDocuments - * @property {Array.|null} [documents] RawDocuments documents - */ - - /** - * Constructs a new RawDocuments. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a RawDocuments. - * @implements IRawDocuments - * @constructor - * @param {google.cloud.documentai.v1beta3.IRawDocuments=} [properties] Properties to set - */ - function RawDocuments(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]]; - } - - /** - * RawDocuments documents. - * @member {Array.} documents - * @memberof google.cloud.documentai.v1beta3.RawDocuments - * @instance - */ - RawDocuments.prototype.documents = $util.emptyArray; - - /** - * Creates a new RawDocuments instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.RawDocuments - * @static - * @param {google.cloud.documentai.v1beta3.IRawDocuments=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.RawDocuments} RawDocuments instance - */ - RawDocuments.create = function create(properties) { - return new RawDocuments(properties); - }; - - /** - * Encodes the specified RawDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocuments.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.RawDocuments - * @static - * @param {google.cloud.documentai.v1beta3.IRawDocuments} message RawDocuments message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RawDocuments.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) - $root.google.cloud.documentai.v1beta3.RawDocument.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RawDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocuments.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.RawDocuments - * @static - * @param {google.cloud.documentai.v1beta3.IRawDocuments} message RawDocuments message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RawDocuments.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RawDocuments message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.RawDocuments - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.RawDocuments} RawDocuments - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RawDocuments.decode = function decode(reader, 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.v1beta3.RawDocuments(); - 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($root.google.cloud.documentai.v1beta3.RawDocument.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RawDocuments message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.RawDocuments - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.RawDocuments} RawDocuments - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RawDocuments.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RawDocuments message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.RawDocuments - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RawDocuments.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) { - var error = $root.google.cloud.documentai.v1beta3.RawDocument.verify(message.documents[i]); - if (error) - return "documents." + error; - } - } - return null; - }; - - /** - * Creates a RawDocuments message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.RawDocuments - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.RawDocuments} RawDocuments - */ - RawDocuments.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.RawDocuments) - return object; - var message = new $root.google.cloud.documentai.v1beta3.RawDocuments(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".google.cloud.documentai.v1beta3.RawDocuments.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) { - if (typeof object.documents[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.RawDocuments.documents: object expected"); - message.documents[i] = $root.google.cloud.documentai.v1beta3.RawDocument.fromObject(object.documents[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a RawDocuments message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.RawDocuments - * @static - * @param {google.cloud.documentai.v1beta3.RawDocuments} message RawDocuments - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RawDocuments.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = $root.google.cloud.documentai.v1beta3.RawDocument.toObject(message.documents[j], options); - } - return object; - }; - - /** - * Converts this RawDocuments to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.RawDocuments - * @instance - * @returns {Object.} JSON object - */ - RawDocuments.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RawDocuments - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.RawDocuments - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RawDocuments.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.RawDocuments"; - }; - - return RawDocuments; - })(); - - v1beta3.BatchDocumentsInputConfig = (function() { - - /** - * Properties of a BatchDocumentsInputConfig. - * @memberof google.cloud.documentai.v1beta3 - * @interface IBatchDocumentsInputConfig - * @property {google.cloud.documentai.v1beta3.IGcsPrefix|null} [gcsPrefix] BatchDocumentsInputConfig gcsPrefix - * @property {google.cloud.documentai.v1beta3.IGcsDocuments|null} [gcsDocuments] BatchDocumentsInputConfig gcsDocuments - */ - - /** - * Constructs a new BatchDocumentsInputConfig. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a BatchDocumentsInputConfig. - * @implements IBatchDocumentsInputConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig=} [properties] Properties to set - */ - function BatchDocumentsInputConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDocumentsInputConfig gcsPrefix. - * @member {google.cloud.documentai.v1beta3.IGcsPrefix|null|undefined} gcsPrefix - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @instance - */ - BatchDocumentsInputConfig.prototype.gcsPrefix = null; - - /** - * BatchDocumentsInputConfig gcsDocuments. - * @member {google.cloud.documentai.v1beta3.IGcsDocuments|null|undefined} gcsDocuments - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @instance - */ - BatchDocumentsInputConfig.prototype.gcsDocuments = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BatchDocumentsInputConfig source. - * @member {"gcsPrefix"|"gcsDocuments"|undefined} source - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @instance - */ - Object.defineProperty(BatchDocumentsInputConfig.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["gcsPrefix", "gcsDocuments"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BatchDocumentsInputConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} BatchDocumentsInputConfig instance - */ - BatchDocumentsInputConfig.create = function create(properties) { - return new BatchDocumentsInputConfig(properties); - }; - - /** - * Encodes the specified BatchDocumentsInputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig} message BatchDocumentsInputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDocumentsInputConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsPrefix != null && Object.hasOwnProperty.call(message, "gcsPrefix")) - $root.google.cloud.documentai.v1beta3.GcsPrefix.encode(message.gcsPrefix, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.gcsDocuments != null && Object.hasOwnProperty.call(message, "gcsDocuments")) - $root.google.cloud.documentai.v1beta3.GcsDocuments.encode(message.gcsDocuments, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchDocumentsInputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig} message BatchDocumentsInputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDocumentsInputConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} BatchDocumentsInputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDocumentsInputConfig.decode = function decode(reader, 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.v1beta3.BatchDocumentsInputConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.decode(reader, reader.uint32()); - break; - } - case 2: { - message.gcsDocuments = $root.google.cloud.documentai.v1beta3.GcsDocuments.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchDocumentsInputConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} BatchDocumentsInputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDocumentsInputConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchDocumentsInputConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDocumentsInputConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1beta3.GcsPrefix.verify(message.gcsPrefix); - if (error) - return "gcsPrefix." + error; - } - } - if (message.gcsDocuments != null && message.hasOwnProperty("gcsDocuments")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1beta3.GcsDocuments.verify(message.gcsDocuments); - if (error) - return "gcsDocuments." + error; - } - } - return null; - }; - - /** - * Creates a BatchDocumentsInputConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} BatchDocumentsInputConfig - */ - BatchDocumentsInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig(); - if (object.gcsPrefix != null) { - if (typeof object.gcsPrefix !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.gcsPrefix: object expected"); - message.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.fromObject(object.gcsPrefix); - } - if (object.gcsDocuments != null) { - if (typeof object.gcsDocuments !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.gcsDocuments: object expected"); - message.gcsDocuments = $root.google.cloud.documentai.v1beta3.GcsDocuments.fromObject(object.gcsDocuments); - } - return message; - }; - - /** - * Creates a plain object from a BatchDocumentsInputConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @static - * @param {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} message BatchDocumentsInputConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDocumentsInputConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.gcsPrefix != null && message.hasOwnProperty("gcsPrefix")) { - object.gcsPrefix = $root.google.cloud.documentai.v1beta3.GcsPrefix.toObject(message.gcsPrefix, options); - if (options.oneofs) - object.source = "gcsPrefix"; - } - if (message.gcsDocuments != null && message.hasOwnProperty("gcsDocuments")) { - object.gcsDocuments = $root.google.cloud.documentai.v1beta3.GcsDocuments.toObject(message.gcsDocuments, options); - if (options.oneofs) - object.source = "gcsDocuments"; - } - return object; - }; - - /** - * Converts this BatchDocumentsInputConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @instance - * @returns {Object.} JSON object - */ - BatchDocumentsInputConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchDocumentsInputConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchDocumentsInputConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchDocumentsInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDocumentsInputConfig"; - }; - - return BatchDocumentsInputConfig; - })(); - - v1beta3.DocumentOutputConfig = (function() { - - /** - * Properties of a DocumentOutputConfig. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDocumentOutputConfig - * @property {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null} [gcsOutputConfig] DocumentOutputConfig gcsOutputConfig - */ - - /** - * Constructs a new DocumentOutputConfig. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DocumentOutputConfig. - * @implements IDocumentOutputConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.IDocumentOutputConfig=} [properties] Properties to set - */ - function DocumentOutputConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DocumentOutputConfig gcsOutputConfig. - * @member {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig|null|undefined} gcsOutputConfig - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @instance - */ - DocumentOutputConfig.prototype.gcsOutputConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DocumentOutputConfig destination. - * @member {"gcsOutputConfig"|undefined} destination - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @instance - */ - Object.defineProperty(DocumentOutputConfig.prototype, "destination", { - get: $util.oneOfGetter($oneOfFields = ["gcsOutputConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DocumentOutputConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentOutputConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig} DocumentOutputConfig instance - */ - DocumentOutputConfig.create = function create(properties) { - return new DocumentOutputConfig(properties); - }; - - /** - * Encodes the specified DocumentOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentOutputConfig} message DocumentOutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentOutputConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsOutputConfig != null && Object.hasOwnProperty.call(message, "gcsOutputConfig")) - $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.encode(message.gcsOutputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DocumentOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentOutputConfig} message DocumentOutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentOutputConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig} DocumentOutputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentOutputConfig.decode = function decode(reader, 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.v1beta3.DocumentOutputConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentOutputConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig} DocumentOutputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentOutputConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentOutputConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentOutputConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcsOutputConfig != null && message.hasOwnProperty("gcsOutputConfig")) { - properties.destination = 1; - { - var error = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.verify(message.gcsOutputConfig); - if (error) - return "gcsOutputConfig." + error; - } - } - return null; - }; - - /** - * Creates a DocumentOutputConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig} DocumentOutputConfig - */ - DocumentOutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentOutputConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentOutputConfig(); - if (object.gcsOutputConfig != null) { - if (typeof object.gcsOutputConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DocumentOutputConfig.gcsOutputConfig: object expected"); - message.gcsOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.fromObject(object.gcsOutputConfig); - } - return message; - }; - - /** - * Creates a plain object from a DocumentOutputConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig} message DocumentOutputConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentOutputConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.gcsOutputConfig != null && message.hasOwnProperty("gcsOutputConfig")) { - object.gcsOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.toObject(message.gcsOutputConfig, options); - if (options.oneofs) - object.destination = "gcsOutputConfig"; - } - return object; - }; - - /** - * Converts this DocumentOutputConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @instance - * @returns {Object.} JSON object - */ - DocumentOutputConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentOutputConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentOutputConfig"; - }; - - DocumentOutputConfig.GcsOutputConfig = (function() { - - /** - * Properties of a GcsOutputConfig. - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @interface IGcsOutputConfig - * @property {string|null} [gcsUri] GcsOutputConfig gcsUri - * @property {google.protobuf.IFieldMask|null} [fieldMask] GcsOutputConfig fieldMask - * @property {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null} [shardingConfig] GcsOutputConfig shardingConfig - */ - - /** - * Constructs a new GcsOutputConfig. - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig - * @classdesc Represents a GcsOutputConfig. - * @implements IGcsOutputConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig=} [properties] Properties to set - */ - function GcsOutputConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GcsOutputConfig gcsUri. - * @member {string} gcsUri - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @instance - */ - GcsOutputConfig.prototype.gcsUri = ""; - - /** - * GcsOutputConfig fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @instance - */ - GcsOutputConfig.prototype.fieldMask = null; - - /** - * GcsOutputConfig shardingConfig. - * @member {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig|null|undefined} shardingConfig - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @instance - */ - GcsOutputConfig.prototype.shardingConfig = null; - - /** - * Creates a new GcsOutputConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig instance - */ - GcsOutputConfig.create = function create(properties) { - return new GcsOutputConfig(properties); - }; - - /** - * Encodes the specified GcsOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig} message GcsOutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsOutputConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri); - if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.shardingConfig != null && Object.hasOwnProperty.call(message, "shardingConfig")) - $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.encode(message.shardingConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GcsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.IGcsOutputConfig} message GcsOutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcsOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcsOutputConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsOutputConfig.decode = function decode(reader, 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.v1beta3.DocumentOutputConfig.GcsOutputConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsUri = reader.string(); - break; - } - case 2: { - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.shardingConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcsOutputConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcsOutputConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcsOutputConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcsOutputConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - if (!$util.isString(message.gcsUri)) - return "gcsUri: string expected"; - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); - if (error) - return "fieldMask." + error; - } - if (message.shardingConfig != null && message.hasOwnProperty("shardingConfig")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify(message.shardingConfig); - if (error) - return "shardingConfig." + error; - } - return null; - }; - - /** - * Creates a GcsOutputConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} GcsOutputConfig - */ - GcsOutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig(); - if (object.gcsUri != null) - message.gcsUri = String(object.gcsUri); - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); - } - if (object.shardingConfig != null) { - if (typeof object.shardingConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.shardingConfig: object expected"); - message.shardingConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.fromObject(object.shardingConfig); - } - return message; - }; - - /** - * Creates a plain object from a GcsOutputConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig} message GcsOutputConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcsOutputConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcsUri = ""; - object.fieldMask = null; - object.shardingConfig = null; - } - if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) - object.gcsUri = message.gcsUri; - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - if (message.shardingConfig != null && message.hasOwnProperty("shardingConfig")) - object.shardingConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.toObject(message.shardingConfig, options); - return object; - }; - - /** - * Converts this GcsOutputConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @instance - * @returns {Object.} JSON object - */ - GcsOutputConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcsOutputConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcsOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig"; - }; - - GcsOutputConfig.ShardingConfig = (function() { - - /** - * Properties of a ShardingConfig. - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @interface IShardingConfig - * @property {number|null} [pagesPerShard] ShardingConfig pagesPerShard - * @property {number|null} [pagesOverlap] ShardingConfig pagesOverlap - */ - - /** - * Constructs a new ShardingConfig. - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig - * @classdesc Represents a ShardingConfig. - * @implements IShardingConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig=} [properties] Properties to set - */ - function ShardingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ShardingConfig pagesPerShard. - * @member {number} pagesPerShard - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @instance - */ - ShardingConfig.prototype.pagesPerShard = 0; - - /** - * ShardingConfig pagesOverlap. - * @member {number} pagesOverlap - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @instance - */ - ShardingConfig.prototype.pagesOverlap = 0; - - /** - * Creates a new ShardingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig instance - */ - ShardingConfig.create = function create(properties) { - return new ShardingConfig(properties); - }; - - /** - * Encodes the specified ShardingConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig} message ShardingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShardingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pagesPerShard != null && Object.hasOwnProperty.call(message, "pagesPerShard")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pagesPerShard); - if (message.pagesOverlap != null && Object.hasOwnProperty.call(message, "pagesOverlap")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pagesOverlap); - return writer; - }; - - /** - * Encodes the specified ShardingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.IShardingConfig} message ShardingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShardingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ShardingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShardingConfig.decode = function decode(reader, 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.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pagesPerShard = reader.int32(); - break; - } - case 2: { - message.pagesOverlap = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ShardingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShardingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ShardingConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ShardingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pagesPerShard != null && message.hasOwnProperty("pagesPerShard")) - if (!$util.isInteger(message.pagesPerShard)) - return "pagesPerShard: integer expected"; - if (message.pagesOverlap != null && message.hasOwnProperty("pagesOverlap")) - if (!$util.isInteger(message.pagesOverlap)) - return "pagesOverlap: integer expected"; - return null; - }; - - /** - * Creates a ShardingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} ShardingConfig - */ - ShardingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig(); - if (object.pagesPerShard != null) - message.pagesPerShard = object.pagesPerShard | 0; - if (object.pagesOverlap != null) - message.pagesOverlap = object.pagesOverlap | 0; - return message; - }; - - /** - * Creates a plain object from a ShardingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig} message ShardingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ShardingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.pagesPerShard = 0; - object.pagesOverlap = 0; - } - if (message.pagesPerShard != null && message.hasOwnProperty("pagesPerShard")) - object.pagesPerShard = message.pagesPerShard; - if (message.pagesOverlap != null && message.hasOwnProperty("pagesOverlap")) - object.pagesOverlap = message.pagesOverlap; - return object; - }; - - /** - * Converts this ShardingConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @instance - * @returns {Object.} JSON object - */ - ShardingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ShardingConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ShardingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.ShardingConfig"; - }; - - return ShardingConfig; - })(); - - return GcsOutputConfig; - })(); - - return DocumentOutputConfig; - })(); - - v1beta3.OcrConfig = (function() { - - /** - * Properties of an OcrConfig. - * @memberof google.cloud.documentai.v1beta3 - * @interface IOcrConfig - * @property {google.cloud.documentai.v1beta3.OcrConfig.IHints|null} [hints] OcrConfig hints - * @property {boolean|null} [enableNativePdfParsing] OcrConfig enableNativePdfParsing - * @property {boolean|null} [enableImageQualityScores] OcrConfig enableImageQualityScores - * @property {Array.|null} [advancedOcrOptions] OcrConfig advancedOcrOptions - * @property {boolean|null} [enableSymbol] OcrConfig enableSymbol - * @property {boolean|null} [computeStyleInfo] OcrConfig computeStyleInfo - * @property {boolean|null} [disableCharacterBoxesDetection] OcrConfig disableCharacterBoxesDetection - * @property {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures|null} [premiumFeatures] OcrConfig premiumFeatures - */ - - /** - * Constructs a new OcrConfig. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an OcrConfig. - * @implements IOcrConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.IOcrConfig=} [properties] Properties to set - */ - function OcrConfig(properties) { - this.advancedOcrOptions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OcrConfig hints. - * @member {google.cloud.documentai.v1beta3.OcrConfig.IHints|null|undefined} hints - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @instance - */ - OcrConfig.prototype.hints = null; - - /** - * OcrConfig enableNativePdfParsing. - * @member {boolean} enableNativePdfParsing - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @instance - */ - OcrConfig.prototype.enableNativePdfParsing = false; - - /** - * OcrConfig enableImageQualityScores. - * @member {boolean} enableImageQualityScores - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @instance - */ - OcrConfig.prototype.enableImageQualityScores = false; - - /** - * OcrConfig advancedOcrOptions. - * @member {Array.} advancedOcrOptions - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @instance - */ - OcrConfig.prototype.advancedOcrOptions = $util.emptyArray; - - /** - * OcrConfig enableSymbol. - * @member {boolean} enableSymbol - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @instance - */ - OcrConfig.prototype.enableSymbol = false; - - /** - * OcrConfig computeStyleInfo. - * @member {boolean} computeStyleInfo - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @instance - */ - OcrConfig.prototype.computeStyleInfo = false; - - /** - * OcrConfig disableCharacterBoxesDetection. - * @member {boolean} disableCharacterBoxesDetection - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @instance - */ - OcrConfig.prototype.disableCharacterBoxesDetection = false; - - /** - * OcrConfig premiumFeatures. - * @member {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures|null|undefined} premiumFeatures - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @instance - */ - OcrConfig.prototype.premiumFeatures = null; - - /** - * Creates a new OcrConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @static - * @param {google.cloud.documentai.v1beta3.IOcrConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig instance - */ - OcrConfig.create = function create(properties) { - return new OcrConfig(properties); - }; - - /** - * Encodes the specified OcrConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @static - * @param {google.cloud.documentai.v1beta3.IOcrConfig} message OcrConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OcrConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hints != null && Object.hasOwnProperty.call(message, "hints")) - $root.google.cloud.documentai.v1beta3.OcrConfig.Hints.encode(message.hints, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.enableNativePdfParsing != null && Object.hasOwnProperty.call(message, "enableNativePdfParsing")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableNativePdfParsing); - if (message.enableImageQualityScores != null && Object.hasOwnProperty.call(message, "enableImageQualityScores")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableImageQualityScores); - if (message.advancedOcrOptions != null && message.advancedOcrOptions.length) - for (var i = 0; i < message.advancedOcrOptions.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.advancedOcrOptions[i]); - if (message.enableSymbol != null && Object.hasOwnProperty.call(message, "enableSymbol")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableSymbol); - if (message.computeStyleInfo != null && Object.hasOwnProperty.call(message, "computeStyleInfo")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.computeStyleInfo); - if (message.disableCharacterBoxesDetection != null && Object.hasOwnProperty.call(message, "disableCharacterBoxesDetection")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.disableCharacterBoxesDetection); - if (message.premiumFeatures != null && Object.hasOwnProperty.call(message, "premiumFeatures")) - $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.encode(message.premiumFeatures, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OcrConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @static - * @param {google.cloud.documentai.v1beta3.IOcrConfig} message OcrConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OcrConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OcrConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OcrConfig.decode = function decode(reader, 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.v1beta3.OcrConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.hints = $root.google.cloud.documentai.v1beta3.OcrConfig.Hints.decode(reader, reader.uint32()); - break; - } - case 3: { - message.enableNativePdfParsing = reader.bool(); - break; - } - case 4: { - message.enableImageQualityScores = reader.bool(); - break; - } - case 5: { - if (!(message.advancedOcrOptions && message.advancedOcrOptions.length)) - message.advancedOcrOptions = []; - message.advancedOcrOptions.push(reader.string()); - break; - } - case 6: { - message.enableSymbol = reader.bool(); - break; - } - case 8: { - message.computeStyleInfo = reader.bool(); - break; - } - case 10: { - message.disableCharacterBoxesDetection = reader.bool(); - break; - } - case 11: { - message.premiumFeatures = $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OcrConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OcrConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OcrConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OcrConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hints != null && message.hasOwnProperty("hints")) { - var error = $root.google.cloud.documentai.v1beta3.OcrConfig.Hints.verify(message.hints); - if (error) - return "hints." + error; - } - if (message.enableNativePdfParsing != null && message.hasOwnProperty("enableNativePdfParsing")) - if (typeof message.enableNativePdfParsing !== "boolean") - return "enableNativePdfParsing: boolean expected"; - if (message.enableImageQualityScores != null && message.hasOwnProperty("enableImageQualityScores")) - if (typeof message.enableImageQualityScores !== "boolean") - return "enableImageQualityScores: boolean expected"; - if (message.advancedOcrOptions != null && message.hasOwnProperty("advancedOcrOptions")) { - if (!Array.isArray(message.advancedOcrOptions)) - return "advancedOcrOptions: array expected"; - for (var i = 0; i < message.advancedOcrOptions.length; ++i) - if (!$util.isString(message.advancedOcrOptions[i])) - return "advancedOcrOptions: string[] expected"; - } - if (message.enableSymbol != null && message.hasOwnProperty("enableSymbol")) - if (typeof message.enableSymbol !== "boolean") - return "enableSymbol: boolean expected"; - if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) - if (typeof message.computeStyleInfo !== "boolean") - return "computeStyleInfo: boolean expected"; - if (message.disableCharacterBoxesDetection != null && message.hasOwnProperty("disableCharacterBoxesDetection")) - if (typeof message.disableCharacterBoxesDetection !== "boolean") - return "disableCharacterBoxesDetection: boolean expected"; - if (message.premiumFeatures != null && message.hasOwnProperty("premiumFeatures")) { - var error = $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify(message.premiumFeatures); - if (error) - return "premiumFeatures." + error; - } - return null; - }; - - /** - * Creates an OcrConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.OcrConfig} OcrConfig - */ - OcrConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.OcrConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.OcrConfig(); - if (object.hints != null) { - if (typeof object.hints !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.OcrConfig.hints: object expected"); - message.hints = $root.google.cloud.documentai.v1beta3.OcrConfig.Hints.fromObject(object.hints); - } - if (object.enableNativePdfParsing != null) - message.enableNativePdfParsing = Boolean(object.enableNativePdfParsing); - if (object.enableImageQualityScores != null) - message.enableImageQualityScores = Boolean(object.enableImageQualityScores); - if (object.advancedOcrOptions) { - if (!Array.isArray(object.advancedOcrOptions)) - throw TypeError(".google.cloud.documentai.v1beta3.OcrConfig.advancedOcrOptions: array expected"); - message.advancedOcrOptions = []; - for (var i = 0; i < object.advancedOcrOptions.length; ++i) - message.advancedOcrOptions[i] = String(object.advancedOcrOptions[i]); - } - if (object.enableSymbol != null) - message.enableSymbol = Boolean(object.enableSymbol); - if (object.computeStyleInfo != null) - message.computeStyleInfo = Boolean(object.computeStyleInfo); - if (object.disableCharacterBoxesDetection != null) - message.disableCharacterBoxesDetection = Boolean(object.disableCharacterBoxesDetection); - if (object.premiumFeatures != null) { - if (typeof object.premiumFeatures !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.OcrConfig.premiumFeatures: object expected"); - message.premiumFeatures = $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.fromObject(object.premiumFeatures); - } - return message; - }; - - /** - * Creates a plain object from an OcrConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @static - * @param {google.cloud.documentai.v1beta3.OcrConfig} message OcrConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OcrConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.advancedOcrOptions = []; - if (options.defaults) { - object.hints = null; - object.enableNativePdfParsing = false; - object.enableImageQualityScores = false; - object.enableSymbol = false; - object.computeStyleInfo = false; - object.disableCharacterBoxesDetection = false; - object.premiumFeatures = null; - } - if (message.hints != null && message.hasOwnProperty("hints")) - object.hints = $root.google.cloud.documentai.v1beta3.OcrConfig.Hints.toObject(message.hints, options); - if (message.enableNativePdfParsing != null && message.hasOwnProperty("enableNativePdfParsing")) - object.enableNativePdfParsing = message.enableNativePdfParsing; - if (message.enableImageQualityScores != null && message.hasOwnProperty("enableImageQualityScores")) - object.enableImageQualityScores = message.enableImageQualityScores; - if (message.advancedOcrOptions && message.advancedOcrOptions.length) { - object.advancedOcrOptions = []; - for (var j = 0; j < message.advancedOcrOptions.length; ++j) - object.advancedOcrOptions[j] = message.advancedOcrOptions[j]; - } - if (message.enableSymbol != null && message.hasOwnProperty("enableSymbol")) - object.enableSymbol = message.enableSymbol; - if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) - object.computeStyleInfo = message.computeStyleInfo; - if (message.disableCharacterBoxesDetection != null && message.hasOwnProperty("disableCharacterBoxesDetection")) - object.disableCharacterBoxesDetection = message.disableCharacterBoxesDetection; - if (message.premiumFeatures != null && message.hasOwnProperty("premiumFeatures")) - object.premiumFeatures = $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.toObject(message.premiumFeatures, options); - return object; - }; - - /** - * Converts this OcrConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @instance - * @returns {Object.} JSON object - */ - OcrConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OcrConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OcrConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.OcrConfig"; - }; - - OcrConfig.Hints = (function() { - - /** - * Properties of a Hints. - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @interface IHints - * @property {Array.|null} [languageHints] Hints languageHints - */ - - /** - * Constructs a new Hints. - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @classdesc Represents a Hints. - * @implements IHints - * @constructor - * @param {google.cloud.documentai.v1beta3.OcrConfig.IHints=} [properties] Properties to set - */ - function Hints(properties) { - this.languageHints = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Hints languageHints. - * @member {Array.} languageHints - * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints - * @instance - */ - Hints.prototype.languageHints = $util.emptyArray; - - /** - * Creates a new Hints instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints - * @static - * @param {google.cloud.documentai.v1beta3.OcrConfig.IHints=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.OcrConfig.Hints} Hints instance - */ - Hints.create = function create(properties) { - return new Hints(properties); - }; - - /** - * Encodes the specified Hints message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.Hints.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints - * @static - * @param {google.cloud.documentai.v1beta3.OcrConfig.IHints} message Hints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Hints.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.languageHints != null && message.languageHints.length) - for (var i = 0; i < message.languageHints.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageHints[i]); - return writer; - }; - - /** - * Encodes the specified Hints message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.Hints.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints - * @static - * @param {google.cloud.documentai.v1beta3.OcrConfig.IHints} message Hints message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Hints.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Hints message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.OcrConfig.Hints} Hints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Hints.decode = function decode(reader, 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.v1beta3.OcrConfig.Hints(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.languageHints && message.languageHints.length)) - message.languageHints = []; - message.languageHints.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Hints message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.OcrConfig.Hints} Hints - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Hints.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Hints message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Hints.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.languageHints != null && message.hasOwnProperty("languageHints")) { - if (!Array.isArray(message.languageHints)) - return "languageHints: array expected"; - for (var i = 0; i < message.languageHints.length; ++i) - if (!$util.isString(message.languageHints[i])) - return "languageHints: string[] expected"; - } - return null; - }; - - /** - * Creates a Hints message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.OcrConfig.Hints} Hints - */ - Hints.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.OcrConfig.Hints) - return object; - var message = new $root.google.cloud.documentai.v1beta3.OcrConfig.Hints(); - if (object.languageHints) { - if (!Array.isArray(object.languageHints)) - throw TypeError(".google.cloud.documentai.v1beta3.OcrConfig.Hints.languageHints: array expected"); - message.languageHints = []; - for (var i = 0; i < object.languageHints.length; ++i) - message.languageHints[i] = String(object.languageHints[i]); - } - return message; - }; - - /** - * Creates a plain object from a Hints message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints - * @static - * @param {google.cloud.documentai.v1beta3.OcrConfig.Hints} message Hints - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Hints.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.languageHints = []; - if (message.languageHints && message.languageHints.length) { - object.languageHints = []; - for (var j = 0; j < message.languageHints.length; ++j) - object.languageHints[j] = message.languageHints[j]; - } - return object; - }; - - /** - * Converts this Hints to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints - * @instance - * @returns {Object.} JSON object - */ - Hints.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Hints - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.OcrConfig.Hints - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Hints.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.OcrConfig.Hints"; - }; - - return Hints; - })(); - - OcrConfig.PremiumFeatures = (function() { - - /** - * Properties of a PremiumFeatures. - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @interface IPremiumFeatures - * @property {boolean|null} [enableSelectionMarkDetection] PremiumFeatures enableSelectionMarkDetection - * @property {boolean|null} [computeStyleInfo] PremiumFeatures computeStyleInfo - * @property {boolean|null} [enableMathOcr] PremiumFeatures enableMathOcr - */ - - /** - * Constructs a new PremiumFeatures. - * @memberof google.cloud.documentai.v1beta3.OcrConfig - * @classdesc Represents a PremiumFeatures. - * @implements IPremiumFeatures - * @constructor - * @param {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures=} [properties] Properties to set - */ - function PremiumFeatures(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PremiumFeatures enableSelectionMarkDetection. - * @member {boolean} enableSelectionMarkDetection - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @instance - */ - PremiumFeatures.prototype.enableSelectionMarkDetection = false; - - /** - * PremiumFeatures computeStyleInfo. - * @member {boolean} computeStyleInfo - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @instance - */ - PremiumFeatures.prototype.computeStyleInfo = false; - - /** - * PremiumFeatures enableMathOcr. - * @member {boolean} enableMathOcr - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @instance - */ - PremiumFeatures.prototype.enableMathOcr = false; - - /** - * Creates a new PremiumFeatures instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @static - * @param {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} PremiumFeatures instance - */ - PremiumFeatures.create = function create(properties) { - return new PremiumFeatures(properties); - }; - - /** - * Encodes the specified PremiumFeatures message. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @static - * @param {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures} message PremiumFeatures message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PremiumFeatures.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableSelectionMarkDetection != null && Object.hasOwnProperty.call(message, "enableSelectionMarkDetection")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableSelectionMarkDetection); - if (message.computeStyleInfo != null && Object.hasOwnProperty.call(message, "computeStyleInfo")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.computeStyleInfo); - if (message.enableMathOcr != null && Object.hasOwnProperty.call(message, "enableMathOcr")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableMathOcr); - return writer; - }; - - /** - * Encodes the specified PremiumFeatures message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @static - * @param {google.cloud.documentai.v1beta3.OcrConfig.IPremiumFeatures} message PremiumFeatures message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PremiumFeatures.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PremiumFeatures message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} PremiumFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PremiumFeatures.decode = function decode(reader, 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.v1beta3.OcrConfig.PremiumFeatures(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.enableSelectionMarkDetection = reader.bool(); - break; - } - case 4: { - message.computeStyleInfo = reader.bool(); - break; - } - case 5: { - message.enableMathOcr = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PremiumFeatures message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} PremiumFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PremiumFeatures.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PremiumFeatures message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PremiumFeatures.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enableSelectionMarkDetection != null && message.hasOwnProperty("enableSelectionMarkDetection")) - if (typeof message.enableSelectionMarkDetection !== "boolean") - return "enableSelectionMarkDetection: boolean expected"; - if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) - if (typeof message.computeStyleInfo !== "boolean") - return "computeStyleInfo: boolean expected"; - if (message.enableMathOcr != null && message.hasOwnProperty("enableMathOcr")) - if (typeof message.enableMathOcr !== "boolean") - return "enableMathOcr: boolean expected"; - return null; - }; - - /** - * Creates a PremiumFeatures message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} PremiumFeatures - */ - PremiumFeatures.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures) - return object; - var message = new $root.google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures(); - if (object.enableSelectionMarkDetection != null) - message.enableSelectionMarkDetection = Boolean(object.enableSelectionMarkDetection); - if (object.computeStyleInfo != null) - message.computeStyleInfo = Boolean(object.computeStyleInfo); - if (object.enableMathOcr != null) - message.enableMathOcr = Boolean(object.enableMathOcr); - return message; - }; - - /** - * Creates a plain object from a PremiumFeatures message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @static - * @param {google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures} message PremiumFeatures - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PremiumFeatures.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.enableSelectionMarkDetection = false; - object.computeStyleInfo = false; - object.enableMathOcr = false; - } - if (message.enableSelectionMarkDetection != null && message.hasOwnProperty("enableSelectionMarkDetection")) - object.enableSelectionMarkDetection = message.enableSelectionMarkDetection; - if (message.computeStyleInfo != null && message.hasOwnProperty("computeStyleInfo")) - object.computeStyleInfo = message.computeStyleInfo; - if (message.enableMathOcr != null && message.hasOwnProperty("enableMathOcr")) - object.enableMathOcr = message.enableMathOcr; - return object; - }; - - /** - * Converts this PremiumFeatures to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @instance - * @returns {Object.} JSON object - */ - PremiumFeatures.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PremiumFeatures - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PremiumFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures"; - }; - - return PremiumFeatures; - })(); - - return OcrConfig; - })(); - - v1beta3.SummaryOptions = (function() { - - /** - * Properties of a SummaryOptions. - * @memberof google.cloud.documentai.v1beta3 - * @interface ISummaryOptions - * @property {google.cloud.documentai.v1beta3.SummaryOptions.Length|null} [length] SummaryOptions length - * @property {google.cloud.documentai.v1beta3.SummaryOptions.Format|null} [format] SummaryOptions format - */ - - /** - * Constructs a new SummaryOptions. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a SummaryOptions. - * @implements ISummaryOptions - * @constructor - * @param {google.cloud.documentai.v1beta3.ISummaryOptions=} [properties] Properties to set - */ - function SummaryOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SummaryOptions length. - * @member {google.cloud.documentai.v1beta3.SummaryOptions.Length} length - * @memberof google.cloud.documentai.v1beta3.SummaryOptions - * @instance - */ - SummaryOptions.prototype.length = 0; - - /** - * SummaryOptions format. - * @member {google.cloud.documentai.v1beta3.SummaryOptions.Format} format - * @memberof google.cloud.documentai.v1beta3.SummaryOptions - * @instance - */ - SummaryOptions.prototype.format = 0; - - /** - * Creates a new SummaryOptions instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.SummaryOptions - * @static - * @param {google.cloud.documentai.v1beta3.ISummaryOptions=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.SummaryOptions} SummaryOptions instance - */ - SummaryOptions.create = function create(properties) { - return new SummaryOptions(properties); - }; - - /** - * Encodes the specified SummaryOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.SummaryOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.SummaryOptions - * @static - * @param {google.cloud.documentai.v1beta3.ISummaryOptions} message SummaryOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SummaryOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.length != null && Object.hasOwnProperty.call(message, "length")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.length); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.format); - return writer; - }; - - /** - * Encodes the specified SummaryOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SummaryOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.SummaryOptions - * @static - * @param {google.cloud.documentai.v1beta3.ISummaryOptions} message SummaryOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SummaryOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SummaryOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.SummaryOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.SummaryOptions} SummaryOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SummaryOptions.decode = function decode(reader, 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.v1beta3.SummaryOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.length = reader.int32(); - break; - } - case 2: { - message.format = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SummaryOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.SummaryOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.SummaryOptions} SummaryOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SummaryOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SummaryOptions message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.SummaryOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SummaryOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.length != null && message.hasOwnProperty("length")) - switch (message.length) { - default: - return "length: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a SummaryOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.SummaryOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.SummaryOptions} SummaryOptions - */ - SummaryOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.SummaryOptions) - return object; - var message = new $root.google.cloud.documentai.v1beta3.SummaryOptions(); - switch (object.length) { - default: - if (typeof object.length === "number") { - message.length = object.length; - break; - } - break; - case "LENGTH_UNSPECIFIED": - case 0: - message.length = 0; - break; - case "BRIEF": - case 1: - message.length = 1; - break; - case "MODERATE": - case 2: - message.length = 2; - break; - case "COMPREHENSIVE": - case 3: - message.length = 3; - break; - } - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "PARAGRAPH": - case 1: - message.format = 1; - break; - case "BULLETS": - case 2: - message.format = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a SummaryOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.SummaryOptions - * @static - * @param {google.cloud.documentai.v1beta3.SummaryOptions} message SummaryOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SummaryOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.length = options.enums === String ? "LENGTH_UNSPECIFIED" : 0; - object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - } - if (message.length != null && message.hasOwnProperty("length")) - object.length = options.enums === String ? $root.google.cloud.documentai.v1beta3.SummaryOptions.Length[message.length] === undefined ? message.length : $root.google.cloud.documentai.v1beta3.SummaryOptions.Length[message.length] : message.length; - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.cloud.documentai.v1beta3.SummaryOptions.Format[message.format] === undefined ? message.format : $root.google.cloud.documentai.v1beta3.SummaryOptions.Format[message.format] : message.format; - return object; - }; - - /** - * Converts this SummaryOptions to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.SummaryOptions - * @instance - * @returns {Object.} JSON object - */ - SummaryOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SummaryOptions - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.SummaryOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SummaryOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.SummaryOptions"; - }; - - /** - * Length enum. - * @name google.cloud.documentai.v1beta3.SummaryOptions.Length - * @enum {number} - * @property {number} LENGTH_UNSPECIFIED=0 LENGTH_UNSPECIFIED value - * @property {number} BRIEF=1 BRIEF value - * @property {number} MODERATE=2 MODERATE value - * @property {number} COMPREHENSIVE=3 COMPREHENSIVE value - */ - SummaryOptions.Length = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LENGTH_UNSPECIFIED"] = 0; - values[valuesById[1] = "BRIEF"] = 1; - values[valuesById[2] = "MODERATE"] = 2; - values[valuesById[3] = "COMPREHENSIVE"] = 3; - return values; - })(); - - /** - * Format enum. - * @name google.cloud.documentai.v1beta3.SummaryOptions.Format - * @enum {number} - * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value - * @property {number} PARAGRAPH=1 PARAGRAPH value - * @property {number} BULLETS=2 BULLETS value - */ - SummaryOptions.Format = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "PARAGRAPH"] = 1; - values[valuesById[2] = "BULLETS"] = 2; - return values; - })(); - - return SummaryOptions; - })(); - - v1beta3.FieldExtractionMetadata = (function() { - - /** - * Properties of a FieldExtractionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IFieldExtractionMetadata - * @property {google.cloud.documentai.v1beta3.ISummaryOptions|null} [summaryOptions] FieldExtractionMetadata summaryOptions - */ - - /** - * Constructs a new FieldExtractionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a FieldExtractionMetadata. - * @implements IFieldExtractionMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IFieldExtractionMetadata=} [properties] Properties to set - */ - function FieldExtractionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldExtractionMetadata summaryOptions. - * @member {google.cloud.documentai.v1beta3.ISummaryOptions|null|undefined} summaryOptions - * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata - * @instance - */ - FieldExtractionMetadata.prototype.summaryOptions = null; - - /** - * Creates a new FieldExtractionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IFieldExtractionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.FieldExtractionMetadata} FieldExtractionMetadata instance - */ - FieldExtractionMetadata.create = function create(properties) { - return new FieldExtractionMetadata(properties); - }; - - /** - * Encodes the specified FieldExtractionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.FieldExtractionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IFieldExtractionMetadata} message FieldExtractionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldExtractionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.summaryOptions != null && Object.hasOwnProperty.call(message, "summaryOptions")) - $root.google.cloud.documentai.v1beta3.SummaryOptions.encode(message.summaryOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldExtractionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.FieldExtractionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IFieldExtractionMetadata} message FieldExtractionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldExtractionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldExtractionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.FieldExtractionMetadata} FieldExtractionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldExtractionMetadata.decode = function decode(reader, 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.v1beta3.FieldExtractionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.summaryOptions = $root.google.cloud.documentai.v1beta3.SummaryOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldExtractionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.FieldExtractionMetadata} FieldExtractionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldExtractionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldExtractionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldExtractionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.summaryOptions != null && message.hasOwnProperty("summaryOptions")) { - var error = $root.google.cloud.documentai.v1beta3.SummaryOptions.verify(message.summaryOptions); - if (error) - return "summaryOptions." + error; - } - return null; - }; - - /** - * Creates a FieldExtractionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.FieldExtractionMetadata} FieldExtractionMetadata - */ - FieldExtractionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata(); - if (object.summaryOptions != null) { - if (typeof object.summaryOptions !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.FieldExtractionMetadata.summaryOptions: object expected"); - message.summaryOptions = $root.google.cloud.documentai.v1beta3.SummaryOptions.fromObject(object.summaryOptions); - } - return message; - }; - - /** - * Creates a plain object from a FieldExtractionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.FieldExtractionMetadata} message FieldExtractionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldExtractionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.summaryOptions = null; - if (message.summaryOptions != null && message.hasOwnProperty("summaryOptions")) - object.summaryOptions = $root.google.cloud.documentai.v1beta3.SummaryOptions.toObject(message.summaryOptions, options); - return object; - }; - - /** - * Converts this FieldExtractionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata - * @instance - * @returns {Object.} JSON object - */ - FieldExtractionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldExtractionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.FieldExtractionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldExtractionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.FieldExtractionMetadata"; - }; - - return FieldExtractionMetadata; - })(); - - v1beta3.PropertyMetadata = (function() { - - /** - * Properties of a PropertyMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IPropertyMetadata - * @property {boolean|null} [inactive] PropertyMetadata inactive - * @property {google.cloud.documentai.v1beta3.IFieldExtractionMetadata|null} [fieldExtractionMetadata] PropertyMetadata fieldExtractionMetadata - */ - - /** - * Constructs a new PropertyMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a PropertyMetadata. - * @implements IPropertyMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IPropertyMetadata=} [properties] Properties to set - */ - function PropertyMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PropertyMetadata inactive. - * @member {boolean} inactive - * @memberof google.cloud.documentai.v1beta3.PropertyMetadata - * @instance - */ - PropertyMetadata.prototype.inactive = false; - - /** - * PropertyMetadata fieldExtractionMetadata. - * @member {google.cloud.documentai.v1beta3.IFieldExtractionMetadata|null|undefined} fieldExtractionMetadata - * @memberof google.cloud.documentai.v1beta3.PropertyMetadata - * @instance - */ - PropertyMetadata.prototype.fieldExtractionMetadata = null; - - /** - * Creates a new PropertyMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.PropertyMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IPropertyMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.PropertyMetadata} PropertyMetadata instance - */ - PropertyMetadata.create = function create(properties) { - return new PropertyMetadata(properties); - }; - - /** - * Encodes the specified PropertyMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.PropertyMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.PropertyMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IPropertyMetadata} message PropertyMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inactive != null && Object.hasOwnProperty.call(message, "inactive")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.inactive); - if (message.fieldExtractionMetadata != null && Object.hasOwnProperty.call(message, "fieldExtractionMetadata")) - $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata.encode(message.fieldExtractionMetadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PropertyMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.PropertyMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.PropertyMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IPropertyMetadata} message PropertyMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PropertyMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.PropertyMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.PropertyMetadata} PropertyMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyMetadata.decode = function decode(reader, 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.v1beta3.PropertyMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.inactive = reader.bool(); - break; - } - case 9: { - message.fieldExtractionMetadata = $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PropertyMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.PropertyMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.PropertyMetadata} PropertyMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PropertyMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.PropertyMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PropertyMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inactive != null && message.hasOwnProperty("inactive")) - if (typeof message.inactive !== "boolean") - return "inactive: boolean expected"; - if (message.fieldExtractionMetadata != null && message.hasOwnProperty("fieldExtractionMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata.verify(message.fieldExtractionMetadata); - if (error) - return "fieldExtractionMetadata." + error; - } - return null; - }; - - /** - * Creates a PropertyMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.PropertyMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.PropertyMetadata} PropertyMetadata - */ - PropertyMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.PropertyMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.PropertyMetadata(); - if (object.inactive != null) - message.inactive = Boolean(object.inactive); - if (object.fieldExtractionMetadata != null) { - if (typeof object.fieldExtractionMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.PropertyMetadata.fieldExtractionMetadata: object expected"); - message.fieldExtractionMetadata = $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata.fromObject(object.fieldExtractionMetadata); - } - return message; - }; - - /** - * Creates a plain object from a PropertyMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.PropertyMetadata - * @static - * @param {google.cloud.documentai.v1beta3.PropertyMetadata} message PropertyMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PropertyMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inactive = false; - object.fieldExtractionMetadata = null; - } - if (message.inactive != null && message.hasOwnProperty("inactive")) - object.inactive = message.inactive; - if (message.fieldExtractionMetadata != null && message.hasOwnProperty("fieldExtractionMetadata")) - object.fieldExtractionMetadata = $root.google.cloud.documentai.v1beta3.FieldExtractionMetadata.toObject(message.fieldExtractionMetadata, options); - return object; - }; - - /** - * Converts this PropertyMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.PropertyMetadata - * @instance - * @returns {Object.} JSON object - */ - PropertyMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PropertyMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.PropertyMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PropertyMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.PropertyMetadata"; - }; - - return PropertyMetadata; - })(); - - v1beta3.EntityTypeMetadata = (function() { - - /** - * Properties of an EntityTypeMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IEntityTypeMetadata - * @property {boolean|null} [inactive] EntityTypeMetadata inactive - */ - - /** - * Constructs a new EntityTypeMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an EntityTypeMetadata. - * @implements IEntityTypeMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IEntityTypeMetadata=} [properties] Properties to set - */ - function EntityTypeMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EntityTypeMetadata inactive. - * @member {boolean} inactive - * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata - * @instance - */ - EntityTypeMetadata.prototype.inactive = false; - - /** - * Creates a new EntityTypeMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IEntityTypeMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.EntityTypeMetadata} EntityTypeMetadata instance - */ - EntityTypeMetadata.create = function create(properties) { - return new EntityTypeMetadata(properties); - }; - - /** - * Encodes the specified EntityTypeMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.EntityTypeMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IEntityTypeMetadata} message EntityTypeMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityTypeMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inactive != null && Object.hasOwnProperty.call(message, "inactive")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.inactive); - return writer; - }; - - /** - * Encodes the specified EntityTypeMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EntityTypeMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IEntityTypeMetadata} message EntityTypeMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityTypeMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EntityTypeMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.EntityTypeMetadata} EntityTypeMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityTypeMetadata.decode = function decode(reader, 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.v1beta3.EntityTypeMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.inactive = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EntityTypeMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.EntityTypeMetadata} EntityTypeMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityTypeMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EntityTypeMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntityTypeMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inactive != null && message.hasOwnProperty("inactive")) - if (typeof message.inactive !== "boolean") - return "inactive: boolean expected"; - return null; - }; - - /** - * Creates an EntityTypeMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.EntityTypeMetadata} EntityTypeMetadata - */ - EntityTypeMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.EntityTypeMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.EntityTypeMetadata(); - if (object.inactive != null) - message.inactive = Boolean(object.inactive); - return message; - }; - - /** - * Creates a plain object from an EntityTypeMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata - * @static - * @param {google.cloud.documentai.v1beta3.EntityTypeMetadata} message EntityTypeMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityTypeMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.inactive = false; - if (message.inactive != null && message.hasOwnProperty("inactive")) - object.inactive = message.inactive; - return object; - }; - - /** - * Converts this EntityTypeMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata - * @instance - * @returns {Object.} JSON object - */ - EntityTypeMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EntityTypeMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.EntityTypeMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EntityTypeMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EntityTypeMetadata"; - }; - - return EntityTypeMetadata; - })(); - - v1beta3.DocumentSchema = (function() { - - /** - * Properties of a DocumentSchema. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDocumentSchema - * @property {string|null} [displayName] DocumentSchema displayName - * @property {string|null} [description] DocumentSchema description - * @property {Array.|null} [entityTypes] DocumentSchema entityTypes - * @property {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null} [metadata] DocumentSchema metadata - * @property {string|null} [documentPrompt] DocumentSchema documentPrompt - */ - - /** - * Constructs a new DocumentSchema. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DocumentSchema. - * @implements IDocumentSchema - * @constructor - * @param {google.cloud.documentai.v1beta3.IDocumentSchema=} [properties] Properties to set - */ - function DocumentSchema(properties) { - this.entityTypes = []; - if (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 displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @instance - */ - DocumentSchema.prototype.displayName = ""; - - /** - * DocumentSchema description. - * @member {string} description - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @instance - */ - DocumentSchema.prototype.description = ""; - - /** - * DocumentSchema entityTypes. - * @member {Array.} entityTypes - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @instance - */ - DocumentSchema.prototype.entityTypes = $util.emptyArray; - - /** - * DocumentSchema metadata. - * @member {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null|undefined} metadata - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @instance - */ - DocumentSchema.prototype.metadata = null; - - /** - * DocumentSchema documentPrompt. - * @member {string} documentPrompt - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @instance - */ - DocumentSchema.prototype.documentPrompt = ""; - - /** - * Creates a new DocumentSchema instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentSchema=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentSchema} DocumentSchema instance - */ - DocumentSchema.create = function create(properties) { - return new DocumentSchema(properties); - }; - - /** - * Encodes the specified DocumentSchema message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @static - * @param {google.cloud.documentai.v1beta3.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.entityTypes != null && message.entityTypes.length) - for (var i = 0; i < message.entityTypes.length; ++i) - $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.documentPrompt != null && Object.hasOwnProperty.call(message, "documentPrompt")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.documentPrompt); - return writer; - }; - - /** - * Encodes the specified DocumentSchema message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @static - * @param {google.cloud.documentai.v1beta3.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.documentai.v1beta3.DocumentSchema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.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.documentai.v1beta3.DocumentSchema(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.displayName = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - if (!(message.entityTypes && message.entityTypes.length)) - message.entityTypes = []; - message.entityTypes.push($root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.decode(reader, reader.uint32())); - break; - } - case 4: { - message.metadata = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.decode(reader, reader.uint32()); - break; - } - case 5: { - message.documentPrompt = 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.documentai.v1beta3.DocumentSchema - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.documentai.v1beta3.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { - if (!Array.isArray(message.entityTypes)) - return "entityTypes: array expected"; - for (var i = 0; i < message.entityTypes.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.verify(message.entityTypes[i]); - if (error) - return "entityTypes." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - if (message.documentPrompt != null && message.hasOwnProperty("documentPrompt")) - if (!$util.isString(message.documentPrompt)) - return "documentPrompt: 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.documentai.v1beta3.DocumentSchema - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentSchema} DocumentSchema - */ - DocumentSchema.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentSchema) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentSchema(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.entityTypes) { - if (!Array.isArray(object.entityTypes)) - throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.entityTypes: array expected"); - message.entityTypes = []; - for (var i = 0; i < object.entityTypes.length; ++i) { - if (typeof object.entityTypes[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.entityTypes: object expected"); - message.entityTypes[i] = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.fromObject(object.entityTypes[i]); - } - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.metadata: object expected"); - message.metadata = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.fromObject(object.metadata); - } - if (object.documentPrompt != null) - message.documentPrompt = String(object.documentPrompt); - return message; - }; - - /** - * Creates a plain object from a DocumentSchema message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @static - * @param {google.cloud.documentai.v1beta3.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.entityTypes = []; - if (options.defaults) { - object.displayName = ""; - object.description = ""; - object.metadata = null; - object.documentPrompt = ""; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.entityTypes && message.entityTypes.length) { - object.entityTypes = []; - for (var j = 0; j < message.entityTypes.length; ++j) - object.entityTypes[j] = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.toObject(message.entityTypes[j], options); - } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.toObject(message.metadata, options); - if (message.documentPrompt != null && message.hasOwnProperty("documentPrompt")) - object.documentPrompt = message.documentPrompt; - return object; - }; - - /** - * Converts this DocumentSchema to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.DocumentSchema"; - }; - - DocumentSchema.EntityType = (function() { - - /** - * Properties of an EntityType. - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @interface IEntityType - * @property {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues|null} [enumValues] EntityType enumValues - * @property {string|null} [displayName] EntityType displayName - * @property {string|null} [name] EntityType name - * @property {string|null} [description] EntityType description - * @property {Array.|null} [baseTypes] EntityType baseTypes - * @property {Array.|null} [properties] EntityType properties - * @property {google.cloud.documentai.v1beta3.IEntityTypeMetadata|null} [entityTypeMetadata] EntityType entityTypeMetadata - */ - - /** - * Constructs a new EntityType. - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @classdesc Represents an EntityType. - * @implements IEntityType - * @constructor - * @param {google.cloud.documentai.v1beta3.DocumentSchema.IEntityType=} [properties] Properties to set - */ - function EntityType(properties) { - this.baseTypes = []; - 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]]; - } - - /** - * EntityType enumValues. - * @member {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues|null|undefined} enumValues - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @instance - */ - EntityType.prototype.enumValues = null; - - /** - * EntityType displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @instance - */ - EntityType.prototype.displayName = ""; - - /** - * EntityType name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @instance - */ - EntityType.prototype.name = ""; - - /** - * EntityType description. - * @member {string} description - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @instance - */ - EntityType.prototype.description = ""; - - /** - * EntityType baseTypes. - * @member {Array.} baseTypes - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @instance - */ - EntityType.prototype.baseTypes = $util.emptyArray; - - /** - * EntityType properties. - * @member {Array.} properties - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @instance - */ - EntityType.prototype.properties = $util.emptyArray; - - /** - * EntityType entityTypeMetadata. - * @member {google.cloud.documentai.v1beta3.IEntityTypeMetadata|null|undefined} entityTypeMetadata - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @instance - */ - EntityType.prototype.entityTypeMetadata = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * EntityType valueSource. - * @member {"enumValues"|undefined} valueSource - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @instance - */ - Object.defineProperty(EntityType.prototype, "valueSource", { - get: $util.oneOfGetter($oneOfFields = ["enumValues"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new EntityType instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.IEntityType=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType} EntityType instance - */ - EntityType.create = function create(properties) { - return new EntityType(properties); - }; - - /** - * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.IEntityType} message EntityType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityType.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.baseTypes != null && message.baseTypes.length) - for (var i = 0; i < message.baseTypes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseTypes[i]); - if (message.properties != null && message.properties.length) - for (var i = 0; i < message.properties.length; ++i) - $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.encode(message.properties[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.entityTypeMetadata != null && Object.hasOwnProperty.call(message, "entityTypeMetadata")) - $root.google.cloud.documentai.v1beta3.EntityTypeMetadata.encode(message.entityTypeMetadata, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.displayName); - if (message.enumValues != null && Object.hasOwnProperty.call(message, "enumValues")) - $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.encode(message.enumValues, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.description); - return writer; - }; - - /** - * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.IEntityType} message EntityType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EntityType message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType} EntityType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityType.decode = function decode(reader, 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.v1beta3.DocumentSchema.EntityType(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 14: { - message.enumValues = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.decode(reader, reader.uint32()); - break; - } - case 13: { - message.displayName = reader.string(); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 15: { - message.description = reader.string(); - break; - } - case 2: { - if (!(message.baseTypes && message.baseTypes.length)) - message.baseTypes = []; - message.baseTypes.push(reader.string()); - break; - } - case 6: { - if (!(message.properties && message.properties.length)) - message.properties = []; - message.properties.push($root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.decode(reader, reader.uint32())); - break; - } - case 11: { - message.entityTypeMetadata = $root.google.cloud.documentai.v1beta3.EntityTypeMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EntityType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType} EntityType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EntityType message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntityType.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.enumValues != null && message.hasOwnProperty("enumValues")) { - properties.valueSource = 1; - { - var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.verify(message.enumValues); - if (error) - return "enumValues." + error; - } - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string 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.baseTypes != null && message.hasOwnProperty("baseTypes")) { - if (!Array.isArray(message.baseTypes)) - return "baseTypes: array expected"; - for (var i = 0; i < message.baseTypes.length; ++i) - if (!$util.isString(message.baseTypes[i])) - return "baseTypes: string[] 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.documentai.v1beta3.DocumentSchema.EntityType.Property.verify(message.properties[i]); - if (error) - return "properties." + error; - } - } - if (message.entityTypeMetadata != null && message.hasOwnProperty("entityTypeMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.EntityTypeMetadata.verify(message.entityTypeMetadata); - if (error) - return "entityTypeMetadata." + error; - } - return null; - }; - - /** - * Creates an EntityType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType} EntityType - */ - EntityType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType(); - if (object.enumValues != null) { - if (typeof object.enumValues !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.EntityType.enumValues: object expected"); - message.enumValues = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.fromObject(object.enumValues); - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.baseTypes) { - if (!Array.isArray(object.baseTypes)) - throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.EntityType.baseTypes: array expected"); - message.baseTypes = []; - for (var i = 0; i < object.baseTypes.length; ++i) - message.baseTypes[i] = String(object.baseTypes[i]); - } - if (object.properties) { - if (!Array.isArray(object.properties)) - throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.v1beta3.DocumentSchema.EntityType.properties: object expected"); - message.properties[i] = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.fromObject(object.properties[i]); - } - } - if (object.entityTypeMetadata != null) { - if (typeof object.entityTypeMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.EntityType.entityTypeMetadata: object expected"); - message.entityTypeMetadata = $root.google.cloud.documentai.v1beta3.EntityTypeMetadata.fromObject(object.entityTypeMetadata); - } - return message; - }; - - /** - * Creates a plain object from an EntityType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType} message EntityType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.baseTypes = []; - object.properties = []; - } - if (options.defaults) { - object.name = ""; - object.entityTypeMetadata = null; - object.displayName = ""; - object.description = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.baseTypes && message.baseTypes.length) { - object.baseTypes = []; - for (var j = 0; j < message.baseTypes.length; ++j) - object.baseTypes[j] = message.baseTypes[j]; - } - if (message.properties && message.properties.length) { - object.properties = []; - for (var j = 0; j < message.properties.length; ++j) - object.properties[j] = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.toObject(message.properties[j], options); - } - if (message.entityTypeMetadata != null && message.hasOwnProperty("entityTypeMetadata")) - object.entityTypeMetadata = $root.google.cloud.documentai.v1beta3.EntityTypeMetadata.toObject(message.entityTypeMetadata, options); - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.enumValues != null && message.hasOwnProperty("enumValues")) { - object.enumValues = $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.toObject(message.enumValues, options); - if (options.oneofs) - object.valueSource = "enumValues"; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - return object; - }; - - /** - * Converts this EntityType to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @instance - * @returns {Object.} JSON object - */ - EntityType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EntityType - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EntityType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentSchema.EntityType"; - }; - - EntityType.EnumValues = (function() { - - /** - * Properties of an EnumValues. - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @interface IEnumValues - * @property {Array.|null} [values] EnumValues values - */ - - /** - * Constructs a new EnumValues. - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @classdesc Represents an EnumValues. - * @implements IEnumValues - * @constructor - * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues=} [properties] Properties to set - */ - function EnumValues(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]]; - } - - /** - * EnumValues values. - * @member {Array.} values - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues - * @instance - */ - EnumValues.prototype.values = $util.emptyArray; - - /** - * Creates a new EnumValues instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} EnumValues instance - */ - EnumValues.create = function create(properties) { - return new EnumValues(properties); - }; - - /** - * Encodes the specified EnumValues message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues} message EnumValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValues.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 EnumValues message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IEnumValues} message EnumValues message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValues.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValues message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} EnumValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValues.decode = function decode(reader, 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.v1beta3.DocumentSchema.EntityType.EnumValues(); - 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 EnumValues message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} EnumValues - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValues.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValues message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValues.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 EnumValues message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} EnumValues - */ - EnumValues.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues.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 EnumValues message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues} message EnumValues - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValues.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 EnumValues to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues - * @instance - * @returns {Object.} JSON object - */ - EnumValues.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValues - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentSchema.EntityType.EnumValues"; - }; - - return EnumValues; - })(); - - EntityType.Property = (function() { - - /** - * Properties of a Property. - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @interface IProperty - * @property {string|null} [name] Property name - * @property {string|null} [description] Property description - * @property {string|null} [displayName] Property displayName - * @property {string|null} [valueType] Property valueType - * @property {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType|null} [occurrenceType] Property occurrenceType - * @property {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method|null} [method] Property method - * @property {google.cloud.documentai.v1beta3.IPropertyMetadata|null} [propertyMetadata] Property propertyMetadata - */ - - /** - * Constructs a new Property. - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType - * @classdesc Represents a Property. - * @implements IProperty - * @constructor - * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.Property - * @instance - */ - Property.prototype.name = ""; - - /** - * Property description. - * @member {string} description - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property - * @instance - */ - Property.prototype.description = ""; - - /** - * Property displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property - * @instance - */ - Property.prototype.displayName = ""; - - /** - * Property valueType. - * @member {string} valueType - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property - * @instance - */ - Property.prototype.valueType = ""; - - /** - * Property occurrenceType. - * @member {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType} occurrenceType - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property - * @instance - */ - Property.prototype.occurrenceType = 0; - - /** - * Property method. - * @member {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method} method - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property - * @instance - */ - Property.prototype.method = 0; - - /** - * Property propertyMetadata. - * @member {google.cloud.documentai.v1beta3.IPropertyMetadata|null|undefined} propertyMetadata - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property - * @instance - */ - Property.prototype.propertyMetadata = null; - - /** - * Creates a new Property instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.IProperty=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property} Property instance - */ - Property.create = function create(properties) { - return new Property(properties); - }; - - /** - * Encodes the specified Property message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.valueType); - if (message.occurrenceType != null && Object.hasOwnProperty.call(message, "occurrenceType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.occurrenceType); - if (message.propertyMetadata != null && Object.hasOwnProperty.call(message, "propertyMetadata")) - $root.google.cloud.documentai.v1beta3.PropertyMetadata.encode(message.propertyMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); - if (message.method != null && Object.hasOwnProperty.call(message, "method")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.method); - return writer; - }; - - /** - * Encodes the specified Property message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.Property - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.Property(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 7: { - message.description = reader.string(); - break; - } - case 6: { - message.displayName = reader.string(); - break; - } - case 2: { - message.valueType = reader.string(); - break; - } - case 3: { - message.occurrenceType = reader.int32(); - break; - } - case 8: { - message.method = reader.int32(); - break; - } - case 5: { - message.propertyMetadata = $root.google.cloud.documentai.v1beta3.PropertyMetadata.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.documentai.v1beta3.DocumentSchema.EntityType.Property - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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"; - 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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.valueType != null && message.hasOwnProperty("valueType")) - if (!$util.isString(message.valueType)) - return "valueType: string expected"; - if (message.occurrenceType != null && message.hasOwnProperty("occurrenceType")) - switch (message.occurrenceType) { - default: - return "occurrenceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.method != null && message.hasOwnProperty("method")) - switch (message.method) { - default: - return "method: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.propertyMetadata != null && message.hasOwnProperty("propertyMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.PropertyMetadata.verify(message.propertyMetadata); - if (error) - return "propertyMetadata." + error; - } - return null; - }; - - /** - * Creates a Property message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property} Property - */ - Property.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.valueType != null) - message.valueType = String(object.valueType); - switch (object.occurrenceType) { - default: - if (typeof object.occurrenceType === "number") { - message.occurrenceType = object.occurrenceType; - break; - } - break; - case "OCCURRENCE_TYPE_UNSPECIFIED": - case 0: - message.occurrenceType = 0; - break; - case "OPTIONAL_ONCE": - case 1: - message.occurrenceType = 1; - break; - case "OPTIONAL_MULTIPLE": - case 2: - message.occurrenceType = 2; - break; - case "REQUIRED_ONCE": - case 3: - message.occurrenceType = 3; - break; - case "REQUIRED_MULTIPLE": - case 4: - message.occurrenceType = 4; - break; - } - 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; - } - if (object.propertyMetadata != null) { - if (typeof object.propertyMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.propertyMetadata: object expected"); - message.propertyMetadata = $root.google.cloud.documentai.v1beta3.PropertyMetadata.fromObject(object.propertyMetadata); - } - return message; - }; - - /** - * Creates a plain object from a Property message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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 = ""; - object.valueType = ""; - object.occurrenceType = options.enums === String ? "OCCURRENCE_TYPE_UNSPECIFIED" : 0; - object.propertyMetadata = null; - object.displayName = ""; - object.description = ""; - object.method = options.enums === String ? "METHOD_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = message.valueType; - if (message.occurrenceType != null && message.hasOwnProperty("occurrenceType")) - object.occurrenceType = options.enums === String ? $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] === undefined ? message.occurrenceType : $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] : message.occurrenceType; - if (message.propertyMetadata != null && message.hasOwnProperty("propertyMetadata")) - object.propertyMetadata = $root.google.cloud.documentai.v1beta3.PropertyMetadata.toObject(message.propertyMetadata, options); - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.method != null && message.hasOwnProperty("method")) - object.method = options.enums === String ? $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method[message.method] === undefined ? message.method : $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method[message.method] : message.method; - return object; - }; - - /** - * Converts this Property to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.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.documentai.v1beta3.DocumentSchema.EntityType.Property"; - }; - - /** - * OccurrenceType enum. - * @name google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType - * @enum {number} - * @property {number} OCCURRENCE_TYPE_UNSPECIFIED=0 OCCURRENCE_TYPE_UNSPECIFIED value - * @property {number} OPTIONAL_ONCE=1 OPTIONAL_ONCE value - * @property {number} OPTIONAL_MULTIPLE=2 OPTIONAL_MULTIPLE value - * @property {number} REQUIRED_ONCE=3 REQUIRED_ONCE value - * @property {number} REQUIRED_MULTIPLE=4 REQUIRED_MULTIPLE value - */ - Property.OccurrenceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OCCURRENCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL_ONCE"] = 1; - values[valuesById[2] = "OPTIONAL_MULTIPLE"] = 2; - values[valuesById[3] = "REQUIRED_ONCE"] = 3; - values[valuesById[4] = "REQUIRED_MULTIPLE"] = 4; - return values; - })(); - - /** - * Method enum. - * @name google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.Method - * @enum {number} - * @property {number} METHOD_UNSPECIFIED=0 METHOD_UNSPECIFIED value - * @property {number} EXTRACT=1 EXTRACT value - * @property {number} DERIVE=2 DERIVE value - */ - Property.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 Property; - })(); - - return EntityType; - })(); - - DocumentSchema.Metadata = (function() { - - /** - * Properties of a Metadata. - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @interface IMetadata - * @property {boolean|null} [documentSplitter] Metadata documentSplitter - * @property {boolean|null} [documentAllowMultipleLabels] Metadata documentAllowMultipleLabels - * @property {boolean|null} [prefixedNamingOnProperties] Metadata prefixedNamingOnProperties - * @property {boolean|null} [skipNamingValidation] Metadata skipNamingValidation - */ - - /** - * Constructs a new Metadata. - * @memberof google.cloud.documentai.v1beta3.DocumentSchema - * @classdesc Represents a Metadata. - * @implements IMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata=} [properties] Properties to set - */ - function Metadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Metadata documentSplitter. - * @member {boolean} documentSplitter - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @instance - */ - Metadata.prototype.documentSplitter = false; - - /** - * Metadata documentAllowMultipleLabels. - * @member {boolean} documentAllowMultipleLabels - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @instance - */ - Metadata.prototype.documentAllowMultipleLabels = false; - - /** - * Metadata prefixedNamingOnProperties. - * @member {boolean} prefixedNamingOnProperties - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @instance - */ - Metadata.prototype.prefixedNamingOnProperties = false; - - /** - * Metadata skipNamingValidation. - * @member {boolean} skipNamingValidation - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @instance - */ - Metadata.prototype.skipNamingValidation = false; - - /** - * Creates a new Metadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.Metadata} Metadata instance - */ - Metadata.create = function create(properties) { - return new Metadata(properties); - }; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentSplitter != null && Object.hasOwnProperty.call(message, "documentSplitter")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.documentSplitter); - if (message.documentAllowMultipleLabels != null && Object.hasOwnProperty.call(message, "documentAllowMultipleLabels")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.documentAllowMultipleLabels); - if (message.prefixedNamingOnProperties != null && Object.hasOwnProperty.call(message, "prefixedNamingOnProperties")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.prefixedNamingOnProperties); - if (message.skipNamingValidation != null && Object.hasOwnProperty.call(message, "skipNamingValidation")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.skipNamingValidation); - return writer; - }; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentSchema.Metadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decode = function decode(reader, 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.v1beta3.DocumentSchema.Metadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.documentSplitter = reader.bool(); - break; - } - case 2: { - message.documentAllowMultipleLabels = reader.bool(); - break; - } - case 6: { - message.prefixedNamingOnProperties = reader.bool(); - break; - } - case 7: { - message.skipNamingValidation = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Metadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentSplitter != null && message.hasOwnProperty("documentSplitter")) - if (typeof message.documentSplitter !== "boolean") - return "documentSplitter: boolean expected"; - if (message.documentAllowMultipleLabels != null && message.hasOwnProperty("documentAllowMultipleLabels")) - if (typeof message.documentAllowMultipleLabels !== "boolean") - return "documentAllowMultipleLabels: boolean expected"; - if (message.prefixedNamingOnProperties != null && message.hasOwnProperty("prefixedNamingOnProperties")) - if (typeof message.prefixedNamingOnProperties !== "boolean") - return "prefixedNamingOnProperties: boolean expected"; - if (message.skipNamingValidation != null && message.hasOwnProperty("skipNamingValidation")) - if (typeof message.skipNamingValidation !== "boolean") - return "skipNamingValidation: boolean expected"; - return null; - }; - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentSchema.Metadata} Metadata - */ - Metadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata(); - if (object.documentSplitter != null) - message.documentSplitter = Boolean(object.documentSplitter); - if (object.documentAllowMultipleLabels != null) - message.documentAllowMultipleLabels = Boolean(object.documentAllowMultipleLabels); - if (object.prefixedNamingOnProperties != null) - message.prefixedNamingOnProperties = Boolean(object.prefixedNamingOnProperties); - if (object.skipNamingValidation != null) - message.skipNamingValidation = Boolean(object.skipNamingValidation); - return message; - }; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @static - * @param {google.cloud.documentai.v1beta3.DocumentSchema.Metadata} message Metadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.documentSplitter = false; - object.documentAllowMultipleLabels = false; - object.prefixedNamingOnProperties = false; - object.skipNamingValidation = false; - } - if (message.documentSplitter != null && message.hasOwnProperty("documentSplitter")) - object.documentSplitter = message.documentSplitter; - if (message.documentAllowMultipleLabels != null && message.hasOwnProperty("documentAllowMultipleLabels")) - object.documentAllowMultipleLabels = message.documentAllowMultipleLabels; - if (message.prefixedNamingOnProperties != null && message.hasOwnProperty("prefixedNamingOnProperties")) - object.prefixedNamingOnProperties = message.prefixedNamingOnProperties; - if (message.skipNamingValidation != null && message.hasOwnProperty("skipNamingValidation")) - object.skipNamingValidation = message.skipNamingValidation; - return object; - }; - - /** - * Converts this Metadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @instance - * @returns {Object.} JSON object - */ - Metadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Metadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DocumentSchema.Metadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentSchema.Metadata"; - }; - - return Metadata; - })(); - - return DocumentSchema; - })(); - - v1beta3.DocumentProcessorService = (function() { - - /** - * Constructs a new DocumentProcessorService service. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DocumentProcessorService - * @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 DocumentProcessorService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (DocumentProcessorService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DocumentProcessorService; - - /** - * Creates new DocumentProcessorService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @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 {DocumentProcessorService} RPC service. Useful where requests and/or responses are streamed. - */ - DocumentProcessorService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|processDocument}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef ProcessDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.ProcessResponse} [response] ProcessResponse - */ - - /** - * Calls ProcessDocument. - * @function processDocument - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IProcessRequest} request ProcessRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocumentCallback} callback Node-style callback called with the error, if any, and ProcessResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.processDocument = function processDocument(request, callback) { - return this.rpcCall(processDocument, $root.google.cloud.documentai.v1beta3.ProcessRequest, $root.google.cloud.documentai.v1beta3.ProcessResponse, request, callback); - }, "name", { value: "ProcessDocument" }); - - /** - * Calls ProcessDocument. - * @function processDocument - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IProcessRequest} request ProcessRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|batchProcessDocuments}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef BatchProcessDocumentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchProcessDocuments. - * @function batchProcessDocuments - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IBatchProcessRequest} request BatchProcessRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocumentsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.batchProcessDocuments = function batchProcessDocuments(request, callback) { - return this.rpcCall(batchProcessDocuments, $root.google.cloud.documentai.v1beta3.BatchProcessRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchProcessDocuments" }); - - /** - * Calls BatchProcessDocuments. - * @function batchProcessDocuments - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IBatchProcessRequest} request BatchProcessRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|fetchProcessorTypes}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef FetchProcessorTypesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} [response] FetchProcessorTypesResponse - */ - - /** - * Calls FetchProcessorTypes. - * @function fetchProcessorTypes - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest} request FetchProcessorTypesRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypesCallback} callback Node-style callback called with the error, if any, and FetchProcessorTypesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.fetchProcessorTypes = function fetchProcessorTypes(request, callback) { - return this.rpcCall(fetchProcessorTypes, $root.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest, $root.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse, request, callback); - }, "name", { value: "FetchProcessorTypes" }); - - /** - * Calls FetchProcessorTypes. - * @function fetchProcessorTypes - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest} request FetchProcessorTypesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listProcessorTypes}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef ListProcessorTypesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.ListProcessorTypesResponse} [response] ListProcessorTypesResponse - */ - - /** - * Calls ListProcessorTypes. - * @function listProcessorTypes - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IListProcessorTypesRequest} request ListProcessorTypesRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypesCallback} callback Node-style callback called with the error, if any, and ListProcessorTypesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.listProcessorTypes = function listProcessorTypes(request, callback) { - return this.rpcCall(listProcessorTypes, $root.google.cloud.documentai.v1beta3.ListProcessorTypesRequest, $root.google.cloud.documentai.v1beta3.ListProcessorTypesResponse, request, callback); - }, "name", { value: "ListProcessorTypes" }); - - /** - * Calls ListProcessorTypes. - * @function listProcessorTypes - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IListProcessorTypesRequest} request ListProcessorTypesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getProcessorType}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef GetProcessorTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.ProcessorType} [response] ProcessorType - */ - - /** - * Calls GetProcessorType. - * @function getProcessorType - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IGetProcessorTypeRequest} request GetProcessorTypeRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorTypeCallback} callback Node-style callback called with the error, if any, and ProcessorType - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.getProcessorType = function getProcessorType(request, callback) { - return this.rpcCall(getProcessorType, $root.google.cloud.documentai.v1beta3.GetProcessorTypeRequest, $root.google.cloud.documentai.v1beta3.ProcessorType, request, callback); - }, "name", { value: "GetProcessorType" }); - - /** - * Calls GetProcessorType. - * @function getProcessorType - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IGetProcessorTypeRequest} request GetProcessorTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listProcessors}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef ListProcessorsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.ListProcessorsResponse} [response] ListProcessorsResponse - */ - - /** - * Calls ListProcessors. - * @function listProcessors - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IListProcessorsRequest} request ListProcessorsRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorsCallback} callback Node-style callback called with the error, if any, and ListProcessorsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.listProcessors = function listProcessors(request, callback) { - return this.rpcCall(listProcessors, $root.google.cloud.documentai.v1beta3.ListProcessorsRequest, $root.google.cloud.documentai.v1beta3.ListProcessorsResponse, request, callback); - }, "name", { value: "ListProcessors" }); - - /** - * Calls ListProcessors. - * @function listProcessors - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IListProcessorsRequest} request ListProcessorsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getProcessor}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef GetProcessorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.Processor} [response] Processor - */ - - /** - * Calls GetProcessor. - * @function getProcessor - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IGetProcessorRequest} request GetProcessorRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorCallback} callback Node-style callback called with the error, if any, and Processor - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.getProcessor = function getProcessor(request, callback) { - return this.rpcCall(getProcessor, $root.google.cloud.documentai.v1beta3.GetProcessorRequest, $root.google.cloud.documentai.v1beta3.Processor, request, callback); - }, "name", { value: "GetProcessor" }); - - /** - * Calls GetProcessor. - * @function getProcessor - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IGetProcessorRequest} request GetProcessorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|trainProcessorVersion}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef TrainProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls TrainProcessorVersion. - * @function trainProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest} request TrainProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.trainProcessorVersion = function trainProcessorVersion(request, callback) { - return this.rpcCall(trainProcessorVersion, $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "TrainProcessorVersion" }); - - /** - * Calls TrainProcessorVersion. - * @function trainProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest} request TrainProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getProcessorVersion}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef GetProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.ProcessorVersion} [response] ProcessorVersion - */ - - /** - * Calls GetProcessorVersion. - * @function getProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IGetProcessorVersionRequest} request GetProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersionCallback} callback Node-style callback called with the error, if any, and ProcessorVersion - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.getProcessorVersion = function getProcessorVersion(request, callback) { - return this.rpcCall(getProcessorVersion, $root.google.cloud.documentai.v1beta3.GetProcessorVersionRequest, $root.google.cloud.documentai.v1beta3.ProcessorVersion, request, callback); - }, "name", { value: "GetProcessorVersion" }); - - /** - * Calls GetProcessorVersion. - * @function getProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IGetProcessorVersionRequest} request GetProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listProcessorVersions}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef ListProcessorVersionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} [response] ListProcessorVersionsResponse - */ - - /** - * Calls ListProcessorVersions. - * @function listProcessorVersions - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsRequest} request ListProcessorVersionsRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersionsCallback} callback Node-style callback called with the error, if any, and ListProcessorVersionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.listProcessorVersions = function listProcessorVersions(request, callback) { - return this.rpcCall(listProcessorVersions, $root.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest, $root.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse, request, callback); - }, "name", { value: "ListProcessorVersions" }); - - /** - * Calls ListProcessorVersions. - * @function listProcessorVersions - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsRequest} request ListProcessorVersionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|deleteProcessorVersion}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef DeleteProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteProcessorVersion. - * @function deleteProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest} request DeleteProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.deleteProcessorVersion = function deleteProcessorVersion(request, callback) { - return this.rpcCall(deleteProcessorVersion, $root.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteProcessorVersion" }); - - /** - * Calls DeleteProcessorVersion. - * @function deleteProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest} request DeleteProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|deployProcessorVersion}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef DeployProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeployProcessorVersion. - * @function deployProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest} request DeployProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.deployProcessorVersion = function deployProcessorVersion(request, callback) { - return this.rpcCall(deployProcessorVersion, $root.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeployProcessorVersion" }); - - /** - * Calls DeployProcessorVersion. - * @function deployProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest} request DeployProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|undeployProcessorVersion}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef UndeployProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UndeployProcessorVersion. - * @function undeployProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest} request UndeployProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.undeployProcessorVersion = function undeployProcessorVersion(request, callback) { - return this.rpcCall(undeployProcessorVersion, $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UndeployProcessorVersion" }); - - /** - * Calls UndeployProcessorVersion. - * @function undeployProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest} request UndeployProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|createProcessor}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef CreateProcessorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.Processor} [response] Processor - */ - - /** - * Calls CreateProcessor. - * @function createProcessor - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.ICreateProcessorRequest} request CreateProcessorRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessorCallback} callback Node-style callback called with the error, if any, and Processor - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.createProcessor = function createProcessor(request, callback) { - return this.rpcCall(createProcessor, $root.google.cloud.documentai.v1beta3.CreateProcessorRequest, $root.google.cloud.documentai.v1beta3.Processor, request, callback); - }, "name", { value: "CreateProcessor" }); - - /** - * Calls CreateProcessor. - * @function createProcessor - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.ICreateProcessorRequest} request CreateProcessorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|deleteProcessor}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef DeleteProcessorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteProcessor. - * @function deleteProcessor - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorRequest} request DeleteProcessorRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.deleteProcessor = function deleteProcessor(request, callback) { - return this.rpcCall(deleteProcessor, $root.google.cloud.documentai.v1beta3.DeleteProcessorRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteProcessor" }); - - /** - * Calls DeleteProcessor. - * @function deleteProcessor - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorRequest} request DeleteProcessorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|enableProcessor}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef EnableProcessorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls EnableProcessor. - * @function enableProcessor - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IEnableProcessorRequest} request EnableProcessorRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessorCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.enableProcessor = function enableProcessor(request, callback) { - return this.rpcCall(enableProcessor, $root.google.cloud.documentai.v1beta3.EnableProcessorRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "EnableProcessor" }); - - /** - * Calls EnableProcessor. - * @function enableProcessor - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IEnableProcessorRequest} request EnableProcessorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|disableProcessor}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef DisableProcessorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DisableProcessor. - * @function disableProcessor - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IDisableProcessorRequest} request DisableProcessorRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessorCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.disableProcessor = function disableProcessor(request, callback) { - return this.rpcCall(disableProcessor, $root.google.cloud.documentai.v1beta3.DisableProcessorRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DisableProcessor" }); - - /** - * Calls DisableProcessor. - * @function disableProcessor - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IDisableProcessorRequest} request DisableProcessorRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|setDefaultProcessorVersion}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef SetDefaultProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls SetDefaultProcessorVersion. - * @function setDefaultProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest} request SetDefaultProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.setDefaultProcessorVersion = function setDefaultProcessorVersion(request, callback) { - return this.rpcCall(setDefaultProcessorVersion, $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "SetDefaultProcessorVersion" }); - - /** - * Calls SetDefaultProcessorVersion. - * @function setDefaultProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest} request SetDefaultProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|reviewDocument}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef ReviewDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ReviewDocument. - * @function reviewDocument - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IReviewDocumentRequest} request ReviewDocumentRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocumentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.reviewDocument = function reviewDocument(request, callback) { - return this.rpcCall(reviewDocument, $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ReviewDocument" }); - - /** - * Calls ReviewDocument. - * @function reviewDocument - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IReviewDocumentRequest} request ReviewDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|evaluateProcessorVersion}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef EvaluateProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls EvaluateProcessorVersion. - * @function evaluateProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest} request EvaluateProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.evaluateProcessorVersion = function evaluateProcessorVersion(request, callback) { - return this.rpcCall(evaluateProcessorVersion, $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "EvaluateProcessorVersion" }); - - /** - * Calls EvaluateProcessorVersion. - * @function evaluateProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest} request EvaluateProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|getEvaluation}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef GetEvaluationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.Evaluation} [response] Evaluation - */ - - /** - * Calls GetEvaluation. - * @function getEvaluation - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IGetEvaluationRequest} request GetEvaluationRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluationCallback} callback Node-style callback called with the error, if any, and Evaluation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.getEvaluation = function getEvaluation(request, callback) { - return this.rpcCall(getEvaluation, $root.google.cloud.documentai.v1beta3.GetEvaluationRequest, $root.google.cloud.documentai.v1beta3.Evaluation, request, callback); - }, "name", { value: "GetEvaluation" }); - - /** - * Calls GetEvaluation. - * @function getEvaluation - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IGetEvaluationRequest} request GetEvaluationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|listEvaluations}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef ListEvaluationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.ListEvaluationsResponse} [response] ListEvaluationsResponse - */ - - /** - * Calls ListEvaluations. - * @function listEvaluations - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluationsCallback} callback Node-style callback called with the error, if any, and ListEvaluationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.listEvaluations = function listEvaluations(request, callback) { - return this.rpcCall(listEvaluations, $root.google.cloud.documentai.v1beta3.ListEvaluationsRequest, $root.google.cloud.documentai.v1beta3.ListEvaluationsResponse, request, callback); - }, "name", { value: "ListEvaluations" }); - - /** - * Calls ListEvaluations. - * @function listEvaluations - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IListEvaluationsRequest} request ListEvaluationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentProcessorService|importProcessorVersion}. - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @typedef ImportProcessorVersionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ImportProcessorVersion. - * @function importProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionRequest} request ImportProcessorVersionRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentProcessorService.prototype.importProcessorVersion = function importProcessorVersion(request, callback) { - return this.rpcCall(importProcessorVersion, $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportProcessorVersion" }); - - /** - * Calls ImportProcessorVersion. - * @function importProcessorVersion - * @memberof google.cloud.documentai.v1beta3.DocumentProcessorService - * @instance - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionRequest} request ImportProcessorVersionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return DocumentProcessorService; - })(); - - v1beta3.ProcessOptions = (function() { - - /** - * Properties of a ProcessOptions. - * @memberof google.cloud.documentai.v1beta3 - * @interface IProcessOptions - * @property {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector|null} [individualPageSelector] ProcessOptions individualPageSelector - * @property {number|null} [fromStart] ProcessOptions fromStart - * @property {number|null} [fromEnd] ProcessOptions fromEnd - * @property {google.cloud.documentai.v1beta3.IOcrConfig|null} [ocrConfig] ProcessOptions ocrConfig - * @property {google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig|null} [layoutConfig] ProcessOptions layoutConfig - * @property {google.cloud.documentai.v1beta3.IDocumentSchema|null} [schemaOverride] ProcessOptions schemaOverride - */ - - /** - * Constructs a new ProcessOptions. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ProcessOptions. - * @implements IProcessOptions - * @constructor - * @param {google.cloud.documentai.v1beta3.IProcessOptions=} [properties] Properties to set - */ - function ProcessOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProcessOptions individualPageSelector. - * @member {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector|null|undefined} individualPageSelector - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @instance - */ - ProcessOptions.prototype.individualPageSelector = null; - - /** - * ProcessOptions fromStart. - * @member {number|null|undefined} fromStart - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @instance - */ - ProcessOptions.prototype.fromStart = null; - - /** - * ProcessOptions fromEnd. - * @member {number|null|undefined} fromEnd - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @instance - */ - ProcessOptions.prototype.fromEnd = null; - - /** - * ProcessOptions ocrConfig. - * @member {google.cloud.documentai.v1beta3.IOcrConfig|null|undefined} ocrConfig - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @instance - */ - ProcessOptions.prototype.ocrConfig = null; - - /** - * ProcessOptions layoutConfig. - * @member {google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig|null|undefined} layoutConfig - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @instance - */ - ProcessOptions.prototype.layoutConfig = null; - - /** - * ProcessOptions schemaOverride. - * @member {google.cloud.documentai.v1beta3.IDocumentSchema|null|undefined} schemaOverride - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @instance - */ - ProcessOptions.prototype.schemaOverride = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ProcessOptions pageRange. - * @member {"individualPageSelector"|"fromStart"|"fromEnd"|undefined} pageRange - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @instance - */ - Object.defineProperty(ProcessOptions.prototype, "pageRange", { - get: $util.oneOfGetter($oneOfFields = ["individualPageSelector", "fromStart", "fromEnd"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ProcessOptions instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @static - * @param {google.cloud.documentai.v1beta3.IProcessOptions=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessOptions} ProcessOptions instance - */ - ProcessOptions.create = function create(properties) { - return new ProcessOptions(properties); - }; - - /** - * Encodes the specified ProcessOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @static - * @param {google.cloud.documentai.v1beta3.IProcessOptions} message ProcessOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ocrConfig != null && Object.hasOwnProperty.call(message, "ocrConfig")) - $root.google.cloud.documentai.v1beta3.OcrConfig.encode(message.ocrConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.individualPageSelector != null && Object.hasOwnProperty.call(message, "individualPageSelector")) - $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.encode(message.individualPageSelector, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.fromStart != null && Object.hasOwnProperty.call(message, "fromStart")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.fromStart); - if (message.fromEnd != null && Object.hasOwnProperty.call(message, "fromEnd")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.fromEnd); - if (message.schemaOverride != null && Object.hasOwnProperty.call(message, "schemaOverride")) - $root.google.cloud.documentai.v1beta3.DocumentSchema.encode(message.schemaOverride, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.layoutConfig != null && Object.hasOwnProperty.call(message, "layoutConfig")) - $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.encode(message.layoutConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ProcessOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @static - * @param {google.cloud.documentai.v1beta3.IProcessOptions} message ProcessOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessOptions} ProcessOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessOptions.decode = function decode(reader, 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.v1beta3.ProcessOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.individualPageSelector = $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.decode(reader, reader.uint32()); - break; - } - case 6: { - message.fromStart = reader.int32(); - break; - } - case 7: { - message.fromEnd = reader.int32(); - break; - } - case 1: { - message.ocrConfig = $root.google.cloud.documentai.v1beta3.OcrConfig.decode(reader, reader.uint32()); - break; - } - case 9: { - message.layoutConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - message.schemaOverride = $root.google.cloud.documentai.v1beta3.DocumentSchema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessOptions} ProcessOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessOptions message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.individualPageSelector != null && message.hasOwnProperty("individualPageSelector")) { - properties.pageRange = 1; - { - var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify(message.individualPageSelector); - if (error) - return "individualPageSelector." + error; - } - } - if (message.fromStart != null && message.hasOwnProperty("fromStart")) { - if (properties.pageRange === 1) - return "pageRange: multiple values"; - properties.pageRange = 1; - if (!$util.isInteger(message.fromStart)) - return "fromStart: integer expected"; - } - if (message.fromEnd != null && message.hasOwnProperty("fromEnd")) { - if (properties.pageRange === 1) - return "pageRange: multiple values"; - properties.pageRange = 1; - if (!$util.isInteger(message.fromEnd)) - return "fromEnd: integer expected"; - } - if (message.ocrConfig != null && message.hasOwnProperty("ocrConfig")) { - var error = $root.google.cloud.documentai.v1beta3.OcrConfig.verify(message.ocrConfig); - if (error) - return "ocrConfig." + error; - } - if (message.layoutConfig != null && message.hasOwnProperty("layoutConfig")) { - var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.verify(message.layoutConfig); - if (error) - return "layoutConfig." + error; - } - if (message.schemaOverride != null && message.hasOwnProperty("schemaOverride")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.verify(message.schemaOverride); - if (error) - return "schemaOverride." + error; - } - return null; - }; - - /** - * Creates a ProcessOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessOptions} ProcessOptions - */ - ProcessOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessOptions) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessOptions(); - if (object.individualPageSelector != null) { - if (typeof object.individualPageSelector !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.individualPageSelector: object expected"); - message.individualPageSelector = $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.fromObject(object.individualPageSelector); - } - if (object.fromStart != null) - message.fromStart = object.fromStart | 0; - if (object.fromEnd != null) - message.fromEnd = object.fromEnd | 0; - if (object.ocrConfig != null) { - if (typeof object.ocrConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.ocrConfig: object expected"); - message.ocrConfig = $root.google.cloud.documentai.v1beta3.OcrConfig.fromObject(object.ocrConfig); - } - if (object.layoutConfig != null) { - if (typeof object.layoutConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.layoutConfig: object expected"); - message.layoutConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.fromObject(object.layoutConfig); - } - if (object.schemaOverride != null) { - if (typeof object.schemaOverride !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.schemaOverride: object expected"); - message.schemaOverride = $root.google.cloud.documentai.v1beta3.DocumentSchema.fromObject(object.schemaOverride); - } - return message; - }; - - /** - * Creates a plain object from a ProcessOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions} message ProcessOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ocrConfig = null; - object.schemaOverride = null; - object.layoutConfig = null; - } - if (message.ocrConfig != null && message.hasOwnProperty("ocrConfig")) - object.ocrConfig = $root.google.cloud.documentai.v1beta3.OcrConfig.toObject(message.ocrConfig, options); - if (message.individualPageSelector != null && message.hasOwnProperty("individualPageSelector")) { - object.individualPageSelector = $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.toObject(message.individualPageSelector, options); - if (options.oneofs) - object.pageRange = "individualPageSelector"; - } - if (message.fromStart != null && message.hasOwnProperty("fromStart")) { - object.fromStart = message.fromStart; - if (options.oneofs) - object.pageRange = "fromStart"; - } - if (message.fromEnd != null && message.hasOwnProperty("fromEnd")) { - object.fromEnd = message.fromEnd; - if (options.oneofs) - object.pageRange = "fromEnd"; - } - if (message.schemaOverride != null && message.hasOwnProperty("schemaOverride")) - object.schemaOverride = $root.google.cloud.documentai.v1beta3.DocumentSchema.toObject(message.schemaOverride, options); - if (message.layoutConfig != null && message.hasOwnProperty("layoutConfig")) - object.layoutConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.toObject(message.layoutConfig, options); - return object; - }; - - /** - * Converts this ProcessOptions to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @instance - * @returns {Object.} JSON object - */ - ProcessOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessOptions - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessOptions"; - }; - - ProcessOptions.LayoutConfig = (function() { - - /** - * Properties of a LayoutConfig. - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @interface ILayoutConfig - * @property {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig|null} [chunkingConfig] LayoutConfig chunkingConfig - * @property {boolean|null} [returnImages] LayoutConfig returnImages - * @property {boolean|null} [returnBoundingBoxes] LayoutConfig returnBoundingBoxes - * @property {boolean|null} [enableImageAnnotation] LayoutConfig enableImageAnnotation - * @property {boolean|null} [enableImageExtraction] LayoutConfig enableImageExtraction - * @property {boolean|null} [enableLlmLayoutParsing] LayoutConfig enableLlmLayoutParsing - * @property {boolean|null} [enableTableAnnotation] LayoutConfig enableTableAnnotation - * @property {boolean|null} [enableTableSplit] LayoutConfig enableTableSplit - */ - - /** - * Constructs a new LayoutConfig. - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @classdesc Represents a LayoutConfig. - * @implements ILayoutConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig=} [properties] Properties to set - */ - function LayoutConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LayoutConfig chunkingConfig. - * @member {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig|null|undefined} chunkingConfig - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @instance - */ - LayoutConfig.prototype.chunkingConfig = null; - - /** - * LayoutConfig returnImages. - * @member {boolean} returnImages - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @instance - */ - LayoutConfig.prototype.returnImages = false; - - /** - * LayoutConfig returnBoundingBoxes. - * @member {boolean} returnBoundingBoxes - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @instance - */ - LayoutConfig.prototype.returnBoundingBoxes = false; - - /** - * LayoutConfig enableImageAnnotation. - * @member {boolean} enableImageAnnotation - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @instance - */ - LayoutConfig.prototype.enableImageAnnotation = false; - - /** - * LayoutConfig enableImageExtraction. - * @member {boolean} enableImageExtraction - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @instance - */ - LayoutConfig.prototype.enableImageExtraction = false; - - /** - * LayoutConfig enableLlmLayoutParsing. - * @member {boolean} enableLlmLayoutParsing - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @instance - */ - LayoutConfig.prototype.enableLlmLayoutParsing = false; - - /** - * LayoutConfig enableTableAnnotation. - * @member {boolean} enableTableAnnotation - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @instance - */ - LayoutConfig.prototype.enableTableAnnotation = false; - - /** - * LayoutConfig enableTableSplit. - * @member {boolean} enableTableSplit - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @instance - */ - LayoutConfig.prototype.enableTableSplit = false; - - /** - * Creates a new LayoutConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig} LayoutConfig instance - */ - LayoutConfig.create = function create(properties) { - return new LayoutConfig(properties); - }; - - /** - * Encodes the specified LayoutConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig} message LayoutConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chunkingConfig != null && Object.hasOwnProperty.call(message, "chunkingConfig")) - $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.encode(message.chunkingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.returnImages != null && Object.hasOwnProperty.call(message, "returnImages")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.returnImages); - if (message.returnBoundingBoxes != null && Object.hasOwnProperty.call(message, "returnBoundingBoxes")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.returnBoundingBoxes); - if (message.enableImageAnnotation != null && Object.hasOwnProperty.call(message, "enableImageAnnotation")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableImageAnnotation); - if (message.enableLlmLayoutParsing != null && Object.hasOwnProperty.call(message, "enableLlmLayoutParsing")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableLlmLayoutParsing); - if (message.enableTableAnnotation != null && Object.hasOwnProperty.call(message, "enableTableAnnotation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableTableAnnotation); - if (message.enableImageExtraction != null && Object.hasOwnProperty.call(message, "enableImageExtraction")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableImageExtraction); - if (message.enableTableSplit != null && Object.hasOwnProperty.call(message, "enableTableSplit")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableTableSplit); - return writer; - }; - - /** - * Encodes the specified LayoutConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions.ILayoutConfig} message LayoutConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LayoutConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LayoutConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig} LayoutConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutConfig.decode = function decode(reader, 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.v1beta3.ProcessOptions.LayoutConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.chunkingConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.returnImages = reader.bool(); - break; - } - case 3: { - message.returnBoundingBoxes = reader.bool(); - break; - } - case 4: { - message.enableImageAnnotation = reader.bool(); - break; - } - case 7: { - message.enableImageExtraction = reader.bool(); - break; - } - case 5: { - message.enableLlmLayoutParsing = reader.bool(); - break; - } - case 6: { - message.enableTableAnnotation = reader.bool(); - break; - } - case 8: { - message.enableTableSplit = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LayoutConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig} LayoutConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LayoutConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LayoutConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LayoutConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chunkingConfig != null && message.hasOwnProperty("chunkingConfig")) { - var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.verify(message.chunkingConfig); - if (error) - return "chunkingConfig." + error; - } - if (message.returnImages != null && message.hasOwnProperty("returnImages")) - if (typeof message.returnImages !== "boolean") - return "returnImages: boolean expected"; - if (message.returnBoundingBoxes != null && message.hasOwnProperty("returnBoundingBoxes")) - if (typeof message.returnBoundingBoxes !== "boolean") - return "returnBoundingBoxes: boolean expected"; - if (message.enableImageAnnotation != null && message.hasOwnProperty("enableImageAnnotation")) - if (typeof message.enableImageAnnotation !== "boolean") - return "enableImageAnnotation: boolean expected"; - if (message.enableImageExtraction != null && message.hasOwnProperty("enableImageExtraction")) - if (typeof message.enableImageExtraction !== "boolean") - return "enableImageExtraction: boolean expected"; - if (message.enableLlmLayoutParsing != null && message.hasOwnProperty("enableLlmLayoutParsing")) - if (typeof message.enableLlmLayoutParsing !== "boolean") - return "enableLlmLayoutParsing: boolean expected"; - if (message.enableTableAnnotation != null && message.hasOwnProperty("enableTableAnnotation")) - if (typeof message.enableTableAnnotation !== "boolean") - return "enableTableAnnotation: boolean expected"; - if (message.enableTableSplit != null && message.hasOwnProperty("enableTableSplit")) - if (typeof message.enableTableSplit !== "boolean") - return "enableTableSplit: boolean expected"; - return null; - }; - - /** - * Creates a LayoutConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig} LayoutConfig - */ - LayoutConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig(); - if (object.chunkingConfig != null) { - if (typeof object.chunkingConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.chunkingConfig: object expected"); - message.chunkingConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.fromObject(object.chunkingConfig); - } - if (object.returnImages != null) - message.returnImages = Boolean(object.returnImages); - if (object.returnBoundingBoxes != null) - message.returnBoundingBoxes = Boolean(object.returnBoundingBoxes); - if (object.enableImageAnnotation != null) - message.enableImageAnnotation = Boolean(object.enableImageAnnotation); - if (object.enableImageExtraction != null) - message.enableImageExtraction = Boolean(object.enableImageExtraction); - if (object.enableLlmLayoutParsing != null) - message.enableLlmLayoutParsing = Boolean(object.enableLlmLayoutParsing); - if (object.enableTableAnnotation != null) - message.enableTableAnnotation = Boolean(object.enableTableAnnotation); - if (object.enableTableSplit != null) - message.enableTableSplit = Boolean(object.enableTableSplit); - return message; - }; - - /** - * Creates a plain object from a LayoutConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig} message LayoutConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LayoutConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.chunkingConfig = null; - object.returnImages = false; - object.returnBoundingBoxes = false; - object.enableImageAnnotation = false; - object.enableLlmLayoutParsing = false; - object.enableTableAnnotation = false; - object.enableImageExtraction = false; - object.enableTableSplit = false; - } - if (message.chunkingConfig != null && message.hasOwnProperty("chunkingConfig")) - object.chunkingConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.toObject(message.chunkingConfig, options); - if (message.returnImages != null && message.hasOwnProperty("returnImages")) - object.returnImages = message.returnImages; - if (message.returnBoundingBoxes != null && message.hasOwnProperty("returnBoundingBoxes")) - object.returnBoundingBoxes = message.returnBoundingBoxes; - if (message.enableImageAnnotation != null && message.hasOwnProperty("enableImageAnnotation")) - object.enableImageAnnotation = message.enableImageAnnotation; - if (message.enableLlmLayoutParsing != null && message.hasOwnProperty("enableLlmLayoutParsing")) - object.enableLlmLayoutParsing = message.enableLlmLayoutParsing; - if (message.enableTableAnnotation != null && message.hasOwnProperty("enableTableAnnotation")) - object.enableTableAnnotation = message.enableTableAnnotation; - if (message.enableImageExtraction != null && message.hasOwnProperty("enableImageExtraction")) - object.enableImageExtraction = message.enableImageExtraction; - if (message.enableTableSplit != null && message.hasOwnProperty("enableTableSplit")) - object.enableTableSplit = message.enableTableSplit; - return object; - }; - - /** - * Converts this LayoutConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @instance - * @returns {Object.} JSON object - */ - LayoutConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LayoutConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LayoutConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig"; - }; - - LayoutConfig.ChunkingConfig = (function() { - - /** - * Properties of a ChunkingConfig. - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @interface IChunkingConfig - * @property {number|null} [chunkSize] ChunkingConfig chunkSize - * @property {boolean|null} [includeAncestorHeadings] ChunkingConfig includeAncestorHeadings - * @property {boolean|null} [semanticChunkingGroupSize] ChunkingConfig semanticChunkingGroupSize - * @property {number|null} [breakpointPercentileThreshold] ChunkingConfig breakpointPercentileThreshold - */ - - /** - * Constructs a new ChunkingConfig. - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig - * @classdesc Represents a ChunkingConfig. - * @implements IChunkingConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig=} [properties] Properties to set - */ - function ChunkingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ChunkingConfig chunkSize. - * @member {number} chunkSize - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @instance - */ - ChunkingConfig.prototype.chunkSize = 0; - - /** - * ChunkingConfig includeAncestorHeadings. - * @member {boolean} includeAncestorHeadings - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @instance - */ - ChunkingConfig.prototype.includeAncestorHeadings = false; - - /** - * ChunkingConfig semanticChunkingGroupSize. - * @member {boolean} semanticChunkingGroupSize - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @instance - */ - ChunkingConfig.prototype.semanticChunkingGroupSize = false; - - /** - * ChunkingConfig breakpointPercentileThreshold. - * @member {number} breakpointPercentileThreshold - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @instance - */ - ChunkingConfig.prototype.breakpointPercentileThreshold = 0; - - /** - * Creates a new ChunkingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig instance - */ - ChunkingConfig.create = function create(properties) { - return new ChunkingConfig(properties); - }; - - /** - * Encodes the specified ChunkingConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig} message ChunkingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.chunkSize != null && Object.hasOwnProperty.call(message, "chunkSize")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.chunkSize); - if (message.includeAncestorHeadings != null && Object.hasOwnProperty.call(message, "includeAncestorHeadings")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.includeAncestorHeadings); - if (message.semanticChunkingGroupSize != null && Object.hasOwnProperty.call(message, "semanticChunkingGroupSize")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.semanticChunkingGroupSize); - if (message.breakpointPercentileThreshold != null && Object.hasOwnProperty.call(message, "breakpointPercentileThreshold")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.breakpointPercentileThreshold); - return writer; - }; - - /** - * Encodes the specified ChunkingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.IChunkingConfig} message ChunkingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ChunkingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ChunkingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkingConfig.decode = function decode(reader, 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.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.chunkSize = reader.int32(); - break; - } - case 2: { - message.includeAncestorHeadings = reader.bool(); - break; - } - case 3: { - message.semanticChunkingGroupSize = reader.bool(); - break; - } - case 4: { - message.breakpointPercentileThreshold = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ChunkingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ChunkingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ChunkingConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ChunkingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) - if (!$util.isInteger(message.chunkSize)) - return "chunkSize: integer expected"; - if (message.includeAncestorHeadings != null && message.hasOwnProperty("includeAncestorHeadings")) - if (typeof message.includeAncestorHeadings !== "boolean") - return "includeAncestorHeadings: boolean expected"; - if (message.semanticChunkingGroupSize != null && message.hasOwnProperty("semanticChunkingGroupSize")) - if (typeof message.semanticChunkingGroupSize !== "boolean") - return "semanticChunkingGroupSize: boolean expected"; - if (message.breakpointPercentileThreshold != null && message.hasOwnProperty("breakpointPercentileThreshold")) - if (!$util.isInteger(message.breakpointPercentileThreshold)) - return "breakpointPercentileThreshold: integer expected"; - return null; - }; - - /** - * Creates a ChunkingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig} ChunkingConfig - */ - ChunkingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig(); - if (object.chunkSize != null) - message.chunkSize = object.chunkSize | 0; - if (object.includeAncestorHeadings != null) - message.includeAncestorHeadings = Boolean(object.includeAncestorHeadings); - if (object.semanticChunkingGroupSize != null) - message.semanticChunkingGroupSize = Boolean(object.semanticChunkingGroupSize); - if (object.breakpointPercentileThreshold != null) - message.breakpointPercentileThreshold = object.breakpointPercentileThreshold | 0; - return message; - }; - - /** - * Creates a plain object from a ChunkingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig} message ChunkingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ChunkingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.chunkSize = 0; - object.includeAncestorHeadings = false; - object.semanticChunkingGroupSize = false; - object.breakpointPercentileThreshold = 0; - } - if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) - object.chunkSize = message.chunkSize; - if (message.includeAncestorHeadings != null && message.hasOwnProperty("includeAncestorHeadings")) - object.includeAncestorHeadings = message.includeAncestorHeadings; - if (message.semanticChunkingGroupSize != null && message.hasOwnProperty("semanticChunkingGroupSize")) - object.semanticChunkingGroupSize = message.semanticChunkingGroupSize; - if (message.breakpointPercentileThreshold != null && message.hasOwnProperty("breakpointPercentileThreshold")) - object.breakpointPercentileThreshold = message.breakpointPercentileThreshold; - return object; - }; - - /** - * Converts this ChunkingConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @instance - * @returns {Object.} JSON object - */ - ChunkingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ChunkingConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ChunkingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig"; - }; - - return ChunkingConfig; - })(); - - return LayoutConfig; - })(); - - ProcessOptions.IndividualPageSelector = (function() { - - /** - * Properties of an IndividualPageSelector. - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @interface IIndividualPageSelector - * @property {Array.|null} [pages] IndividualPageSelector pages - */ - - /** - * Constructs a new IndividualPageSelector. - * @memberof google.cloud.documentai.v1beta3.ProcessOptions - * @classdesc Represents an IndividualPageSelector. - * @implements IIndividualPageSelector - * @constructor - * @param {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector=} [properties] Properties to set - */ - function IndividualPageSelector(properties) { - this.pages = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IndividualPageSelector pages. - * @member {Array.} pages - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector - * @instance - */ - IndividualPageSelector.prototype.pages = $util.emptyArray; - - /** - * Creates a new IndividualPageSelector instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} IndividualPageSelector instance - */ - IndividualPageSelector.create = function create(properties) { - return new IndividualPageSelector(properties); - }; - - /** - * Encodes the specified IndividualPageSelector message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector} message IndividualPageSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualPageSelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pages != null && message.pages.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.pages.length; ++i) - writer.int32(message.pages[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified IndividualPageSelector message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions.IIndividualPageSelector} message IndividualPageSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualPageSelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IndividualPageSelector message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} IndividualPageSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualPageSelector.decode = function decode(reader, 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.v1beta3.ProcessOptions.IndividualPageSelector(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.pages && message.pages.length)) - message.pages = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.pages.push(reader.int32()); - } else - message.pages.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IndividualPageSelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} IndividualPageSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualPageSelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IndividualPageSelector message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndividualPageSelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - 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) - if (!$util.isInteger(message.pages[i])) - return "pages: integer[] expected"; - } - return null; - }; - - /** - * Creates an IndividualPageSelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} IndividualPageSelector - */ - IndividualPageSelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector(); - if (object.pages) { - if (!Array.isArray(object.pages)) - throw TypeError(".google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector.pages: array expected"); - message.pages = []; - for (var i = 0; i < object.pages.length; ++i) - message.pages[i] = object.pages[i] | 0; - } - return message; - }; - - /** - * Creates a plain object from an IndividualPageSelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector - * @static - * @param {google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector} message IndividualPageSelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndividualPageSelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.pages = []; - if (message.pages && message.pages.length) { - object.pages = []; - for (var j = 0; j < message.pages.length; ++j) - object.pages[j] = message.pages[j]; - } - return object; - }; - - /** - * Converts this IndividualPageSelector to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector - * @instance - * @returns {Object.} JSON object - */ - IndividualPageSelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IndividualPageSelector - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndividualPageSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessOptions.IndividualPageSelector"; - }; - - return IndividualPageSelector; - })(); - - return ProcessOptions; - })(); - - v1beta3.ProcessRequest = (function() { - - /** - * Properties of a ProcessRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IProcessRequest - * @property {google.cloud.documentai.v1beta3.IDocument|null} [inlineDocument] ProcessRequest inlineDocument - * @property {google.cloud.documentai.v1beta3.IRawDocument|null} [rawDocument] ProcessRequest rawDocument - * @property {google.cloud.documentai.v1beta3.IGcsDocument|null} [gcsDocument] ProcessRequest gcsDocument - * @property {string|null} [name] ProcessRequest name - * @property {google.cloud.documentai.v1beta3.IDocument|null} [document] ProcessRequest document - * @property {boolean|null} [skipHumanReview] ProcessRequest skipHumanReview - * @property {google.protobuf.IFieldMask|null} [fieldMask] ProcessRequest fieldMask - * @property {google.cloud.documentai.v1beta3.IProcessOptions|null} [processOptions] ProcessRequest processOptions - * @property {Object.|null} [labels] ProcessRequest labels - * @property {boolean|null} [imagelessMode] ProcessRequest imagelessMode - */ - - /** - * Constructs a new ProcessRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ProcessRequest. - * @implements IProcessRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IProcessRequest=} [properties] Properties to set - */ - function ProcessRequest(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProcessRequest inlineDocument. - * @member {google.cloud.documentai.v1beta3.IDocument|null|undefined} inlineDocument - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @instance - */ - ProcessRequest.prototype.inlineDocument = null; - - /** - * ProcessRequest rawDocument. - * @member {google.cloud.documentai.v1beta3.IRawDocument|null|undefined} rawDocument - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @instance - */ - ProcessRequest.prototype.rawDocument = null; - - /** - * ProcessRequest gcsDocument. - * @member {google.cloud.documentai.v1beta3.IGcsDocument|null|undefined} gcsDocument - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @instance - */ - ProcessRequest.prototype.gcsDocument = null; - - /** - * ProcessRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @instance - */ - ProcessRequest.prototype.name = ""; - - /** - * ProcessRequest document. - * @member {google.cloud.documentai.v1beta3.IDocument|null|undefined} document - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @instance - */ - ProcessRequest.prototype.document = null; - - /** - * ProcessRequest skipHumanReview. - * @member {boolean} skipHumanReview - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @instance - */ - ProcessRequest.prototype.skipHumanReview = false; - - /** - * ProcessRequest fieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} fieldMask - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @instance - */ - ProcessRequest.prototype.fieldMask = null; - - /** - * ProcessRequest processOptions. - * @member {google.cloud.documentai.v1beta3.IProcessOptions|null|undefined} processOptions - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @instance - */ - ProcessRequest.prototype.processOptions = null; - - /** - * ProcessRequest labels. - * @member {Object.} labels - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @instance - */ - ProcessRequest.prototype.labels = $util.emptyObject; - - /** - * ProcessRequest imagelessMode. - * @member {boolean} imagelessMode - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @instance - */ - ProcessRequest.prototype.imagelessMode = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ProcessRequest source. - * @member {"inlineDocument"|"rawDocument"|"gcsDocument"|undefined} source - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @instance - */ - Object.defineProperty(ProcessRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["inlineDocument", "rawDocument", "gcsDocument"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ProcessRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @static - * @param {google.cloud.documentai.v1beta3.IProcessRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessRequest} ProcessRequest instance - */ - ProcessRequest.create = function create(properties) { - return new ProcessRequest(properties); - }; - - /** - * Encodes the specified ProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @static - * @param {google.cloud.documentai.v1beta3.IProcessRequest} message ProcessRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessRequest.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.documentai.v1beta3.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.skipHumanReview != null && Object.hasOwnProperty.call(message, "skipHumanReview")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skipHumanReview); - if (message.inlineDocument != null && Object.hasOwnProperty.call(message, "inlineDocument")) - $root.google.cloud.documentai.v1beta3.Document.encode(message.inlineDocument, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.rawDocument != null && Object.hasOwnProperty.call(message, "rawDocument")) - $root.google.cloud.documentai.v1beta3.RawDocument.encode(message.rawDocument, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.processOptions != null && Object.hasOwnProperty.call(message, "processOptions")) - $root.google.cloud.documentai.v1beta3.ProcessOptions.encode(message.processOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.gcsDocument != null && Object.hasOwnProperty.call(message, "gcsDocument")) - $root.google.cloud.documentai.v1beta3.GcsDocument.encode(message.gcsDocument, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.imagelessMode != null && Object.hasOwnProperty.call(message, "imagelessMode")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.imagelessMode); - return writer; - }; - - /** - * Encodes the specified ProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @static - * @param {google.cloud.documentai.v1beta3.IProcessRequest} message ProcessRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessRequest} ProcessRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessRequest.decode = function decode(reader, 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.v1beta3.ProcessRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.inlineDocument = $root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32()); - break; - } - case 5: { - message.rawDocument = $root.google.cloud.documentai.v1beta3.RawDocument.decode(reader, reader.uint32()); - break; - } - case 8: { - message.gcsDocument = $root.google.cloud.documentai.v1beta3.GcsDocument.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.document = $root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32()); - break; - } - case 3: { - message.skipHumanReview = reader.bool(); - break; - } - case 6: { - message.fieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 7: { - message.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.decode(reader, reader.uint32()); - break; - } - case 10: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 11: { - message.imagelessMode = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessRequest} ProcessRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1beta3.Document.verify(message.inlineDocument); - if (error) - return "inlineDocument." + error; - } - } - if (message.rawDocument != null && message.hasOwnProperty("rawDocument")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1beta3.RawDocument.verify(message.rawDocument); - if (error) - return "rawDocument." + error; - } - } - if (message.gcsDocument != null && message.hasOwnProperty("gcsDocument")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1beta3.GcsDocument.verify(message.gcsDocument); - if (error) - return "gcsDocument." + error; - } - } - 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.documentai.v1beta3.Document.verify(message.document); - if (error) - return "document." + error; - } - if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) - if (typeof message.skipHumanReview !== "boolean") - return "skipHumanReview: boolean expected"; - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.fieldMask); - if (error) - return "fieldMask." + error; - } - if (message.processOptions != null && message.hasOwnProperty("processOptions")) { - var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.verify(message.processOptions); - if (error) - return "processOptions." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.imagelessMode != null && message.hasOwnProperty("imagelessMode")) - if (typeof message.imagelessMode !== "boolean") - return "imagelessMode: boolean expected"; - return null; - }; - - /** - * Creates a ProcessRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessRequest} ProcessRequest - */ - ProcessRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessRequest(); - if (object.inlineDocument != null) { - if (typeof object.inlineDocument !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.inlineDocument: object expected"); - message.inlineDocument = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.inlineDocument); - } - if (object.rawDocument != null) { - if (typeof object.rawDocument !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.rawDocument: object expected"); - message.rawDocument = $root.google.cloud.documentai.v1beta3.RawDocument.fromObject(object.rawDocument); - } - if (object.gcsDocument != null) { - if (typeof object.gcsDocument !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.gcsDocument: object expected"); - message.gcsDocument = $root.google.cloud.documentai.v1beta3.GcsDocument.fromObject(object.gcsDocument); - } - if (object.name != null) - message.name = String(object.name); - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.document: object expected"); - message.document = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.document); - } - if (object.skipHumanReview != null) - message.skipHumanReview = Boolean(object.skipHumanReview); - if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.fieldMask: object expected"); - message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask); - } - if (object.processOptions != null) { - if (typeof object.processOptions !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.processOptions: object expected"); - message.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.fromObject(object.processOptions); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessRequest.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.imagelessMode != null) - message.imagelessMode = Boolean(object.imagelessMode); - return message; - }; - - /** - * Creates a plain object from a ProcessRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @static - * @param {google.cloud.documentai.v1beta3.ProcessRequest} message ProcessRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.document = null; - object.skipHumanReview = false; - object.fieldMask = null; - object.processOptions = null; - object.imagelessMode = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.document != null && message.hasOwnProperty("document")) - object.document = $root.google.cloud.documentai.v1beta3.Document.toObject(message.document, options); - if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) - object.skipHumanReview = message.skipHumanReview; - if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { - object.inlineDocument = $root.google.cloud.documentai.v1beta3.Document.toObject(message.inlineDocument, options); - if (options.oneofs) - object.source = "inlineDocument"; - } - if (message.rawDocument != null && message.hasOwnProperty("rawDocument")) { - object.rawDocument = $root.google.cloud.documentai.v1beta3.RawDocument.toObject(message.rawDocument, options); - if (options.oneofs) - object.source = "rawDocument"; - } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); - if (message.processOptions != null && message.hasOwnProperty("processOptions")) - object.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.toObject(message.processOptions, options); - if (message.gcsDocument != null && message.hasOwnProperty("gcsDocument")) { - object.gcsDocument = $root.google.cloud.documentai.v1beta3.GcsDocument.toObject(message.gcsDocument, options); - if (options.oneofs) - object.source = "gcsDocument"; - } - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.imagelessMode != null && message.hasOwnProperty("imagelessMode")) - object.imagelessMode = message.imagelessMode; - return object; - }; - - /** - * Converts this ProcessRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @instance - * @returns {Object.} JSON object - */ - ProcessRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessRequest"; - }; - - return ProcessRequest; - })(); - - v1beta3.HumanReviewStatus = (function() { - - /** - * Properties of a HumanReviewStatus. - * @memberof google.cloud.documentai.v1beta3 - * @interface IHumanReviewStatus - * @property {google.cloud.documentai.v1beta3.HumanReviewStatus.State|null} [state] HumanReviewStatus state - * @property {string|null} [stateMessage] HumanReviewStatus stateMessage - * @property {string|null} [humanReviewOperation] HumanReviewStatus humanReviewOperation - */ - - /** - * Constructs a new HumanReviewStatus. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a HumanReviewStatus. - * @implements IHumanReviewStatus - * @constructor - * @param {google.cloud.documentai.v1beta3.IHumanReviewStatus=} [properties] Properties to set - */ - function HumanReviewStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HumanReviewStatus state. - * @member {google.cloud.documentai.v1beta3.HumanReviewStatus.State} state - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @instance - */ - HumanReviewStatus.prototype.state = 0; - - /** - * HumanReviewStatus stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @instance - */ - HumanReviewStatus.prototype.stateMessage = ""; - - /** - * HumanReviewStatus humanReviewOperation. - * @member {string} humanReviewOperation - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @instance - */ - HumanReviewStatus.prototype.humanReviewOperation = ""; - - /** - * Creates a new HumanReviewStatus instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @static - * @param {google.cloud.documentai.v1beta3.IHumanReviewStatus=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.HumanReviewStatus} HumanReviewStatus instance - */ - HumanReviewStatus.create = function create(properties) { - return new HumanReviewStatus(properties); - }; - - /** - * Encodes the specified HumanReviewStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.HumanReviewStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @static - * @param {google.cloud.documentai.v1beta3.IHumanReviewStatus} message HumanReviewStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HumanReviewStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); - if (message.humanReviewOperation != null && Object.hasOwnProperty.call(message, "humanReviewOperation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.humanReviewOperation); - return writer; - }; - - /** - * Encodes the specified HumanReviewStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.HumanReviewStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @static - * @param {google.cloud.documentai.v1beta3.IHumanReviewStatus} message HumanReviewStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HumanReviewStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HumanReviewStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.HumanReviewStatus} HumanReviewStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HumanReviewStatus.decode = function decode(reader, 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.v1beta3.HumanReviewStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.stateMessage = reader.string(); - break; - } - case 3: { - message.humanReviewOperation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HumanReviewStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.HumanReviewStatus} HumanReviewStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HumanReviewStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HumanReviewStatus message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HumanReviewStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) - if (!$util.isString(message.humanReviewOperation)) - return "humanReviewOperation: string expected"; - return null; - }; - - /** - * Creates a HumanReviewStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.HumanReviewStatus} HumanReviewStatus - */ - HumanReviewStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.HumanReviewStatus) - return object; - var message = new $root.google.cloud.documentai.v1beta3.HumanReviewStatus(); - 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 "SKIPPED": - case 1: - message.state = 1; - break; - case "VALIDATION_PASSED": - case 2: - message.state = 2; - break; - case "IN_PROGRESS": - case 3: - message.state = 3; - break; - case "ERROR": - case 4: - message.state = 4; - break; - } - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.humanReviewOperation != null) - message.humanReviewOperation = String(object.humanReviewOperation); - return message; - }; - - /** - * Creates a plain object from a HumanReviewStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @static - * @param {google.cloud.documentai.v1beta3.HumanReviewStatus} message HumanReviewStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HumanReviewStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; - object.humanReviewOperation = ""; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.HumanReviewStatus.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.HumanReviewStatus.State[message.state] : message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) - object.humanReviewOperation = message.humanReviewOperation; - return object; - }; - - /** - * Converts this HumanReviewStatus to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @instance - * @returns {Object.} JSON object - */ - HumanReviewStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HumanReviewStatus - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.HumanReviewStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HumanReviewStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.HumanReviewStatus"; - }; - - /** - * State enum. - * @name google.cloud.documentai.v1beta3.HumanReviewStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} SKIPPED=1 SKIPPED value - * @property {number} VALIDATION_PASSED=2 VALIDATION_PASSED value - * @property {number} IN_PROGRESS=3 IN_PROGRESS value - * @property {number} ERROR=4 ERROR value - */ - HumanReviewStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SKIPPED"] = 1; - values[valuesById[2] = "VALIDATION_PASSED"] = 2; - values[valuesById[3] = "IN_PROGRESS"] = 3; - values[valuesById[4] = "ERROR"] = 4; - return values; - })(); - - return HumanReviewStatus; - })(); - - v1beta3.ProcessResponse = (function() { - - /** - * Properties of a ProcessResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IProcessResponse - * @property {google.cloud.documentai.v1beta3.IDocument|null} [document] ProcessResponse document - * @property {string|null} [humanReviewOperation] ProcessResponse humanReviewOperation - * @property {google.cloud.documentai.v1beta3.IHumanReviewStatus|null} [humanReviewStatus] ProcessResponse humanReviewStatus - */ - - /** - * Constructs a new ProcessResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ProcessResponse. - * @implements IProcessResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IProcessResponse=} [properties] Properties to set - */ - function ProcessResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProcessResponse document. - * @member {google.cloud.documentai.v1beta3.IDocument|null|undefined} document - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @instance - */ - ProcessResponse.prototype.document = null; - - /** - * ProcessResponse humanReviewOperation. - * @member {string} humanReviewOperation - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @instance - */ - ProcessResponse.prototype.humanReviewOperation = ""; - - /** - * ProcessResponse humanReviewStatus. - * @member {google.cloud.documentai.v1beta3.IHumanReviewStatus|null|undefined} humanReviewStatus - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @instance - */ - ProcessResponse.prototype.humanReviewStatus = null; - - /** - * Creates a new ProcessResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @static - * @param {google.cloud.documentai.v1beta3.IProcessResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessResponse} ProcessResponse instance - */ - ProcessResponse.create = function create(properties) { - return new ProcessResponse(properties); - }; - - /** - * Encodes the specified ProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @static - * @param {google.cloud.documentai.v1beta3.IProcessResponse} message ProcessResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.document != null && Object.hasOwnProperty.call(message, "document")) - $root.google.cloud.documentai.v1beta3.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.humanReviewOperation != null && Object.hasOwnProperty.call(message, "humanReviewOperation")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.humanReviewOperation); - if (message.humanReviewStatus != null && Object.hasOwnProperty.call(message, "humanReviewStatus")) - $root.google.cloud.documentai.v1beta3.HumanReviewStatus.encode(message.humanReviewStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @static - * @param {google.cloud.documentai.v1beta3.IProcessResponse} message ProcessResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessResponse} ProcessResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessResponse.decode = function decode(reader, 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.v1beta3.ProcessResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.document = $root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32()); - break; - } - case 2: { - message.humanReviewOperation = reader.string(); - break; - } - case 3: { - message.humanReviewStatus = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessResponse} ProcessResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessResponse.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.documentai.v1beta3.Document.verify(message.document); - if (error) - return "document." + error; - } - if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) - if (!$util.isString(message.humanReviewOperation)) - return "humanReviewOperation: string expected"; - if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) { - var error = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.verify(message.humanReviewStatus); - if (error) - return "humanReviewStatus." + error; - } - return null; - }; - - /** - * Creates a ProcessResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessResponse} ProcessResponse - */ - ProcessResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessResponse) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessResponse(); - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessResponse.document: object expected"); - message.document = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.document); - } - if (object.humanReviewOperation != null) - message.humanReviewOperation = String(object.humanReviewOperation); - if (object.humanReviewStatus != null) { - if (typeof object.humanReviewStatus !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessResponse.humanReviewStatus: object expected"); - message.humanReviewStatus = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.fromObject(object.humanReviewStatus); - } - return message; - }; - - /** - * Creates a plain object from a ProcessResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @static - * @param {google.cloud.documentai.v1beta3.ProcessResponse} message ProcessResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.document = null; - object.humanReviewOperation = ""; - object.humanReviewStatus = null; - } - if (message.document != null && message.hasOwnProperty("document")) - object.document = $root.google.cloud.documentai.v1beta3.Document.toObject(message.document, options); - if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) - object.humanReviewOperation = message.humanReviewOperation; - if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) - object.humanReviewStatus = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.toObject(message.humanReviewStatus, options); - return object; - }; - - /** - * Converts this ProcessResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @instance - * @returns {Object.} JSON object - */ - ProcessResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessResponse"; - }; - - return ProcessResponse; - })(); - - v1beta3.BatchProcessRequest = (function() { - - /** - * Properties of a BatchProcessRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IBatchProcessRequest - * @property {string|null} [name] BatchProcessRequest name - * @property {Array.|null} [inputConfigs] BatchProcessRequest inputConfigs - * @property {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig|null} [outputConfig] BatchProcessRequest outputConfig - * @property {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null} [inputDocuments] BatchProcessRequest inputDocuments - * @property {google.cloud.documentai.v1beta3.IDocumentOutputConfig|null} [documentOutputConfig] BatchProcessRequest documentOutputConfig - * @property {boolean|null} [skipHumanReview] BatchProcessRequest skipHumanReview - * @property {google.cloud.documentai.v1beta3.IProcessOptions|null} [processOptions] BatchProcessRequest processOptions - * @property {Object.|null} [labels] BatchProcessRequest labels - */ - - /** - * Constructs a new BatchProcessRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a BatchProcessRequest. - * @implements IBatchProcessRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IBatchProcessRequest=} [properties] Properties to set - */ - function BatchProcessRequest(properties) { - this.inputConfigs = []; - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchProcessRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.name = ""; - - /** - * BatchProcessRequest inputConfigs. - * @member {Array.} inputConfigs - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.inputConfigs = $util.emptyArray; - - /** - * BatchProcessRequest outputConfig. - * @member {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig|null|undefined} outputConfig - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.outputConfig = null; - - /** - * BatchProcessRequest inputDocuments. - * @member {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null|undefined} inputDocuments - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.inputDocuments = null; - - /** - * BatchProcessRequest documentOutputConfig. - * @member {google.cloud.documentai.v1beta3.IDocumentOutputConfig|null|undefined} documentOutputConfig - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.documentOutputConfig = null; - - /** - * BatchProcessRequest skipHumanReview. - * @member {boolean} skipHumanReview - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.skipHumanReview = false; - - /** - * BatchProcessRequest processOptions. - * @member {google.cloud.documentai.v1beta3.IProcessOptions|null|undefined} processOptions - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.processOptions = null; - - /** - * BatchProcessRequest labels. - * @member {Object.} labels - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @instance - */ - BatchProcessRequest.prototype.labels = $util.emptyObject; - - /** - * Creates a new BatchProcessRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @static - * @param {google.cloud.documentai.v1beta3.IBatchProcessRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest} BatchProcessRequest instance - */ - BatchProcessRequest.create = function create(properties) { - return new BatchProcessRequest(properties); - }; - - /** - * Encodes the specified BatchProcessRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @static - * @param {google.cloud.documentai.v1beta3.IBatchProcessRequest} message BatchProcessRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProcessRequest.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.inputConfigs != null && message.inputConfigs.length) - for (var i = 0; i < message.inputConfigs.length; ++i) - $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.encode(message.inputConfigs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) - $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.encode(message.outputConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.skipHumanReview != null && Object.hasOwnProperty.call(message, "skipHumanReview")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipHumanReview); - if (message.inputDocuments != null && Object.hasOwnProperty.call(message, "inputDocuments")) - $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.encode(message.inputDocuments, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.documentOutputConfig != null && Object.hasOwnProperty.call(message, "documentOutputConfig")) - $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.encode(message.documentOutputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.processOptions != null && Object.hasOwnProperty.call(message, "processOptions")) - $root.google.cloud.documentai.v1beta3.ProcessOptions.encode(message.processOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchProcessRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @static - * @param {google.cloud.documentai.v1beta3.IBatchProcessRequest} message BatchProcessRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProcessRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchProcessRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest} BatchProcessRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProcessRequest.decode = function decode(reader, 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.v1beta3.BatchProcessRequest(), key, value; - 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.inputConfigs && message.inputConfigs.length)) - message.inputConfigs = []; - message.inputConfigs.push($root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.decode(reader, reader.uint32())); - break; - } - case 3: { - message.outputConfig = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.inputDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.documentOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.skipHumanReview = reader.bool(); - break; - } - case 7: { - message.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchProcessRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest} BatchProcessRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProcessRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchProcessRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchProcessRequest.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.inputConfigs != null && message.hasOwnProperty("inputConfigs")) { - if (!Array.isArray(message.inputConfigs)) - return "inputConfigs: array expected"; - for (var i = 0; i < message.inputConfigs.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.verify(message.inputConfigs[i]); - if (error) - return "inputConfigs." + error; - } - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { - var error = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.verify(message.outputConfig); - if (error) - return "outputConfig." + error; - } - if (message.inputDocuments != null && message.hasOwnProperty("inputDocuments")) { - var error = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify(message.inputDocuments); - if (error) - return "inputDocuments." + error; - } - if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.verify(message.documentOutputConfig); - if (error) - return "documentOutputConfig." + error; - } - if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) - if (typeof message.skipHumanReview !== "boolean") - return "skipHumanReview: boolean expected"; - if (message.processOptions != null && message.hasOwnProperty("processOptions")) { - var error = $root.google.cloud.documentai.v1beta3.ProcessOptions.verify(message.processOptions); - if (error) - return "processOptions." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a BatchProcessRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest} BatchProcessRequest - */ - BatchProcessRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchProcessRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.BatchProcessRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.inputConfigs) { - if (!Array.isArray(object.inputConfigs)) - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.inputConfigs: array expected"); - message.inputConfigs = []; - for (var i = 0; i < object.inputConfigs.length; ++i) { - if (typeof object.inputConfigs[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.inputConfigs: object expected"); - message.inputConfigs[i] = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.fromObject(object.inputConfigs[i]); - } - } - if (object.outputConfig != null) { - if (typeof object.outputConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.outputConfig: object expected"); - message.outputConfig = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.fromObject(object.outputConfig); - } - if (object.inputDocuments != null) { - if (typeof object.inputDocuments !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.inputDocuments: object expected"); - message.inputDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.fromObject(object.inputDocuments); - } - if (object.documentOutputConfig != null) { - if (typeof object.documentOutputConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.documentOutputConfig: object expected"); - message.documentOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.fromObject(object.documentOutputConfig); - } - if (object.skipHumanReview != null) - message.skipHumanReview = Boolean(object.skipHumanReview); - if (object.processOptions != null) { - if (typeof object.processOptions !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.processOptions: object expected"); - message.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.fromObject(object.processOptions); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessRequest.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a BatchProcessRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessRequest} message BatchProcessRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchProcessRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.inputConfigs = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.outputConfig = null; - object.skipHumanReview = false; - object.inputDocuments = null; - object.documentOutputConfig = null; - object.processOptions = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputConfigs && message.inputConfigs.length) { - object.inputConfigs = []; - for (var j = 0; j < message.inputConfigs.length; ++j) - object.inputConfigs[j] = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.toObject(message.inputConfigs[j], options); - } - if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) - object.outputConfig = $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.toObject(message.outputConfig, options); - if (message.skipHumanReview != null && message.hasOwnProperty("skipHumanReview")) - object.skipHumanReview = message.skipHumanReview; - if (message.inputDocuments != null && message.hasOwnProperty("inputDocuments")) - object.inputDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.toObject(message.inputDocuments, options); - if (message.documentOutputConfig != null && message.hasOwnProperty("documentOutputConfig")) - object.documentOutputConfig = $root.google.cloud.documentai.v1beta3.DocumentOutputConfig.toObject(message.documentOutputConfig, options); - if (message.processOptions != null && message.hasOwnProperty("processOptions")) - object.processOptions = $root.google.cloud.documentai.v1beta3.ProcessOptions.toObject(message.processOptions, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - return object; - }; - - /** - * Converts this BatchProcessRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @instance - * @returns {Object.} JSON object - */ - BatchProcessRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchProcessRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchProcessRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchProcessRequest"; - }; - - BatchProcessRequest.BatchInputConfig = (function() { - - /** - * Properties of a BatchInputConfig. - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @interface IBatchInputConfig - * @property {string|null} [gcsSource] BatchInputConfig gcsSource - * @property {string|null} [mimeType] BatchInputConfig mimeType - */ - - /** - * Constructs a new BatchInputConfig. - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @classdesc Represents a BatchInputConfig. - * @implements IBatchInputConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig=} [properties] Properties to set - */ - function BatchInputConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchInputConfig gcsSource. - * @member {string} gcsSource - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig - * @instance - */ - BatchInputConfig.prototype.gcsSource = ""; - - /** - * BatchInputConfig mimeType. - * @member {string} mimeType - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig - * @instance - */ - BatchInputConfig.prototype.mimeType = ""; - - /** - * Creates a new BatchInputConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig} BatchInputConfig instance - */ - BatchInputConfig.create = function create(properties) { - return new BatchInputConfig(properties); - }; - - /** - * Encodes the specified BatchInputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig} message BatchInputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchInputConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsSource); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - return writer; - }; - - /** - * Encodes the specified BatchInputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchInputConfig} message BatchInputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchInputConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchInputConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig} BatchInputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchInputConfig.decode = function decode(reader, 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.v1beta3.BatchProcessRequest.BatchInputConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsSource = reader.string(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchInputConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig} BatchInputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchInputConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchInputConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchInputConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) - if (!$util.isString(message.gcsSource)) - return "gcsSource: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - return null; - }; - - /** - * Creates a BatchInputConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig} BatchInputConfig - */ - BatchInputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig(); - if (object.gcsSource != null) - message.gcsSource = String(object.gcsSource); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - return message; - }; - - /** - * Creates a plain object from a BatchInputConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig} message BatchInputConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchInputConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcsSource = ""; - object.mimeType = ""; - } - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) - object.gcsSource = message.gcsSource; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - return object; - }; - - /** - * Converts this BatchInputConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig - * @instance - * @returns {Object.} JSON object - */ - BatchInputConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchInputConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchInputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchProcessRequest.BatchInputConfig"; - }; - - return BatchInputConfig; - })(); - - BatchProcessRequest.BatchOutputConfig = (function() { - - /** - * Properties of a BatchOutputConfig. - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @interface IBatchOutputConfig - * @property {string|null} [gcsDestination] BatchOutputConfig gcsDestination - */ - - /** - * Constructs a new BatchOutputConfig. - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest - * @classdesc Represents a BatchOutputConfig. - * @implements IBatchOutputConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig=} [properties] Properties to set - */ - function BatchOutputConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchOutputConfig gcsDestination. - * @member {string} gcsDestination - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig - * @instance - */ - BatchOutputConfig.prototype.gcsDestination = ""; - - /** - * Creates a new BatchOutputConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig} BatchOutputConfig instance - */ - BatchOutputConfig.create = function create(properties) { - return new BatchOutputConfig(properties); - }; - - /** - * Encodes the specified BatchOutputConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig} message BatchOutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchOutputConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsDestination); - return writer; - }; - - /** - * Encodes the specified BatchOutputConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.IBatchOutputConfig} message BatchOutputConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchOutputConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig} BatchOutputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchOutputConfig.decode = function decode(reader, 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.v1beta3.BatchProcessRequest.BatchOutputConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsDestination = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchOutputConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig} BatchOutputConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchOutputConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchOutputConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchOutputConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - if (!$util.isString(message.gcsDestination)) - return "gcsDestination: string expected"; - return null; - }; - - /** - * Creates a BatchOutputConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig} BatchOutputConfig - */ - BatchOutputConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig(); - if (object.gcsDestination != null) - message.gcsDestination = String(object.gcsDestination); - return message; - }; - - /** - * Creates a plain object from a BatchOutputConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig} message BatchOutputConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchOutputConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.gcsDestination = ""; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - object.gcsDestination = message.gcsDestination; - return object; - }; - - /** - * Converts this BatchOutputConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig - * @instance - * @returns {Object.} JSON object - */ - BatchOutputConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchOutputConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig"; - }; - - return BatchOutputConfig; - })(); - - return BatchProcessRequest; - })(); - - v1beta3.BatchProcessResponse = (function() { - - /** - * Properties of a BatchProcessResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IBatchProcessResponse - */ - - /** - * Constructs a new BatchProcessResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a BatchProcessResponse. - * @implements IBatchProcessResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IBatchProcessResponse=} [properties] Properties to set - */ - function BatchProcessResponse(properties) { - if (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 BatchProcessResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse - * @static - * @param {google.cloud.documentai.v1beta3.IBatchProcessResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchProcessResponse} BatchProcessResponse instance - */ - BatchProcessResponse.create = function create(properties) { - return new BatchProcessResponse(properties); - }; - - /** - * Encodes the specified BatchProcessResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse - * @static - * @param {google.cloud.documentai.v1beta3.IBatchProcessResponse} message BatchProcessResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProcessResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified BatchProcessResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse - * @static - * @param {google.cloud.documentai.v1beta3.IBatchProcessResponse} message BatchProcessResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProcessResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchProcessResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchProcessResponse} BatchProcessResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProcessResponse.decode = function decode(reader, 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.v1beta3.BatchProcessResponse(); - 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 BatchProcessResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchProcessResponse} BatchProcessResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProcessResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchProcessResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchProcessResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a BatchProcessResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchProcessResponse} BatchProcessResponse - */ - BatchProcessResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchProcessResponse) - return object; - return new $root.google.cloud.documentai.v1beta3.BatchProcessResponse(); - }; - - /** - * Creates a plain object from a BatchProcessResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessResponse} message BatchProcessResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchProcessResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this BatchProcessResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse - * @instance - * @returns {Object.} JSON object - */ - BatchProcessResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchProcessResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchProcessResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchProcessResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchProcessResponse"; - }; - - return BatchProcessResponse; - })(); - - v1beta3.BatchProcessMetadata = (function() { - - /** - * Properties of a BatchProcessMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IBatchProcessMetadata - * @property {google.cloud.documentai.v1beta3.BatchProcessMetadata.State|null} [state] BatchProcessMetadata state - * @property {string|null} [stateMessage] BatchProcessMetadata stateMessage - * @property {google.protobuf.ITimestamp|null} [createTime] BatchProcessMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] BatchProcessMetadata updateTime - * @property {Array.|null} [individualProcessStatuses] BatchProcessMetadata individualProcessStatuses - */ - - /** - * Constructs a new BatchProcessMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a BatchProcessMetadata. - * @implements IBatchProcessMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IBatchProcessMetadata=} [properties] Properties to set - */ - function BatchProcessMetadata(properties) { - this.individualProcessStatuses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchProcessMetadata state. - * @member {google.cloud.documentai.v1beta3.BatchProcessMetadata.State} state - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @instance - */ - BatchProcessMetadata.prototype.state = 0; - - /** - * BatchProcessMetadata stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @instance - */ - BatchProcessMetadata.prototype.stateMessage = ""; - - /** - * BatchProcessMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @instance - */ - BatchProcessMetadata.prototype.createTime = null; - - /** - * BatchProcessMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @instance - */ - BatchProcessMetadata.prototype.updateTime = null; - - /** - * BatchProcessMetadata individualProcessStatuses. - * @member {Array.} individualProcessStatuses - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @instance - */ - BatchProcessMetadata.prototype.individualProcessStatuses = $util.emptyArray; - - /** - * Creates a new BatchProcessMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IBatchProcessMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata} BatchProcessMetadata instance - */ - BatchProcessMetadata.create = function create(properties) { - return new BatchProcessMetadata(properties); - }; - - /** - * Encodes the specified BatchProcessMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IBatchProcessMetadata} message BatchProcessMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProcessMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); - 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.individualProcessStatuses != null && message.individualProcessStatuses.length) - for (var i = 0; i < message.individualProcessStatuses.length; ++i) - $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.encode(message.individualProcessStatuses[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchProcessMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IBatchProcessMetadata} message BatchProcessMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchProcessMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchProcessMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata} BatchProcessMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProcessMetadata.decode = function decode(reader, 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.v1beta3.BatchProcessMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.stateMessage = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - if (!(message.individualProcessStatuses && message.individualProcessStatuses.length)) - message.individualProcessStatuses = []; - message.individualProcessStatuses.push($root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchProcessMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata} BatchProcessMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchProcessMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchProcessMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchProcessMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.individualProcessStatuses != null && message.hasOwnProperty("individualProcessStatuses")) { - if (!Array.isArray(message.individualProcessStatuses)) - return "individualProcessStatuses: array expected"; - for (var i = 0; i < message.individualProcessStatuses.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.verify(message.individualProcessStatuses[i]); - if (error) - return "individualProcessStatuses." + error; - } - } - return null; - }; - - /** - * Creates a BatchProcessMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata} BatchProcessMetadata - */ - BatchProcessMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchProcessMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.BatchProcessMetadata(); - 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 "WAITING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "SUCCEEDED": - case 3: - message.state = 3; - break; - case "CANCELLING": - case 4: - message.state = 4; - break; - case "CANCELLED": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - } - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.individualProcessStatuses) { - if (!Array.isArray(object.individualProcessStatuses)) - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessMetadata.individualProcessStatuses: array expected"); - message.individualProcessStatuses = []; - for (var i = 0; i < object.individualProcessStatuses.length; ++i) { - if (typeof object.individualProcessStatuses[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessMetadata.individualProcessStatuses: object expected"); - message.individualProcessStatuses[i] = $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.fromObject(object.individualProcessStatuses[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BatchProcessMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessMetadata} message BatchProcessMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchProcessMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.individualProcessStatuses = []; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; - object.createTime = null; - object.updateTime = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.State[message.state] : message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.individualProcessStatuses && message.individualProcessStatuses.length) { - object.individualProcessStatuses = []; - for (var j = 0; j < message.individualProcessStatuses.length; ++j) - object.individualProcessStatuses[j] = $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.toObject(message.individualProcessStatuses[j], options); - } - return object; - }; - - /** - * Converts this BatchProcessMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @instance - * @returns {Object.} JSON object - */ - BatchProcessMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchProcessMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchProcessMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchProcessMetadata"; - }; - - BatchProcessMetadata.IndividualProcessStatus = (function() { - - /** - * Properties of an IndividualProcessStatus. - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @interface IIndividualProcessStatus - * @property {string|null} [inputGcsSource] IndividualProcessStatus inputGcsSource - * @property {google.rpc.IStatus|null} [status] IndividualProcessStatus status - * @property {string|null} [outputGcsDestination] IndividualProcessStatus outputGcsDestination - * @property {string|null} [humanReviewOperation] IndividualProcessStatus humanReviewOperation - * @property {google.cloud.documentai.v1beta3.IHumanReviewStatus|null} [humanReviewStatus] IndividualProcessStatus humanReviewStatus - */ - - /** - * Constructs a new IndividualProcessStatus. - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata - * @classdesc Represents an IndividualProcessStatus. - * @implements IIndividualProcessStatus - * @constructor - * @param {google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus=} [properties] Properties to set - */ - function IndividualProcessStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IndividualProcessStatus inputGcsSource. - * @member {string} inputGcsSource - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @instance - */ - IndividualProcessStatus.prototype.inputGcsSource = ""; - - /** - * IndividualProcessStatus status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @instance - */ - IndividualProcessStatus.prototype.status = null; - - /** - * IndividualProcessStatus outputGcsDestination. - * @member {string} outputGcsDestination - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @instance - */ - IndividualProcessStatus.prototype.outputGcsDestination = ""; - - /** - * IndividualProcessStatus humanReviewOperation. - * @member {string} humanReviewOperation - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @instance - */ - IndividualProcessStatus.prototype.humanReviewOperation = ""; - - /** - * IndividualProcessStatus humanReviewStatus. - * @member {google.cloud.documentai.v1beta3.IHumanReviewStatus|null|undefined} humanReviewStatus - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @instance - */ - IndividualProcessStatus.prototype.humanReviewStatus = null; - - /** - * Creates a new IndividualProcessStatus instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus instance - */ - IndividualProcessStatus.create = function create(properties) { - return new IndividualProcessStatus(properties); - }; - - /** - * Encodes the specified IndividualProcessStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus} message IndividualProcessStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualProcessStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputGcsSource != null && Object.hasOwnProperty.call(message, "inputGcsSource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputGcsSource); - 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(); - if (message.outputGcsDestination != null && Object.hasOwnProperty.call(message, "outputGcsDestination")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputGcsDestination); - if (message.humanReviewOperation != null && Object.hasOwnProperty.call(message, "humanReviewOperation")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.humanReviewOperation); - if (message.humanReviewStatus != null && Object.hasOwnProperty.call(message, "humanReviewStatus")) - $root.google.cloud.documentai.v1beta3.HumanReviewStatus.encode(message.humanReviewStatus, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IndividualProcessStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessMetadata.IIndividualProcessStatus} message IndividualProcessStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualProcessStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IndividualProcessStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualProcessStatus.decode = function decode(reader, 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.v1beta3.BatchProcessMetadata.IndividualProcessStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.inputGcsSource = reader.string(); - break; - } - case 2: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 3: { - message.outputGcsDestination = reader.string(); - break; - } - case 4: { - message.humanReviewOperation = reader.string(); - break; - } - case 5: { - message.humanReviewStatus = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IndividualProcessStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualProcessStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IndividualProcessStatus message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndividualProcessStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) - if (!$util.isString(message.inputGcsSource)) - return "inputGcsSource: string expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - if (message.outputGcsDestination != null && message.hasOwnProperty("outputGcsDestination")) - if (!$util.isString(message.outputGcsDestination)) - return "outputGcsDestination: string expected"; - if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) - if (!$util.isString(message.humanReviewOperation)) - return "humanReviewOperation: string expected"; - if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) { - var error = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.verify(message.humanReviewStatus); - if (error) - return "humanReviewStatus." + error; - } - return null; - }; - - /** - * Creates an IndividualProcessStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus} IndividualProcessStatus - */ - IndividualProcessStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus) - return object; - var message = new $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus(); - if (object.inputGcsSource != null) - message.inputGcsSource = String(object.inputGcsSource); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - if (object.outputGcsDestination != null) - message.outputGcsDestination = String(object.outputGcsDestination); - if (object.humanReviewOperation != null) - message.humanReviewOperation = String(object.humanReviewOperation); - if (object.humanReviewStatus != null) { - if (typeof object.humanReviewStatus !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.humanReviewStatus: object expected"); - message.humanReviewStatus = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.fromObject(object.humanReviewStatus); - } - return message; - }; - - /** - * Creates a plain object from an IndividualProcessStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus} message IndividualProcessStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndividualProcessStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inputGcsSource = ""; - object.status = null; - object.outputGcsDestination = ""; - object.humanReviewOperation = ""; - object.humanReviewStatus = null; - } - if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) - object.inputGcsSource = message.inputGcsSource; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.outputGcsDestination != null && message.hasOwnProperty("outputGcsDestination")) - object.outputGcsDestination = message.outputGcsDestination; - if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) - object.humanReviewOperation = message.humanReviewOperation; - if (message.humanReviewStatus != null && message.hasOwnProperty("humanReviewStatus")) - object.humanReviewStatus = $root.google.cloud.documentai.v1beta3.HumanReviewStatus.toObject(message.humanReviewStatus, options); - return object; - }; - - /** - * Converts this IndividualProcessStatus to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @instance - * @returns {Object.} JSON object - */ - IndividualProcessStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IndividualProcessStatus - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndividualProcessStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus"; - }; - - return IndividualProcessStatus; - })(); - - /** - * State enum. - * @name google.cloud.documentai.v1beta3.BatchProcessMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} WAITING=1 WAITING value - * @property {number} RUNNING=2 RUNNING value - * @property {number} SUCCEEDED=3 SUCCEEDED value - * @property {number} CANCELLING=4 CANCELLING value - * @property {number} CANCELLED=5 CANCELLED value - * @property {number} FAILED=6 FAILED value - */ - BatchProcessMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "WAITING"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "SUCCEEDED"] = 3; - values[valuesById[4] = "CANCELLING"] = 4; - values[valuesById[5] = "CANCELLED"] = 5; - values[valuesById[6] = "FAILED"] = 6; - return values; - })(); - - return BatchProcessMetadata; - })(); - - v1beta3.FetchProcessorTypesRequest = (function() { - - /** - * Properties of a FetchProcessorTypesRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IFetchProcessorTypesRequest - * @property {string|null} [parent] FetchProcessorTypesRequest parent - */ - - /** - * Constructs a new FetchProcessorTypesRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a FetchProcessorTypesRequest. - * @implements IFetchProcessorTypesRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest=} [properties] Properties to set - */ - function FetchProcessorTypesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchProcessorTypesRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest - * @instance - */ - FetchProcessorTypesRequest.prototype.parent = ""; - - /** - * Creates a new FetchProcessorTypesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesRequest} FetchProcessorTypesRequest instance - */ - FetchProcessorTypesRequest.create = function create(properties) { - return new FetchProcessorTypesRequest(properties); - }; - - /** - * Encodes the specified FetchProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest} message FetchProcessorTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchProcessorTypesRequest.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); - return writer; - }; - - /** - * Encodes the specified FetchProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest} message FetchProcessorTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchProcessorTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesRequest} FetchProcessorTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchProcessorTypesRequest.decode = function decode(reader, 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.v1beta3.FetchProcessorTypesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchProcessorTypesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesRequest} FetchProcessorTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchProcessorTypesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchProcessorTypesRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchProcessorTypesRequest.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"; - return null; - }; - - /** - * Creates a FetchProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesRequest} FetchProcessorTypesRequest - */ - FetchProcessorTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - return message; - }; - - /** - * Creates a plain object from a FetchProcessorTypesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1beta3.FetchProcessorTypesRequest} message FetchProcessorTypesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchProcessorTypesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - return object; - }; - - /** - * Converts this FetchProcessorTypesRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest - * @instance - * @returns {Object.} JSON object - */ - FetchProcessorTypesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchProcessorTypesRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchProcessorTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.FetchProcessorTypesRequest"; - }; - - return FetchProcessorTypesRequest; - })(); - - v1beta3.FetchProcessorTypesResponse = (function() { - - /** - * Properties of a FetchProcessorTypesResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IFetchProcessorTypesResponse - * @property {Array.|null} [processorTypes] FetchProcessorTypesResponse processorTypes - */ - - /** - * Constructs a new FetchProcessorTypesResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a FetchProcessorTypesResponse. - * @implements IFetchProcessorTypesResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse=} [properties] Properties to set - */ - function FetchProcessorTypesResponse(properties) { - this.processorTypes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchProcessorTypesResponse processorTypes. - * @member {Array.} processorTypes - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse - * @instance - */ - FetchProcessorTypesResponse.prototype.processorTypes = $util.emptyArray; - - /** - * Creates a new FetchProcessorTypesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} FetchProcessorTypesResponse instance - */ - FetchProcessorTypesResponse.create = function create(properties) { - return new FetchProcessorTypesResponse(properties); - }; - - /** - * Encodes the specified FetchProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse} message FetchProcessorTypesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchProcessorTypesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorTypes != null && message.processorTypes.length) - for (var i = 0; i < message.processorTypes.length; ++i) - $root.google.cloud.documentai.v1beta3.ProcessorType.encode(message.processorTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FetchProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse} message FetchProcessorTypesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchProcessorTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} FetchProcessorTypesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchProcessorTypesResponse.decode = function decode(reader, 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.v1beta3.FetchProcessorTypesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.processorTypes && message.processorTypes.length)) - message.processorTypes = []; - message.processorTypes.push($root.google.cloud.documentai.v1beta3.ProcessorType.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchProcessorTypesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} FetchProcessorTypesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchProcessorTypesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchProcessorTypesResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchProcessorTypesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorTypes != null && message.hasOwnProperty("processorTypes")) { - if (!Array.isArray(message.processorTypes)) - return "processorTypes: array expected"; - for (var i = 0; i < message.processorTypes.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.ProcessorType.verify(message.processorTypes[i]); - if (error) - return "processorTypes." + error; - } - } - return null; - }; - - /** - * Creates a FetchProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} FetchProcessorTypesResponse - */ - FetchProcessorTypesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse) - return object; - var message = new $root.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse(); - if (object.processorTypes) { - if (!Array.isArray(object.processorTypes)) - throw TypeError(".google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.processorTypes: array expected"); - message.processorTypes = []; - for (var i = 0; i < object.processorTypes.length; ++i) { - if (typeof object.processorTypes[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.FetchProcessorTypesResponse.processorTypes: object expected"); - message.processorTypes[i] = $root.google.cloud.documentai.v1beta3.ProcessorType.fromObject(object.processorTypes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FetchProcessorTypesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1beta3.FetchProcessorTypesResponse} message FetchProcessorTypesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchProcessorTypesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.processorTypes = []; - if (message.processorTypes && message.processorTypes.length) { - object.processorTypes = []; - for (var j = 0; j < message.processorTypes.length; ++j) - object.processorTypes[j] = $root.google.cloud.documentai.v1beta3.ProcessorType.toObject(message.processorTypes[j], options); - } - return object; - }; - - /** - * Converts this FetchProcessorTypesResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse - * @instance - * @returns {Object.} JSON object - */ - FetchProcessorTypesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchProcessorTypesResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.FetchProcessorTypesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchProcessorTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.FetchProcessorTypesResponse"; - }; - - return FetchProcessorTypesResponse; - })(); - - v1beta3.ListProcessorTypesRequest = (function() { - - /** - * Properties of a ListProcessorTypesRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IListProcessorTypesRequest - * @property {string|null} [parent] ListProcessorTypesRequest parent - * @property {number|null} [pageSize] ListProcessorTypesRequest pageSize - * @property {string|null} [pageToken] ListProcessorTypesRequest pageToken - */ - - /** - * Constructs a new ListProcessorTypesRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ListProcessorTypesRequest. - * @implements IListProcessorTypesRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IListProcessorTypesRequest=} [properties] Properties to set - */ - function ListProcessorTypesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListProcessorTypesRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @instance - */ - ListProcessorTypesRequest.prototype.parent = ""; - - /** - * ListProcessorTypesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @instance - */ - ListProcessorTypesRequest.prototype.pageSize = 0; - - /** - * ListProcessorTypesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @instance - */ - ListProcessorTypesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListProcessorTypesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorTypesRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesRequest} ListProcessorTypesRequest instance - */ - ListProcessorTypesRequest.create = function create(properties) { - return new ListProcessorTypesRequest(properties); - }; - - /** - * Encodes the specified ListProcessorTypesRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorTypesRequest} message ListProcessorTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorTypesRequest.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 ListProcessorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorTypesRequest} message ListProcessorTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProcessorTypesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesRequest} ListProcessorTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorTypesRequest.decode = function decode(reader, 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.v1beta3.ListProcessorTypesRequest(); - 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 ListProcessorTypesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesRequest} ListProcessorTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorTypesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProcessorTypesRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProcessorTypesRequest.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 ListProcessorTypesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesRequest} ListProcessorTypesRequest - */ - ListProcessorTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ListProcessorTypesRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ListProcessorTypesRequest(); - 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 ListProcessorTypesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @static - * @param {google.cloud.documentai.v1beta3.ListProcessorTypesRequest} message ListProcessorTypesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProcessorTypesRequest.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 ListProcessorTypesRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @instance - * @returns {Object.} JSON object - */ - ListProcessorTypesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProcessorTypesRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProcessorTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListProcessorTypesRequest"; - }; - - return ListProcessorTypesRequest; - })(); - - v1beta3.ListProcessorTypesResponse = (function() { - - /** - * Properties of a ListProcessorTypesResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IListProcessorTypesResponse - * @property {Array.|null} [processorTypes] ListProcessorTypesResponse processorTypes - * @property {string|null} [nextPageToken] ListProcessorTypesResponse nextPageToken - */ - - /** - * Constructs a new ListProcessorTypesResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ListProcessorTypesResponse. - * @implements IListProcessorTypesResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IListProcessorTypesResponse=} [properties] Properties to set - */ - function ListProcessorTypesResponse(properties) { - this.processorTypes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListProcessorTypesResponse processorTypes. - * @member {Array.} processorTypes - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse - * @instance - */ - ListProcessorTypesResponse.prototype.processorTypes = $util.emptyArray; - - /** - * ListProcessorTypesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse - * @instance - */ - ListProcessorTypesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListProcessorTypesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorTypesResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesResponse} ListProcessorTypesResponse instance - */ - ListProcessorTypesResponse.create = function create(properties) { - return new ListProcessorTypesResponse(properties); - }; - - /** - * Encodes the specified ListProcessorTypesResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorTypesResponse} message ListProcessorTypesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorTypesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorTypes != null && message.processorTypes.length) - for (var i = 0; i < message.processorTypes.length; ++i) - $root.google.cloud.documentai.v1beta3.ProcessorType.encode(message.processorTypes[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 ListProcessorTypesResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorTypesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorTypesResponse} message ListProcessorTypesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProcessorTypesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesResponse} ListProcessorTypesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorTypesResponse.decode = function decode(reader, 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.v1beta3.ListProcessorTypesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.processorTypes && message.processorTypes.length)) - message.processorTypes = []; - message.processorTypes.push($root.google.cloud.documentai.v1beta3.ProcessorType.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListProcessorTypesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesResponse} ListProcessorTypesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorTypesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProcessorTypesResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProcessorTypesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorTypes != null && message.hasOwnProperty("processorTypes")) { - if (!Array.isArray(message.processorTypes)) - return "processorTypes: array expected"; - for (var i = 0; i < message.processorTypes.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.ProcessorType.verify(message.processorTypes[i]); - if (error) - return "processorTypes." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListProcessorTypesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ListProcessorTypesResponse} ListProcessorTypesResponse - */ - ListProcessorTypesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ListProcessorTypesResponse) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ListProcessorTypesResponse(); - if (object.processorTypes) { - if (!Array.isArray(object.processorTypes)) - throw TypeError(".google.cloud.documentai.v1beta3.ListProcessorTypesResponse.processorTypes: array expected"); - message.processorTypes = []; - for (var i = 0; i < object.processorTypes.length; ++i) { - if (typeof object.processorTypes[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ListProcessorTypesResponse.processorTypes: object expected"); - message.processorTypes[i] = $root.google.cloud.documentai.v1beta3.ProcessorType.fromObject(object.processorTypes[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListProcessorTypesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse - * @static - * @param {google.cloud.documentai.v1beta3.ListProcessorTypesResponse} message ListProcessorTypesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProcessorTypesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.processorTypes = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.processorTypes && message.processorTypes.length) { - object.processorTypes = []; - for (var j = 0; j < message.processorTypes.length; ++j) - object.processorTypes[j] = $root.google.cloud.documentai.v1beta3.ProcessorType.toObject(message.processorTypes[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListProcessorTypesResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse - * @instance - * @returns {Object.} JSON object - */ - ListProcessorTypesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProcessorTypesResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ListProcessorTypesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProcessorTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListProcessorTypesResponse"; - }; - - return ListProcessorTypesResponse; - })(); - - v1beta3.ListProcessorsRequest = (function() { - - /** - * Properties of a ListProcessorsRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IListProcessorsRequest - * @property {string|null} [parent] ListProcessorsRequest parent - * @property {number|null} [pageSize] ListProcessorsRequest pageSize - * @property {string|null} [pageToken] ListProcessorsRequest pageToken - */ - - /** - * Constructs a new ListProcessorsRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ListProcessorsRequest. - * @implements IListProcessorsRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IListProcessorsRequest=} [properties] Properties to set - */ - function ListProcessorsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListProcessorsRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @instance - */ - ListProcessorsRequest.prototype.parent = ""; - - /** - * ListProcessorsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @instance - */ - ListProcessorsRequest.prototype.pageSize = 0; - - /** - * ListProcessorsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @instance - */ - ListProcessorsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListProcessorsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorsRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ListProcessorsRequest} ListProcessorsRequest instance - */ - ListProcessorsRequest.create = function create(properties) { - return new ListProcessorsRequest(properties); - }; - - /** - * Encodes the specified ListProcessorsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorsRequest} message ListProcessorsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorsRequest.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 ListProcessorsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorsRequest} message ListProcessorsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProcessorsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ListProcessorsRequest} ListProcessorsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorsRequest.decode = function decode(reader, 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.v1beta3.ListProcessorsRequest(); - 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 ListProcessorsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ListProcessorsRequest} ListProcessorsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProcessorsRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProcessorsRequest.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 ListProcessorsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ListProcessorsRequest} ListProcessorsRequest - */ - ListProcessorsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ListProcessorsRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ListProcessorsRequest(); - 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 ListProcessorsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @static - * @param {google.cloud.documentai.v1beta3.ListProcessorsRequest} message ListProcessorsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProcessorsRequest.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 ListProcessorsRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @instance - * @returns {Object.} JSON object - */ - ListProcessorsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProcessorsRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ListProcessorsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProcessorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListProcessorsRequest"; - }; - - return ListProcessorsRequest; - })(); - - v1beta3.ListProcessorsResponse = (function() { - - /** - * Properties of a ListProcessorsResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IListProcessorsResponse - * @property {Array.|null} [processors] ListProcessorsResponse processors - * @property {string|null} [nextPageToken] ListProcessorsResponse nextPageToken - */ - - /** - * Constructs a new ListProcessorsResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ListProcessorsResponse. - * @implements IListProcessorsResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IListProcessorsResponse=} [properties] Properties to set - */ - function ListProcessorsResponse(properties) { - this.processors = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListProcessorsResponse processors. - * @member {Array.} processors - * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse - * @instance - */ - ListProcessorsResponse.prototype.processors = $util.emptyArray; - - /** - * ListProcessorsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse - * @instance - */ - ListProcessorsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListProcessorsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorsResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ListProcessorsResponse} ListProcessorsResponse instance - */ - ListProcessorsResponse.create = function create(properties) { - return new ListProcessorsResponse(properties); - }; - - /** - * Encodes the specified ListProcessorsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorsResponse} message ListProcessorsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processors != null && message.processors.length) - for (var i = 0; i < message.processors.length; ++i) - $root.google.cloud.documentai.v1beta3.Processor.encode(message.processors[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 ListProcessorsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorsResponse} message ListProcessorsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProcessorsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ListProcessorsResponse} ListProcessorsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorsResponse.decode = function decode(reader, 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.v1beta3.ListProcessorsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.processors && message.processors.length)) - message.processors = []; - message.processors.push($root.google.cloud.documentai.v1beta3.Processor.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListProcessorsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ListProcessorsResponse} ListProcessorsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProcessorsResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProcessorsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processors != null && message.hasOwnProperty("processors")) { - if (!Array.isArray(message.processors)) - return "processors: array expected"; - for (var i = 0; i < message.processors.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.Processor.verify(message.processors[i]); - if (error) - return "processors." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListProcessorsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ListProcessorsResponse} ListProcessorsResponse - */ - ListProcessorsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ListProcessorsResponse) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ListProcessorsResponse(); - if (object.processors) { - if (!Array.isArray(object.processors)) - throw TypeError(".google.cloud.documentai.v1beta3.ListProcessorsResponse.processors: array expected"); - message.processors = []; - for (var i = 0; i < object.processors.length; ++i) { - if (typeof object.processors[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ListProcessorsResponse.processors: object expected"); - message.processors[i] = $root.google.cloud.documentai.v1beta3.Processor.fromObject(object.processors[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListProcessorsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse - * @static - * @param {google.cloud.documentai.v1beta3.ListProcessorsResponse} message ListProcessorsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProcessorsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.processors = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.processors && message.processors.length) { - object.processors = []; - for (var j = 0; j < message.processors.length; ++j) - object.processors[j] = $root.google.cloud.documentai.v1beta3.Processor.toObject(message.processors[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListProcessorsResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse - * @instance - * @returns {Object.} JSON object - */ - ListProcessorsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProcessorsResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ListProcessorsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProcessorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListProcessorsResponse"; - }; - - return ListProcessorsResponse; - })(); - - v1beta3.GetProcessorTypeRequest = (function() { - - /** - * Properties of a GetProcessorTypeRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGetProcessorTypeRequest - * @property {string|null} [name] GetProcessorTypeRequest name - */ - - /** - * Constructs a new GetProcessorTypeRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a GetProcessorTypeRequest. - * @implements IGetProcessorTypeRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IGetProcessorTypeRequest=} [properties] Properties to set - */ - function GetProcessorTypeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProcessorTypeRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest - * @instance - */ - GetProcessorTypeRequest.prototype.name = ""; - - /** - * Creates a new GetProcessorTypeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetProcessorTypeRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.GetProcessorTypeRequest} GetProcessorTypeRequest instance - */ - GetProcessorTypeRequest.create = function create(properties) { - return new GetProcessorTypeRequest(properties); - }; - - /** - * Encodes the specified GetProcessorTypeRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorTypeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetProcessorTypeRequest} message GetProcessorTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProcessorTypeRequest.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 GetProcessorTypeRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorTypeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetProcessorTypeRequest} message GetProcessorTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProcessorTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProcessorTypeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.GetProcessorTypeRequest} GetProcessorTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProcessorTypeRequest.decode = function decode(reader, 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.v1beta3.GetProcessorTypeRequest(); - 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 GetProcessorTypeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.GetProcessorTypeRequest} GetProcessorTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProcessorTypeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProcessorTypeRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProcessorTypeRequest.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 GetProcessorTypeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.GetProcessorTypeRequest} GetProcessorTypeRequest - */ - GetProcessorTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.GetProcessorTypeRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.GetProcessorTypeRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetProcessorTypeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest - * @static - * @param {google.cloud.documentai.v1beta3.GetProcessorTypeRequest} message GetProcessorTypeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProcessorTypeRequest.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 GetProcessorTypeRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest - * @instance - * @returns {Object.} JSON object - */ - GetProcessorTypeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetProcessorTypeRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.GetProcessorTypeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetProcessorTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetProcessorTypeRequest"; - }; - - return GetProcessorTypeRequest; - })(); - - v1beta3.GetProcessorRequest = (function() { - - /** - * Properties of a GetProcessorRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGetProcessorRequest - * @property {string|null} [name] GetProcessorRequest name - */ - - /** - * Constructs a new GetProcessorRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a GetProcessorRequest. - * @implements IGetProcessorRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IGetProcessorRequest=} [properties] Properties to set - */ - function GetProcessorRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProcessorRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest - * @instance - */ - GetProcessorRequest.prototype.name = ""; - - /** - * Creates a new GetProcessorRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetProcessorRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.GetProcessorRequest} GetProcessorRequest instance - */ - GetProcessorRequest.create = function create(properties) { - return new GetProcessorRequest(properties); - }; - - /** - * Encodes the specified GetProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetProcessorRequest} message GetProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProcessorRequest.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 GetProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetProcessorRequest} message GetProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProcessorRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.GetProcessorRequest} GetProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProcessorRequest.decode = function decode(reader, 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.v1beta3.GetProcessorRequest(); - 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 GetProcessorRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.GetProcessorRequest} GetProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProcessorRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProcessorRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProcessorRequest.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 GetProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.GetProcessorRequest} GetProcessorRequest - */ - GetProcessorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.GetProcessorRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.GetProcessorRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetProcessorRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.GetProcessorRequest} message GetProcessorRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProcessorRequest.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 GetProcessorRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest - * @instance - * @returns {Object.} JSON object - */ - GetProcessorRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetProcessorRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.GetProcessorRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetProcessorRequest"; - }; - - return GetProcessorRequest; - })(); - - v1beta3.GetProcessorVersionRequest = (function() { - - /** - * Properties of a GetProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGetProcessorVersionRequest - * @property {string|null} [name] GetProcessorVersionRequest name - */ - - /** - * Constructs a new GetProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a GetProcessorVersionRequest. - * @implements IGetProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IGetProcessorVersionRequest=} [properties] Properties to set - */ - function GetProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetProcessorVersionRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest - * @instance - */ - GetProcessorVersionRequest.prototype.name = ""; - - /** - * Creates a new GetProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.GetProcessorVersionRequest} GetProcessorVersionRequest instance - */ - GetProcessorVersionRequest.create = function create(properties) { - return new GetProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified GetProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetProcessorVersionRequest} message GetProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProcessorVersionRequest.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 GetProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetProcessorVersionRequest} message GetProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.GetProcessorVersionRequest} GetProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.GetProcessorVersionRequest(); - 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 GetProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.GetProcessorVersionRequest} GetProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetProcessorVersionRequest.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 GetProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.GetProcessorVersionRequest} GetProcessorVersionRequest - */ - GetProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.GetProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.GetProcessorVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.GetProcessorVersionRequest} message GetProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetProcessorVersionRequest.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 GetProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - GetProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.GetProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetProcessorVersionRequest"; - }; - - return GetProcessorVersionRequest; - })(); - - v1beta3.ListProcessorVersionsRequest = (function() { - - /** - * Properties of a ListProcessorVersionsRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IListProcessorVersionsRequest - * @property {string|null} [parent] ListProcessorVersionsRequest parent - * @property {number|null} [pageSize] ListProcessorVersionsRequest pageSize - * @property {string|null} [pageToken] ListProcessorVersionsRequest pageToken - */ - - /** - * Constructs a new ListProcessorVersionsRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ListProcessorVersionsRequest. - * @implements IListProcessorVersionsRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsRequest=} [properties] Properties to set - */ - function ListProcessorVersionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListProcessorVersionsRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @instance - */ - ListProcessorVersionsRequest.prototype.parent = ""; - - /** - * ListProcessorVersionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @instance - */ - ListProcessorVersionsRequest.prototype.pageSize = 0; - - /** - * ListProcessorVersionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @instance - */ - ListProcessorVersionsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListProcessorVersionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsRequest} ListProcessorVersionsRequest instance - */ - ListProcessorVersionsRequest.create = function create(properties) { - return new ListProcessorVersionsRequest(properties); - }; - - /** - * Encodes the specified ListProcessorVersionsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsRequest} message ListProcessorVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorVersionsRequest.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 ListProcessorVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsRequest} message ListProcessorVersionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProcessorVersionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsRequest} ListProcessorVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorVersionsRequest.decode = function decode(reader, 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.v1beta3.ListProcessorVersionsRequest(); - 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 ListProcessorVersionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsRequest} ListProcessorVersionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorVersionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProcessorVersionsRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProcessorVersionsRequest.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 ListProcessorVersionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsRequest} ListProcessorVersionsRequest - */ - ListProcessorVersionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest(); - 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 ListProcessorVersionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @static - * @param {google.cloud.documentai.v1beta3.ListProcessorVersionsRequest} message ListProcessorVersionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProcessorVersionsRequest.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 ListProcessorVersionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListProcessorVersionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProcessorVersionsRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProcessorVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListProcessorVersionsRequest"; - }; - - return ListProcessorVersionsRequest; - })(); - - v1beta3.ListProcessorVersionsResponse = (function() { - - /** - * Properties of a ListProcessorVersionsResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IListProcessorVersionsResponse - * @property {Array.|null} [processorVersions] ListProcessorVersionsResponse processorVersions - * @property {string|null} [nextPageToken] ListProcessorVersionsResponse nextPageToken - */ - - /** - * Constructs a new ListProcessorVersionsResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ListProcessorVersionsResponse. - * @implements IListProcessorVersionsResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsResponse=} [properties] Properties to set - */ - function ListProcessorVersionsResponse(properties) { - this.processorVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListProcessorVersionsResponse processorVersions. - * @member {Array.} processorVersions - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse - * @instance - */ - ListProcessorVersionsResponse.prototype.processorVersions = $util.emptyArray; - - /** - * ListProcessorVersionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse - * @instance - */ - ListProcessorVersionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListProcessorVersionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} ListProcessorVersionsResponse instance - */ - ListProcessorVersionsResponse.create = function create(properties) { - return new ListProcessorVersionsResponse(properties); - }; - - /** - * Encodes the specified ListProcessorVersionsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsResponse} message ListProcessorVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorVersionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorVersions != null && message.processorVersions.length) - for (var i = 0; i < message.processorVersions.length; ++i) - $root.google.cloud.documentai.v1beta3.ProcessorVersion.encode(message.processorVersions[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 ListProcessorVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListProcessorVersionsResponse} message ListProcessorVersionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListProcessorVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} ListProcessorVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorVersionsResponse.decode = function decode(reader, 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.v1beta3.ListProcessorVersionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.processorVersions && message.processorVersions.length)) - message.processorVersions = []; - message.processorVersions.push($root.google.cloud.documentai.v1beta3.ProcessorVersion.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListProcessorVersionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} ListProcessorVersionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListProcessorVersionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListProcessorVersionsResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListProcessorVersionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorVersions != null && message.hasOwnProperty("processorVersions")) { - if (!Array.isArray(message.processorVersions)) - return "processorVersions: array expected"; - for (var i = 0; i < message.processorVersions.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.ProcessorVersion.verify(message.processorVersions[i]); - if (error) - return "processorVersions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListProcessorVersionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} ListProcessorVersionsResponse - */ - ListProcessorVersionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ListProcessorVersionsResponse(); - if (object.processorVersions) { - if (!Array.isArray(object.processorVersions)) - throw TypeError(".google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.processorVersions: array expected"); - message.processorVersions = []; - for (var i = 0; i < object.processorVersions.length; ++i) { - if (typeof object.processorVersions[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ListProcessorVersionsResponse.processorVersions: object expected"); - message.processorVersions[i] = $root.google.cloud.documentai.v1beta3.ProcessorVersion.fromObject(object.processorVersions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListProcessorVersionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse - * @static - * @param {google.cloud.documentai.v1beta3.ListProcessorVersionsResponse} message ListProcessorVersionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListProcessorVersionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.processorVersions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.processorVersions && message.processorVersions.length) { - object.processorVersions = []; - for (var j = 0; j < message.processorVersions.length; ++j) - object.processorVersions[j] = $root.google.cloud.documentai.v1beta3.ProcessorVersion.toObject(message.processorVersions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListProcessorVersionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListProcessorVersionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListProcessorVersionsResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ListProcessorVersionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListProcessorVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListProcessorVersionsResponse"; - }; - - return ListProcessorVersionsResponse; - })(); - - v1beta3.DeleteProcessorVersionRequest = (function() { - - /** - * Properties of a DeleteProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDeleteProcessorVersionRequest - * @property {string|null} [name] DeleteProcessorVersionRequest name - */ - - /** - * Constructs a new DeleteProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DeleteProcessorVersionRequest. - * @implements IDeleteProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest=} [properties] Properties to set - */ - function DeleteProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteProcessorVersionRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest - * @instance - */ - DeleteProcessorVersionRequest.prototype.name = ""; - - /** - * Creates a new DeleteProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest instance - */ - DeleteProcessorVersionRequest.create = function create(properties) { - return new DeleteProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified DeleteProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest} message DeleteProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorVersionRequest.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 DeleteProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest} message DeleteProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.DeleteProcessorVersionRequest(); - 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 DeleteProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteProcessorVersionRequest.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 DeleteProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest} DeleteProcessorVersionRequest - */ - DeleteProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest} message DeleteProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteProcessorVersionRequest.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 DeleteProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest"; - }; - - return DeleteProcessorVersionRequest; - })(); - - v1beta3.DeleteProcessorVersionMetadata = (function() { - - /** - * Properties of a DeleteProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDeleteProcessorVersionMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] DeleteProcessorVersionMetadata commonMetadata - */ - - /** - * Constructs a new DeleteProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DeleteProcessorVersionMetadata. - * @implements IDeleteProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata=} [properties] Properties to set - */ - function DeleteProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata - * @instance - */ - DeleteProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * Creates a new DeleteProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata instance - */ - DeleteProcessorVersionMetadata.create = function create(properties) { - return new DeleteProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified DeleteProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata} message DeleteProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DeleteProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorVersionMetadata} message DeleteProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.DeleteProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates a DeleteProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata} DeleteProcessorVersionMetadata - */ - DeleteProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from a DeleteProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata} message DeleteProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this DeleteProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - DeleteProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata"; - }; - - return DeleteProcessorVersionMetadata; - })(); - - v1beta3.DeployProcessorVersionRequest = (function() { - - /** - * Properties of a DeployProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDeployProcessorVersionRequest - * @property {string|null} [name] DeployProcessorVersionRequest name - */ - - /** - * Constructs a new DeployProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DeployProcessorVersionRequest. - * @implements IDeployProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest=} [properties] Properties to set - */ - function DeployProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeployProcessorVersionRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest - * @instance - */ - DeployProcessorVersionRequest.prototype.name = ""; - - /** - * Creates a new DeployProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionRequest} DeployProcessorVersionRequest instance - */ - DeployProcessorVersionRequest.create = function create(properties) { - return new DeployProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified DeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest} message DeployProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployProcessorVersionRequest.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 DeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest} message DeployProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeployProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionRequest} DeployProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.DeployProcessorVersionRequest(); - 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 DeployProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionRequest} DeployProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeployProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeployProcessorVersionRequest.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 DeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionRequest} DeployProcessorVersionRequest - */ - DeployProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeployProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.DeployProcessorVersionRequest} message DeployProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeployProcessorVersionRequest.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 DeployProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - DeployProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeployProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeployProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeployProcessorVersionRequest"; - }; - - return DeployProcessorVersionRequest; - })(); - - v1beta3.DeployProcessorVersionResponse = (function() { - - /** - * Properties of a DeployProcessorVersionResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDeployProcessorVersionResponse - */ - - /** - * Constructs a new DeployProcessorVersionResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DeployProcessorVersionResponse. - * @implements IDeployProcessorVersionResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse=} [properties] Properties to set - */ - function DeployProcessorVersionResponse(properties) { - if (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 DeployProcessorVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionResponse} DeployProcessorVersionResponse instance - */ - DeployProcessorVersionResponse.create = function create(properties) { - return new DeployProcessorVersionResponse(properties); - }; - - /** - * Encodes the specified DeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse} message DeployProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployProcessorVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified DeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionResponse} message DeployProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeployProcessorVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionResponse} DeployProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployProcessorVersionResponse.decode = function decode(reader, 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.v1beta3.DeployProcessorVersionResponse(); - 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 DeployProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionResponse} DeployProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeployProcessorVersionResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeployProcessorVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a DeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionResponse} DeployProcessorVersionResponse - */ - DeployProcessorVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse) - return object; - return new $root.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse(); - }; - - /** - * Creates a plain object from a DeployProcessorVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.DeployProcessorVersionResponse} message DeployProcessorVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeployProcessorVersionResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this DeployProcessorVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse - * @instance - * @returns {Object.} JSON object - */ - DeployProcessorVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeployProcessorVersionResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeployProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeployProcessorVersionResponse"; - }; - - return DeployProcessorVersionResponse; - })(); - - v1beta3.DeployProcessorVersionMetadata = (function() { - - /** - * Properties of a DeployProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDeployProcessorVersionMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] DeployProcessorVersionMetadata commonMetadata - */ - - /** - * Constructs a new DeployProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DeployProcessorVersionMetadata. - * @implements IDeployProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata=} [properties] Properties to set - */ - function DeployProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeployProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata - * @instance - */ - DeployProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * Creates a new DeployProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata instance - */ - DeployProcessorVersionMetadata.create = function create(properties) { - return new DeployProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified DeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata} message DeployProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDeployProcessorVersionMetadata} message DeployProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeployProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.DeployProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeployProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeployProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeployProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates a DeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata} DeployProcessorVersionMetadata - */ - DeployProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from a DeployProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata} message DeployProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeployProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this DeployProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - DeployProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeployProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeployProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata"; - }; - - return DeployProcessorVersionMetadata; - })(); - - v1beta3.UndeployProcessorVersionRequest = (function() { - - /** - * Properties of an UndeployProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IUndeployProcessorVersionRequest - * @property {string|null} [name] UndeployProcessorVersionRequest name - */ - - /** - * Constructs a new UndeployProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an UndeployProcessorVersionRequest. - * @implements IUndeployProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest=} [properties] Properties to set - */ - function UndeployProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UndeployProcessorVersionRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest - * @instance - */ - UndeployProcessorVersionRequest.prototype.name = ""; - - /** - * Creates a new UndeployProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest instance - */ - UndeployProcessorVersionRequest.create = function create(properties) { - return new UndeployProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified UndeployProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest} message UndeployProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeployProcessorVersionRequest.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 UndeployProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest} message UndeployProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeployProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UndeployProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeployProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.UndeployProcessorVersionRequest(); - 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 an UndeployProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeployProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UndeployProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UndeployProcessorVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates an UndeployProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest} UndeployProcessorVersionRequest - */ - UndeployProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an UndeployProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest} message UndeployProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UndeployProcessorVersionRequest.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 UndeployProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - UndeployProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UndeployProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UndeployProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest"; - }; - - return UndeployProcessorVersionRequest; - })(); - - v1beta3.UndeployProcessorVersionResponse = (function() { - - /** - * Properties of an UndeployProcessorVersionResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IUndeployProcessorVersionResponse - */ - - /** - * Constructs a new UndeployProcessorVersionResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an UndeployProcessorVersionResponse. - * @implements IUndeployProcessorVersionResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse=} [properties] Properties to set - */ - function UndeployProcessorVersionResponse(properties) { - if (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 UndeployProcessorVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse instance - */ - UndeployProcessorVersionResponse.create = function create(properties) { - return new UndeployProcessorVersionResponse(properties); - }; - - /** - * Encodes the specified UndeployProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse} message UndeployProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeployProcessorVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified UndeployProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionResponse} message UndeployProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeployProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UndeployProcessorVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeployProcessorVersionResponse.decode = function decode(reader, 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.v1beta3.UndeployProcessorVersionResponse(); - 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 UndeployProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeployProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UndeployProcessorVersionResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UndeployProcessorVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an UndeployProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse} UndeployProcessorVersionResponse - */ - UndeployProcessorVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse) - return object; - return new $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse(); - }; - - /** - * Creates a plain object from an UndeployProcessorVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse} message UndeployProcessorVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UndeployProcessorVersionResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this UndeployProcessorVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse - * @instance - * @returns {Object.} JSON object - */ - UndeployProcessorVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UndeployProcessorVersionResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UndeployProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse"; - }; - - return UndeployProcessorVersionResponse; - })(); - - v1beta3.UndeployProcessorVersionMetadata = (function() { - - /** - * Properties of an UndeployProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IUndeployProcessorVersionMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] UndeployProcessorVersionMetadata commonMetadata - */ - - /** - * Constructs a new UndeployProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an UndeployProcessorVersionMetadata. - * @implements IUndeployProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata=} [properties] Properties to set - */ - function UndeployProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UndeployProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata - * @instance - */ - UndeployProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * Creates a new UndeployProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata instance - */ - UndeployProcessorVersionMetadata.create = function create(properties) { - return new UndeployProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified UndeployProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata} message UndeployProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeployProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UndeployProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IUndeployProcessorVersionMetadata} message UndeployProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UndeployProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeployProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.UndeployProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UndeployProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UndeployProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UndeployProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UndeployProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates an UndeployProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata} UndeployProcessorVersionMetadata - */ - UndeployProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from an UndeployProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata} message UndeployProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UndeployProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this UndeployProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - UndeployProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UndeployProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UndeployProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata"; - }; - - return UndeployProcessorVersionMetadata; - })(); - - v1beta3.CreateProcessorRequest = (function() { - - /** - * Properties of a CreateProcessorRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface ICreateProcessorRequest - * @property {string|null} [parent] CreateProcessorRequest parent - * @property {google.cloud.documentai.v1beta3.IProcessor|null} [processor] CreateProcessorRequest processor - */ - - /** - * Constructs a new CreateProcessorRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a CreateProcessorRequest. - * @implements ICreateProcessorRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.ICreateProcessorRequest=} [properties] Properties to set - */ - function CreateProcessorRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateProcessorRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest - * @instance - */ - CreateProcessorRequest.prototype.parent = ""; - - /** - * CreateProcessorRequest processor. - * @member {google.cloud.documentai.v1beta3.IProcessor|null|undefined} processor - * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest - * @instance - */ - CreateProcessorRequest.prototype.processor = null; - - /** - * Creates a new CreateProcessorRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.ICreateProcessorRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.CreateProcessorRequest} CreateProcessorRequest instance - */ - CreateProcessorRequest.create = function create(properties) { - return new CreateProcessorRequest(properties); - }; - - /** - * Encodes the specified CreateProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.CreateProcessorRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.ICreateProcessorRequest} message CreateProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateProcessorRequest.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.processor != null && Object.hasOwnProperty.call(message, "processor")) - $root.google.cloud.documentai.v1beta3.Processor.encode(message.processor, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.CreateProcessorRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.ICreateProcessorRequest} message CreateProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateProcessorRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.CreateProcessorRequest} CreateProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateProcessorRequest.decode = function decode(reader, 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.v1beta3.CreateProcessorRequest(); - 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.processor = $root.google.cloud.documentai.v1beta3.Processor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateProcessorRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.CreateProcessorRequest} CreateProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateProcessorRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateProcessorRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateProcessorRequest.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.processor != null && message.hasOwnProperty("processor")) { - var error = $root.google.cloud.documentai.v1beta3.Processor.verify(message.processor); - if (error) - return "processor." + error; - } - return null; - }; - - /** - * Creates a CreateProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.CreateProcessorRequest} CreateProcessorRequest - */ - CreateProcessorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.CreateProcessorRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.CreateProcessorRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.processor != null) { - if (typeof object.processor !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.CreateProcessorRequest.processor: object expected"); - message.processor = $root.google.cloud.documentai.v1beta3.Processor.fromObject(object.processor); - } - return message; - }; - - /** - * Creates a plain object from a CreateProcessorRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.CreateProcessorRequest} message CreateProcessorRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateProcessorRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.processor = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.processor != null && message.hasOwnProperty("processor")) - object.processor = $root.google.cloud.documentai.v1beta3.Processor.toObject(message.processor, options); - return object; - }; - - /** - * Converts this CreateProcessorRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest - * @instance - * @returns {Object.} JSON object - */ - CreateProcessorRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateProcessorRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.CreateProcessorRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.CreateProcessorRequest"; - }; - - return CreateProcessorRequest; - })(); - - v1beta3.DeleteProcessorRequest = (function() { - - /** - * Properties of a DeleteProcessorRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDeleteProcessorRequest - * @property {string|null} [name] DeleteProcessorRequest name - */ - - /** - * Constructs a new DeleteProcessorRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DeleteProcessorRequest. - * @implements IDeleteProcessorRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorRequest=} [properties] Properties to set - */ - function DeleteProcessorRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteProcessorRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest - * @instance - */ - DeleteProcessorRequest.prototype.name = ""; - - /** - * Creates a new DeleteProcessorRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorRequest} DeleteProcessorRequest instance - */ - DeleteProcessorRequest.create = function create(properties) { - return new DeleteProcessorRequest(properties); - }; - - /** - * Encodes the specified DeleteProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorRequest} message DeleteProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorRequest.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 DeleteProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorRequest} message DeleteProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteProcessorRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorRequest} DeleteProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorRequest.decode = function decode(reader, 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.v1beta3.DeleteProcessorRequest(); - 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 DeleteProcessorRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorRequest} DeleteProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteProcessorRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteProcessorRequest.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 DeleteProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorRequest} DeleteProcessorRequest - */ - DeleteProcessorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DeleteProcessorRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DeleteProcessorRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteProcessorRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.DeleteProcessorRequest} message DeleteProcessorRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteProcessorRequest.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 DeleteProcessorRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteProcessorRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteProcessorRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeleteProcessorRequest"; - }; - - return DeleteProcessorRequest; - })(); - - v1beta3.DeleteProcessorMetadata = (function() { - - /** - * Properties of a DeleteProcessorMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDeleteProcessorMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] DeleteProcessorMetadata commonMetadata - */ - - /** - * Constructs a new DeleteProcessorMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DeleteProcessorMetadata. - * @implements IDeleteProcessorMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorMetadata=} [properties] Properties to set - */ - function DeleteProcessorMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteProcessorMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata - * @instance - */ - DeleteProcessorMetadata.prototype.commonMetadata = null; - - /** - * Creates a new DeleteProcessorMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorMetadata} DeleteProcessorMetadata instance - */ - DeleteProcessorMetadata.create = function create(properties) { - return new DeleteProcessorMetadata(properties); - }; - - /** - * Encodes the specified DeleteProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorMetadata} message DeleteProcessorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DeleteProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DeleteProcessorMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDeleteProcessorMetadata} message DeleteProcessorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteProcessorMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteProcessorMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorMetadata} DeleteProcessorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorMetadata.decode = function decode(reader, 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.v1beta3.DeleteProcessorMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteProcessorMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorMetadata} DeleteProcessorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteProcessorMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteProcessorMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteProcessorMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates a DeleteProcessorMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DeleteProcessorMetadata} DeleteProcessorMetadata - */ - DeleteProcessorMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DeleteProcessorMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DeleteProcessorMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DeleteProcessorMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from a DeleteProcessorMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata - * @static - * @param {google.cloud.documentai.v1beta3.DeleteProcessorMetadata} message DeleteProcessorMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteProcessorMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this DeleteProcessorMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata - * @instance - * @returns {Object.} JSON object - */ - DeleteProcessorMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteProcessorMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DeleteProcessorMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteProcessorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DeleteProcessorMetadata"; - }; - - return DeleteProcessorMetadata; - })(); - - v1beta3.EnableProcessorRequest = (function() { - - /** - * Properties of an EnableProcessorRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IEnableProcessorRequest - * @property {string|null} [name] EnableProcessorRequest name - */ - - /** - * Constructs a new EnableProcessorRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an EnableProcessorRequest. - * @implements IEnableProcessorRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IEnableProcessorRequest=} [properties] Properties to set - */ - function EnableProcessorRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnableProcessorRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest - * @instance - */ - EnableProcessorRequest.prototype.name = ""; - - /** - * Creates a new EnableProcessorRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.IEnableProcessorRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.EnableProcessorRequest} EnableProcessorRequest instance - */ - EnableProcessorRequest.create = function create(properties) { - return new EnableProcessorRequest(properties); - }; - - /** - * Encodes the specified EnableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.IEnableProcessorRequest} message EnableProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProcessorRequest.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 EnableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.IEnableProcessorRequest} message EnableProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnableProcessorRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.EnableProcessorRequest} EnableProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProcessorRequest.decode = function decode(reader, 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.v1beta3.EnableProcessorRequest(); - 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 an EnableProcessorRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.EnableProcessorRequest} EnableProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProcessorRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnableProcessorRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnableProcessorRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates an EnableProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.EnableProcessorRequest} EnableProcessorRequest - */ - EnableProcessorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.EnableProcessorRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.EnableProcessorRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an EnableProcessorRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.EnableProcessorRequest} message EnableProcessorRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnableProcessorRequest.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 EnableProcessorRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest - * @instance - * @returns {Object.} JSON object - */ - EnableProcessorRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnableProcessorRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.EnableProcessorRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnableProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EnableProcessorRequest"; - }; - - return EnableProcessorRequest; - })(); - - v1beta3.EnableProcessorResponse = (function() { - - /** - * Properties of an EnableProcessorResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IEnableProcessorResponse - */ - - /** - * Constructs a new EnableProcessorResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an EnableProcessorResponse. - * @implements IEnableProcessorResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IEnableProcessorResponse=} [properties] Properties to set - */ - function EnableProcessorResponse(properties) { - if (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 EnableProcessorResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse - * @static - * @param {google.cloud.documentai.v1beta3.IEnableProcessorResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.EnableProcessorResponse} EnableProcessorResponse instance - */ - EnableProcessorResponse.create = function create(properties) { - return new EnableProcessorResponse(properties); - }; - - /** - * Encodes the specified EnableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse - * @static - * @param {google.cloud.documentai.v1beta3.IEnableProcessorResponse} message EnableProcessorResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProcessorResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified EnableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse - * @static - * @param {google.cloud.documentai.v1beta3.IEnableProcessorResponse} message EnableProcessorResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProcessorResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnableProcessorResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.EnableProcessorResponse} EnableProcessorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProcessorResponse.decode = function decode(reader, 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.v1beta3.EnableProcessorResponse(); - 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 EnableProcessorResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.EnableProcessorResponse} EnableProcessorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProcessorResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnableProcessorResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnableProcessorResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an EnableProcessorResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.EnableProcessorResponse} EnableProcessorResponse - */ - EnableProcessorResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.EnableProcessorResponse) - return object; - return new $root.google.cloud.documentai.v1beta3.EnableProcessorResponse(); - }; - - /** - * Creates a plain object from an EnableProcessorResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse - * @static - * @param {google.cloud.documentai.v1beta3.EnableProcessorResponse} message EnableProcessorResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnableProcessorResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this EnableProcessorResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse - * @instance - * @returns {Object.} JSON object - */ - EnableProcessorResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnableProcessorResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.EnableProcessorResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnableProcessorResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EnableProcessorResponse"; - }; - - return EnableProcessorResponse; - })(); - - v1beta3.EnableProcessorMetadata = (function() { - - /** - * Properties of an EnableProcessorMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IEnableProcessorMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] EnableProcessorMetadata commonMetadata - */ - - /** - * Constructs a new EnableProcessorMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an EnableProcessorMetadata. - * @implements IEnableProcessorMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IEnableProcessorMetadata=} [properties] Properties to set - */ - function EnableProcessorMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnableProcessorMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata - * @instance - */ - EnableProcessorMetadata.prototype.commonMetadata = null; - - /** - * Creates a new EnableProcessorMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IEnableProcessorMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.EnableProcessorMetadata} EnableProcessorMetadata instance - */ - EnableProcessorMetadata.create = function create(properties) { - return new EnableProcessorMetadata(properties); - }; - - /** - * Encodes the specified EnableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IEnableProcessorMetadata} message EnableProcessorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProcessorMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EnableProcessorMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IEnableProcessorMetadata} message EnableProcessorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnableProcessorMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnableProcessorMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.EnableProcessorMetadata} EnableProcessorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProcessorMetadata.decode = function decode(reader, 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.v1beta3.EnableProcessorMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnableProcessorMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.EnableProcessorMetadata} EnableProcessorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnableProcessorMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnableProcessorMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnableProcessorMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates an EnableProcessorMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.EnableProcessorMetadata} EnableProcessorMetadata - */ - EnableProcessorMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.EnableProcessorMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.EnableProcessorMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.EnableProcessorMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from an EnableProcessorMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1beta3.EnableProcessorMetadata} message EnableProcessorMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnableProcessorMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this EnableProcessorMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata - * @instance - * @returns {Object.} JSON object - */ - EnableProcessorMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnableProcessorMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.EnableProcessorMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnableProcessorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EnableProcessorMetadata"; - }; - - return EnableProcessorMetadata; - })(); - - v1beta3.DisableProcessorRequest = (function() { - - /** - * Properties of a DisableProcessorRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDisableProcessorRequest - * @property {string|null} [name] DisableProcessorRequest name - */ - - /** - * Constructs a new DisableProcessorRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DisableProcessorRequest. - * @implements IDisableProcessorRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IDisableProcessorRequest=} [properties] Properties to set - */ - function DisableProcessorRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DisableProcessorRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest - * @instance - */ - DisableProcessorRequest.prototype.name = ""; - - /** - * Creates a new DisableProcessorRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.IDisableProcessorRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DisableProcessorRequest} DisableProcessorRequest instance - */ - DisableProcessorRequest.create = function create(properties) { - return new DisableProcessorRequest(properties); - }; - - /** - * Encodes the specified DisableProcessorRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.IDisableProcessorRequest} message DisableProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProcessorRequest.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 DisableProcessorRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.IDisableProcessorRequest} message DisableProcessorRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProcessorRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisableProcessorRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DisableProcessorRequest} DisableProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProcessorRequest.decode = function decode(reader, 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.v1beta3.DisableProcessorRequest(); - 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 DisableProcessorRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DisableProcessorRequest} DisableProcessorRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProcessorRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisableProcessorRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisableProcessorRequest.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 DisableProcessorRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DisableProcessorRequest} DisableProcessorRequest - */ - DisableProcessorRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DisableProcessorRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DisableProcessorRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DisableProcessorRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest - * @static - * @param {google.cloud.documentai.v1beta3.DisableProcessorRequest} message DisableProcessorRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisableProcessorRequest.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 DisableProcessorRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest - * @instance - * @returns {Object.} JSON object - */ - DisableProcessorRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisableProcessorRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DisableProcessorRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisableProcessorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DisableProcessorRequest"; - }; - - return DisableProcessorRequest; - })(); - - v1beta3.DisableProcessorResponse = (function() { - - /** - * Properties of a DisableProcessorResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDisableProcessorResponse - */ - - /** - * Constructs a new DisableProcessorResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DisableProcessorResponse. - * @implements IDisableProcessorResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IDisableProcessorResponse=} [properties] Properties to set - */ - function DisableProcessorResponse(properties) { - if (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 DisableProcessorResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse - * @static - * @param {google.cloud.documentai.v1beta3.IDisableProcessorResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DisableProcessorResponse} DisableProcessorResponse instance - */ - DisableProcessorResponse.create = function create(properties) { - return new DisableProcessorResponse(properties); - }; - - /** - * Encodes the specified DisableProcessorResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse - * @static - * @param {google.cloud.documentai.v1beta3.IDisableProcessorResponse} message DisableProcessorResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProcessorResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified DisableProcessorResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse - * @static - * @param {google.cloud.documentai.v1beta3.IDisableProcessorResponse} message DisableProcessorResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProcessorResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisableProcessorResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DisableProcessorResponse} DisableProcessorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProcessorResponse.decode = function decode(reader, 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.v1beta3.DisableProcessorResponse(); - 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 DisableProcessorResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DisableProcessorResponse} DisableProcessorResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProcessorResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisableProcessorResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisableProcessorResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a DisableProcessorResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DisableProcessorResponse} DisableProcessorResponse - */ - DisableProcessorResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DisableProcessorResponse) - return object; - return new $root.google.cloud.documentai.v1beta3.DisableProcessorResponse(); - }; - - /** - * Creates a plain object from a DisableProcessorResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse - * @static - * @param {google.cloud.documentai.v1beta3.DisableProcessorResponse} message DisableProcessorResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisableProcessorResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this DisableProcessorResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse - * @instance - * @returns {Object.} JSON object - */ - DisableProcessorResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisableProcessorResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DisableProcessorResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisableProcessorResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DisableProcessorResponse"; - }; - - return DisableProcessorResponse; - })(); - - v1beta3.DisableProcessorMetadata = (function() { - - /** - * Properties of a DisableProcessorMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDisableProcessorMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] DisableProcessorMetadata commonMetadata - */ - - /** - * Constructs a new DisableProcessorMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DisableProcessorMetadata. - * @implements IDisableProcessorMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IDisableProcessorMetadata=} [properties] Properties to set - */ - function DisableProcessorMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DisableProcessorMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata - * @instance - */ - DisableProcessorMetadata.prototype.commonMetadata = null; - - /** - * Creates a new DisableProcessorMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDisableProcessorMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DisableProcessorMetadata} DisableProcessorMetadata instance - */ - DisableProcessorMetadata.create = function create(properties) { - return new DisableProcessorMetadata(properties); - }; - - /** - * Encodes the specified DisableProcessorMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDisableProcessorMetadata} message DisableProcessorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProcessorMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DisableProcessorMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DisableProcessorMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDisableProcessorMetadata} message DisableProcessorMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisableProcessorMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisableProcessorMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DisableProcessorMetadata} DisableProcessorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProcessorMetadata.decode = function decode(reader, 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.v1beta3.DisableProcessorMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DisableProcessorMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DisableProcessorMetadata} DisableProcessorMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisableProcessorMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisableProcessorMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisableProcessorMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates a DisableProcessorMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DisableProcessorMetadata} DisableProcessorMetadata - */ - DisableProcessorMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DisableProcessorMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DisableProcessorMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DisableProcessorMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from a DisableProcessorMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata - * @static - * @param {google.cloud.documentai.v1beta3.DisableProcessorMetadata} message DisableProcessorMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisableProcessorMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this DisableProcessorMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata - * @instance - * @returns {Object.} JSON object - */ - DisableProcessorMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisableProcessorMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DisableProcessorMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisableProcessorMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DisableProcessorMetadata"; - }; - - return DisableProcessorMetadata; - })(); - - v1beta3.SetDefaultProcessorVersionRequest = (function() { - - /** - * Properties of a SetDefaultProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface ISetDefaultProcessorVersionRequest - * @property {string|null} [processor] SetDefaultProcessorVersionRequest processor - * @property {string|null} [defaultProcessorVersion] SetDefaultProcessorVersionRequest defaultProcessorVersion - */ - - /** - * Constructs a new SetDefaultProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a SetDefaultProcessorVersionRequest. - * @implements ISetDefaultProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest=} [properties] Properties to set - */ - function SetDefaultProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SetDefaultProcessorVersionRequest processor. - * @member {string} processor - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest - * @instance - */ - SetDefaultProcessorVersionRequest.prototype.processor = ""; - - /** - * SetDefaultProcessorVersionRequest defaultProcessorVersion. - * @member {string} defaultProcessorVersion - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest - * @instance - */ - SetDefaultProcessorVersionRequest.prototype.defaultProcessorVersion = ""; - - /** - * Creates a new SetDefaultProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest instance - */ - SetDefaultProcessorVersionRequest.create = function create(properties) { - return new SetDefaultProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified SetDefaultProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest} message SetDefaultProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultProcessorVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processor != null && Object.hasOwnProperty.call(message, "processor")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.processor); - if (message.defaultProcessorVersion != null && Object.hasOwnProperty.call(message, "defaultProcessorVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.defaultProcessorVersion); - return writer; - }; - - /** - * Encodes the specified SetDefaultProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest} message SetDefaultProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.SetDefaultProcessorVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.processor = reader.string(); - break; - } - case 2: { - message.defaultProcessorVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetDefaultProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetDefaultProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetDefaultProcessorVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processor != null && message.hasOwnProperty("processor")) - if (!$util.isString(message.processor)) - return "processor: string expected"; - if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) - if (!$util.isString(message.defaultProcessorVersion)) - return "defaultProcessorVersion: string expected"; - return null; - }; - - /** - * Creates a SetDefaultProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest} SetDefaultProcessorVersionRequest - */ - SetDefaultProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest(); - if (object.processor != null) - message.processor = String(object.processor); - if (object.defaultProcessorVersion != null) - message.defaultProcessorVersion = String(object.defaultProcessorVersion); - return message; - }; - - /** - * Creates a plain object from a SetDefaultProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest} message SetDefaultProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetDefaultProcessorVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.processor = ""; - object.defaultProcessorVersion = ""; - } - if (message.processor != null && message.hasOwnProperty("processor")) - object.processor = message.processor; - if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) - object.defaultProcessorVersion = message.defaultProcessorVersion; - return object; - }; - - /** - * Converts this SetDefaultProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - SetDefaultProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetDefaultProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetDefaultProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest"; - }; - - return SetDefaultProcessorVersionRequest; - })(); - - v1beta3.SetDefaultProcessorVersionResponse = (function() { - - /** - * Properties of a SetDefaultProcessorVersionResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface ISetDefaultProcessorVersionResponse - */ - - /** - * Constructs a new SetDefaultProcessorVersionResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a SetDefaultProcessorVersionResponse. - * @implements ISetDefaultProcessorVersionResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse=} [properties] Properties to set - */ - function SetDefaultProcessorVersionResponse(properties) { - if (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 SetDefaultProcessorVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse instance - */ - SetDefaultProcessorVersionResponse.create = function create(properties) { - return new SetDefaultProcessorVersionResponse(properties); - }; - - /** - * Encodes the specified SetDefaultProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse} message SetDefaultProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultProcessorVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified SetDefaultProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionResponse} message SetDefaultProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetDefaultProcessorVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultProcessorVersionResponse.decode = function decode(reader, 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.v1beta3.SetDefaultProcessorVersionResponse(); - 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 SetDefaultProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetDefaultProcessorVersionResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetDefaultProcessorVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a SetDefaultProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse} SetDefaultProcessorVersionResponse - */ - SetDefaultProcessorVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse) - return object; - return new $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse(); - }; - - /** - * Creates a plain object from a SetDefaultProcessorVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse} message SetDefaultProcessorVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetDefaultProcessorVersionResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this SetDefaultProcessorVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse - * @instance - * @returns {Object.} JSON object - */ - SetDefaultProcessorVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetDefaultProcessorVersionResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetDefaultProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse"; - }; - - return SetDefaultProcessorVersionResponse; - })(); - - v1beta3.SetDefaultProcessorVersionMetadata = (function() { - - /** - * Properties of a SetDefaultProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface ISetDefaultProcessorVersionMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] SetDefaultProcessorVersionMetadata commonMetadata - */ - - /** - * Constructs a new SetDefaultProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a SetDefaultProcessorVersionMetadata. - * @implements ISetDefaultProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata=} [properties] Properties to set - */ - function SetDefaultProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SetDefaultProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata - * @instance - */ - SetDefaultProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * Creates a new SetDefaultProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata instance - */ - SetDefaultProcessorVersionMetadata.create = function create(properties) { - return new SetDefaultProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified SetDefaultProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata} message SetDefaultProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SetDefaultProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionMetadata} message SetDefaultProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetDefaultProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.SetDefaultProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SetDefaultProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetDefaultProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetDefaultProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetDefaultProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates a SetDefaultProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata} SetDefaultProcessorVersionMetadata - */ - SetDefaultProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from a SetDefaultProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata} message SetDefaultProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetDefaultProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this SetDefaultProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - SetDefaultProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetDefaultProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetDefaultProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata"; - }; - - return SetDefaultProcessorVersionMetadata; - })(); - - v1beta3.TrainProcessorVersionRequest = (function() { - - /** - * Properties of a TrainProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface ITrainProcessorVersionRequest - * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null} [customDocumentExtractionOptions] TrainProcessorVersionRequest customDocumentExtractionOptions - * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null} [foundationModelTuningOptions] TrainProcessorVersionRequest foundationModelTuningOptions - * @property {string|null} [parent] TrainProcessorVersionRequest parent - * @property {google.cloud.documentai.v1beta3.IProcessorVersion|null} [processorVersion] TrainProcessorVersionRequest processorVersion - * @property {google.cloud.documentai.v1beta3.IDocumentSchema|null} [documentSchema] TrainProcessorVersionRequest documentSchema - * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData|null} [inputData] TrainProcessorVersionRequest inputData - * @property {string|null} [baseProcessorVersion] TrainProcessorVersionRequest baseProcessorVersion - */ - - /** - * Constructs a new TrainProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a TrainProcessorVersionRequest. - * @implements ITrainProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest=} [properties] Properties to set - */ - function TrainProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrainProcessorVersionRequest customDocumentExtractionOptions. - * @member {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions|null|undefined} customDocumentExtractionOptions - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.customDocumentExtractionOptions = null; - - /** - * TrainProcessorVersionRequest foundationModelTuningOptions. - * @member {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions|null|undefined} foundationModelTuningOptions - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.foundationModelTuningOptions = null; - - /** - * TrainProcessorVersionRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.parent = ""; - - /** - * TrainProcessorVersionRequest processorVersion. - * @member {google.cloud.documentai.v1beta3.IProcessorVersion|null|undefined} processorVersion - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.processorVersion = null; - - /** - * TrainProcessorVersionRequest documentSchema. - * @member {google.cloud.documentai.v1beta3.IDocumentSchema|null|undefined} documentSchema - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.documentSchema = null; - - /** - * TrainProcessorVersionRequest inputData. - * @member {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData|null|undefined} inputData - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.inputData = null; - - /** - * TrainProcessorVersionRequest baseProcessorVersion. - * @member {string} baseProcessorVersion - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @instance - */ - TrainProcessorVersionRequest.prototype.baseProcessorVersion = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TrainProcessorVersionRequest processorFlags. - * @member {"customDocumentExtractionOptions"|"foundationModelTuningOptions"|undefined} processorFlags - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @instance - */ - Object.defineProperty(TrainProcessorVersionRequest.prototype, "processorFlags", { - get: $util.oneOfGetter($oneOfFields = ["customDocumentExtractionOptions", "foundationModelTuningOptions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TrainProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest} TrainProcessorVersionRequest instance - */ - TrainProcessorVersionRequest.create = function create(properties) { - return new TrainProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified TrainProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest} message TrainProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainProcessorVersionRequest.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.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) - $root.google.cloud.documentai.v1beta3.ProcessorVersion.encode(message.processorVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.inputData != null && Object.hasOwnProperty.call(message, "inputData")) - $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.encode(message.inputData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.customDocumentExtractionOptions != null && Object.hasOwnProperty.call(message, "customDocumentExtractionOptions")) - $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.encode(message.customDocumentExtractionOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.baseProcessorVersion != null && Object.hasOwnProperty.call(message, "baseProcessorVersion")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.baseProcessorVersion); - if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) - $root.google.cloud.documentai.v1beta3.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.foundationModelTuningOptions != null && Object.hasOwnProperty.call(message, "foundationModelTuningOptions")) - $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.encode(message.foundationModelTuningOptions, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TrainProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest} message TrainProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest} TrainProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.customDocumentExtractionOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.decode(reader, reader.uint32()); - break; - } - case 12: { - message.foundationModelTuningOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.decode(reader, reader.uint32()); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.processorVersion = $root.google.cloud.documentai.v1beta3.ProcessorVersion.decode(reader, reader.uint32()); - break; - } - case 10: { - message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.decode(reader, reader.uint32()); - break; - } - case 4: { - message.inputData = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.decode(reader, reader.uint32()); - break; - } - case 8: { - message.baseProcessorVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrainProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest} TrainProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrainProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrainProcessorVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.customDocumentExtractionOptions != null && message.hasOwnProperty("customDocumentExtractionOptions")) { - properties.processorFlags = 1; - { - var error = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify(message.customDocumentExtractionOptions); - if (error) - return "customDocumentExtractionOptions." + error; - } - } - if (message.foundationModelTuningOptions != null && message.hasOwnProperty("foundationModelTuningOptions")) { - if (properties.processorFlags === 1) - return "processorFlags: multiple values"; - properties.processorFlags = 1; - { - var error = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify(message.foundationModelTuningOptions); - if (error) - return "foundationModelTuningOptions." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) { - var error = $root.google.cloud.documentai.v1beta3.ProcessorVersion.verify(message.processorVersion); - if (error) - return "processorVersion." + error; - } - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.verify(message.documentSchema); - if (error) - return "documentSchema." + error; - } - if (message.inputData != null && message.hasOwnProperty("inputData")) { - var error = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.verify(message.inputData); - if (error) - return "inputData." + error; - } - if (message.baseProcessorVersion != null && message.hasOwnProperty("baseProcessorVersion")) - if (!$util.isString(message.baseProcessorVersion)) - return "baseProcessorVersion: string expected"; - return null; - }; - - /** - * Creates a TrainProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest} TrainProcessorVersionRequest - */ - TrainProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest(); - if (object.customDocumentExtractionOptions != null) { - if (typeof object.customDocumentExtractionOptions !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.customDocumentExtractionOptions: object expected"); - message.customDocumentExtractionOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.fromObject(object.customDocumentExtractionOptions); - } - if (object.foundationModelTuningOptions != null) { - if (typeof object.foundationModelTuningOptions !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.foundationModelTuningOptions: object expected"); - message.foundationModelTuningOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.fromObject(object.foundationModelTuningOptions); - } - if (object.parent != null) - message.parent = String(object.parent); - if (object.processorVersion != null) { - if (typeof object.processorVersion !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.processorVersion: object expected"); - message.processorVersion = $root.google.cloud.documentai.v1beta3.ProcessorVersion.fromObject(object.processorVersion); - } - if (object.documentSchema != null) { - if (typeof object.documentSchema !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.documentSchema: object expected"); - message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.fromObject(object.documentSchema); - } - if (object.inputData != null) { - if (typeof object.inputData !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.inputData: object expected"); - message.inputData = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.fromObject(object.inputData); - } - if (object.baseProcessorVersion != null) - message.baseProcessorVersion = String(object.baseProcessorVersion); - return message; - }; - - /** - * Creates a plain object from a TrainProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest} message TrainProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrainProcessorVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.processorVersion = null; - object.inputData = null; - object.baseProcessorVersion = ""; - object.documentSchema = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - object.processorVersion = $root.google.cloud.documentai.v1beta3.ProcessorVersion.toObject(message.processorVersion, options); - if (message.inputData != null && message.hasOwnProperty("inputData")) - object.inputData = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.toObject(message.inputData, options); - if (message.customDocumentExtractionOptions != null && message.hasOwnProperty("customDocumentExtractionOptions")) { - object.customDocumentExtractionOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.toObject(message.customDocumentExtractionOptions, options); - if (options.oneofs) - object.processorFlags = "customDocumentExtractionOptions"; - } - if (message.baseProcessorVersion != null && message.hasOwnProperty("baseProcessorVersion")) - object.baseProcessorVersion = message.baseProcessorVersion; - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) - object.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.toObject(message.documentSchema, options); - if (message.foundationModelTuningOptions != null && message.hasOwnProperty("foundationModelTuningOptions")) { - object.foundationModelTuningOptions = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.toObject(message.foundationModelTuningOptions, options); - if (options.oneofs) - object.processorFlags = "foundationModelTuningOptions"; - } - return object; - }; - - /** - * Converts this TrainProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - TrainProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrainProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrainProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionRequest"; - }; - - TrainProcessorVersionRequest.InputData = (function() { - - /** - * Properties of an InputData. - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @interface IInputData - * @property {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null} [trainingDocuments] InputData trainingDocuments - * @property {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null} [testDocuments] InputData testDocuments - */ - - /** - * Constructs a new InputData. - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @classdesc Represents an InputData. - * @implements IInputData - * @constructor - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData=} [properties] Properties to set - */ - function InputData(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InputData trainingDocuments. - * @member {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null|undefined} trainingDocuments - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData - * @instance - */ - InputData.prototype.trainingDocuments = null; - - /** - * InputData testDocuments. - * @member {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null|undefined} testDocuments - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData - * @instance - */ - InputData.prototype.testDocuments = null; - - /** - * Creates a new InputData instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} InputData instance - */ - InputData.create = function create(properties) { - return new InputData(properties); - }; - - /** - * Encodes the specified InputData message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData} message InputData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InputData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.trainingDocuments != null && Object.hasOwnProperty.call(message, "trainingDocuments")) - $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.encode(message.trainingDocuments, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.testDocuments != null && Object.hasOwnProperty.call(message, "testDocuments")) - $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.encode(message.testDocuments, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InputData message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IInputData} message InputData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InputData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InputData message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} InputData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InputData.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionRequest.InputData(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.trainingDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - message.testDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InputData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} InputData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InputData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InputData message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InputData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.trainingDocuments != null && message.hasOwnProperty("trainingDocuments")) { - var error = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify(message.trainingDocuments); - if (error) - return "trainingDocuments." + error; - } - if (message.testDocuments != null && message.hasOwnProperty("testDocuments")) { - var error = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify(message.testDocuments); - if (error) - return "testDocuments." + error; - } - return null; - }; - - /** - * Creates an InputData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} InputData - */ - InputData.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData) - return object; - var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData(); - if (object.trainingDocuments != null) { - if (typeof object.trainingDocuments !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.trainingDocuments: object expected"); - message.trainingDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.fromObject(object.trainingDocuments); - } - if (object.testDocuments != null) { - if (typeof object.testDocuments !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData.testDocuments: object expected"); - message.testDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.fromObject(object.testDocuments); - } - return message; - }; - - /** - * Creates a plain object from an InputData message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} message InputData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InputData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.trainingDocuments = null; - object.testDocuments = null; - } - if (message.trainingDocuments != null && message.hasOwnProperty("trainingDocuments")) - object.trainingDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.toObject(message.trainingDocuments, options); - if (message.testDocuments != null && message.hasOwnProperty("testDocuments")) - object.testDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.toObject(message.testDocuments, options); - return object; - }; - - /** - * Converts this InputData to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData - * @instance - * @returns {Object.} JSON object - */ - InputData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InputData - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InputData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData"; - }; - - return InputData; - })(); - - TrainProcessorVersionRequest.CustomDocumentExtractionOptions = (function() { - - /** - * Properties of a CustomDocumentExtractionOptions. - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @interface ICustomDocumentExtractionOptions - * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod|null} [trainingMethod] CustomDocumentExtractionOptions trainingMethod - */ - - /** - * Constructs a new CustomDocumentExtractionOptions. - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @classdesc Represents a CustomDocumentExtractionOptions. - * @implements ICustomDocumentExtractionOptions - * @constructor - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions=} [properties] Properties to set - */ - function CustomDocumentExtractionOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomDocumentExtractionOptions trainingMethod. - * @member {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod} trainingMethod - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @instance - */ - CustomDocumentExtractionOptions.prototype.trainingMethod = 0; - - /** - * Creates a new CustomDocumentExtractionOptions instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions instance - */ - CustomDocumentExtractionOptions.create = function create(properties) { - return new CustomDocumentExtractionOptions(properties); - }; - - /** - * Encodes the specified CustomDocumentExtractionOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions} message CustomDocumentExtractionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomDocumentExtractionOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.trainingMethod != null && Object.hasOwnProperty.call(message, "trainingMethod")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.trainingMethod); - return writer; - }; - - /** - * Encodes the specified CustomDocumentExtractionOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.ICustomDocumentExtractionOptions} message CustomDocumentExtractionOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomDocumentExtractionOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomDocumentExtractionOptions.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.trainingMethod = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomDocumentExtractionOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomDocumentExtractionOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomDocumentExtractionOptions message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomDocumentExtractionOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.trainingMethod != null && message.hasOwnProperty("trainingMethod")) - switch (message.trainingMethod) { - default: - return "trainingMethod: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a CustomDocumentExtractionOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} CustomDocumentExtractionOptions - */ - CustomDocumentExtractionOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions) - return object; - var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions(); - switch (object.trainingMethod) { - default: - if (typeof object.trainingMethod === "number") { - message.trainingMethod = object.trainingMethod; - break; - } - break; - case "TRAINING_METHOD_UNSPECIFIED": - case 0: - message.trainingMethod = 0; - break; - case "MODEL_BASED": - case 1: - message.trainingMethod = 1; - break; - case "TEMPLATE_BASED": - case 2: - message.trainingMethod = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a CustomDocumentExtractionOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} message CustomDocumentExtractionOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomDocumentExtractionOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.trainingMethod = options.enums === String ? "TRAINING_METHOD_UNSPECIFIED" : 0; - if (message.trainingMethod != null && message.hasOwnProperty("trainingMethod")) - object.trainingMethod = options.enums === String ? $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod[message.trainingMethod] === undefined ? message.trainingMethod : $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod[message.trainingMethod] : message.trainingMethod; - return object; - }; - - /** - * Converts this CustomDocumentExtractionOptions to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @instance - * @returns {Object.} JSON object - */ - CustomDocumentExtractionOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomDocumentExtractionOptions - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomDocumentExtractionOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions"; - }; - - /** - * TrainingMethod enum. - * @name google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod - * @enum {number} - * @property {number} TRAINING_METHOD_UNSPECIFIED=0 TRAINING_METHOD_UNSPECIFIED value - * @property {number} MODEL_BASED=1 MODEL_BASED value - * @property {number} TEMPLATE_BASED=2 TEMPLATE_BASED value - */ - CustomDocumentExtractionOptions.TrainingMethod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TRAINING_METHOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "MODEL_BASED"] = 1; - values[valuesById[2] = "TEMPLATE_BASED"] = 2; - return values; - })(); - - return CustomDocumentExtractionOptions; - })(); - - TrainProcessorVersionRequest.FoundationModelTuningOptions = (function() { - - /** - * Properties of a FoundationModelTuningOptions. - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @interface IFoundationModelTuningOptions - * @property {number|null} [trainSteps] FoundationModelTuningOptions trainSteps - * @property {number|null} [learningRateMultiplier] FoundationModelTuningOptions learningRateMultiplier - */ - - /** - * Constructs a new FoundationModelTuningOptions. - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest - * @classdesc Represents a FoundationModelTuningOptions. - * @implements IFoundationModelTuningOptions - * @constructor - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions=} [properties] Properties to set - */ - function FoundationModelTuningOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FoundationModelTuningOptions trainSteps. - * @member {number} trainSteps - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @instance - */ - FoundationModelTuningOptions.prototype.trainSteps = 0; - - /** - * FoundationModelTuningOptions learningRateMultiplier. - * @member {number} learningRateMultiplier - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @instance - */ - FoundationModelTuningOptions.prototype.learningRateMultiplier = 0; - - /** - * Creates a new FoundationModelTuningOptions instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions instance - */ - FoundationModelTuningOptions.create = function create(properties) { - return new FoundationModelTuningOptions(properties); - }; - - /** - * Encodes the specified FoundationModelTuningOptions message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions} message FoundationModelTuningOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FoundationModelTuningOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.trainSteps != null && Object.hasOwnProperty.call(message, "trainSteps")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.trainSteps); - if (message.learningRateMultiplier != null && Object.hasOwnProperty.call(message, "learningRateMultiplier")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.learningRateMultiplier); - return writer; - }; - - /** - * Encodes the specified FoundationModelTuningOptions message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.IFoundationModelTuningOptions} message FoundationModelTuningOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FoundationModelTuningOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FoundationModelTuningOptions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FoundationModelTuningOptions.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.trainSteps = reader.int32(); - break; - } - case 3: { - message.learningRateMultiplier = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FoundationModelTuningOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FoundationModelTuningOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FoundationModelTuningOptions message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FoundationModelTuningOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.trainSteps != null && message.hasOwnProperty("trainSteps")) - if (!$util.isInteger(message.trainSteps)) - return "trainSteps: integer expected"; - if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) - if (typeof message.learningRateMultiplier !== "number") - return "learningRateMultiplier: number expected"; - return null; - }; - - /** - * Creates a FoundationModelTuningOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions} FoundationModelTuningOptions - */ - FoundationModelTuningOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions) - return object; - var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions(); - if (object.trainSteps != null) - message.trainSteps = object.trainSteps | 0; - if (object.learningRateMultiplier != null) - message.learningRateMultiplier = Number(object.learningRateMultiplier); - return message; - }; - - /** - * Creates a plain object from a FoundationModelTuningOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions} message FoundationModelTuningOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FoundationModelTuningOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.trainSteps = 0; - object.learningRateMultiplier = 0; - } - if (message.trainSteps != null && message.hasOwnProperty("trainSteps")) - object.trainSteps = message.trainSteps; - if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) - object.learningRateMultiplier = options.json && !isFinite(message.learningRateMultiplier) ? String(message.learningRateMultiplier) : message.learningRateMultiplier; - return object; - }; - - /** - * Converts this FoundationModelTuningOptions to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @instance - * @returns {Object.} JSON object - */ - FoundationModelTuningOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FoundationModelTuningOptions - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FoundationModelTuningOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions"; - }; - - return FoundationModelTuningOptions; - })(); - - return TrainProcessorVersionRequest; - })(); - - v1beta3.TrainProcessorVersionResponse = (function() { - - /** - * Properties of a TrainProcessorVersionResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface ITrainProcessorVersionResponse - * @property {string|null} [processorVersion] TrainProcessorVersionResponse processorVersion - */ - - /** - * Constructs a new TrainProcessorVersionResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a TrainProcessorVersionResponse. - * @implements ITrainProcessorVersionResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse=} [properties] Properties to set - */ - function TrainProcessorVersionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrainProcessorVersionResponse processorVersion. - * @member {string} processorVersion - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse - * @instance - */ - TrainProcessorVersionResponse.prototype.processorVersion = ""; - - /** - * Creates a new TrainProcessorVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionResponse} TrainProcessorVersionResponse instance - */ - TrainProcessorVersionResponse.create = function create(properties) { - return new TrainProcessorVersionResponse(properties); - }; - - /** - * Encodes the specified TrainProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse} message TrainProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainProcessorVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorVersion); - return writer; - }; - - /** - * Encodes the specified TrainProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionResponse} message TrainProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionResponse} TrainProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainProcessorVersionResponse.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.processorVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrainProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionResponse} TrainProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrainProcessorVersionResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrainProcessorVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - if (!$util.isString(message.processorVersion)) - return "processorVersion: string expected"; - return null; - }; - - /** - * Creates a TrainProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionResponse} TrainProcessorVersionResponse - */ - TrainProcessorVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionResponse) - return object; - var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionResponse(); - if (object.processorVersion != null) - message.processorVersion = String(object.processorVersion); - return message; - }; - - /** - * Creates a plain object from a TrainProcessorVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionResponse} message TrainProcessorVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrainProcessorVersionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.processorVersion = ""; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - object.processorVersion = message.processorVersion; - return object; - }; - - /** - * Converts this TrainProcessorVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse - * @instance - * @returns {Object.} JSON object - */ - TrainProcessorVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrainProcessorVersionResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrainProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionResponse"; - }; - - return TrainProcessorVersionResponse; - })(); - - v1beta3.TrainProcessorVersionMetadata = (function() { - - /** - * Properties of a TrainProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface ITrainProcessorVersionMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] TrainProcessorVersionMetadata commonMetadata - * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null} [trainingDatasetValidation] TrainProcessorVersionMetadata trainingDatasetValidation - * @property {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null} [testDatasetValidation] TrainProcessorVersionMetadata testDatasetValidation - */ - - /** - * Constructs a new TrainProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a TrainProcessorVersionMetadata. - * @implements ITrainProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata=} [properties] Properties to set - */ - function TrainProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrainProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @instance - */ - TrainProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * TrainProcessorVersionMetadata trainingDatasetValidation. - * @member {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null|undefined} trainingDatasetValidation - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @instance - */ - TrainProcessorVersionMetadata.prototype.trainingDatasetValidation = null; - - /** - * TrainProcessorVersionMetadata testDatasetValidation. - * @member {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation|null|undefined} testDatasetValidation - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @instance - */ - TrainProcessorVersionMetadata.prototype.testDatasetValidation = null; - - /** - * Creates a new TrainProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata instance - */ - TrainProcessorVersionMetadata.create = function create(properties) { - return new TrainProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified TrainProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata} message TrainProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.trainingDatasetValidation != null && Object.hasOwnProperty.call(message, "trainingDatasetValidation")) - $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.encode(message.trainingDatasetValidation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.testDatasetValidation != null && Object.hasOwnProperty.call(message, "testDatasetValidation")) - $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.encode(message.testDatasetValidation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TrainProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.ITrainProcessorVersionMetadata} message TrainProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - case 2: { - message.trainingDatasetValidation = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.decode(reader, reader.uint32()); - break; - } - case 3: { - message.testDatasetValidation = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrainProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrainProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrainProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - if (message.trainingDatasetValidation != null && message.hasOwnProperty("trainingDatasetValidation")) { - var error = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.verify(message.trainingDatasetValidation); - if (error) - return "trainingDatasetValidation." + error; - } - if (message.testDatasetValidation != null && message.hasOwnProperty("testDatasetValidation")) { - var error = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.verify(message.testDatasetValidation); - if (error) - return "testDatasetValidation." + error; - } - return null; - }; - - /** - * Creates a TrainProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata} TrainProcessorVersionMetadata - */ - TrainProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - if (object.trainingDatasetValidation != null) { - if (typeof object.trainingDatasetValidation !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.trainingDatasetValidation: object expected"); - message.trainingDatasetValidation = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.fromObject(object.trainingDatasetValidation); - } - if (object.testDatasetValidation != null) { - if (typeof object.testDatasetValidation !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.testDatasetValidation: object expected"); - message.testDatasetValidation = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.fromObject(object.testDatasetValidation); - } - return message; - }; - - /** - * Creates a plain object from a TrainProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata} message TrainProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrainProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.commonMetadata = null; - object.trainingDatasetValidation = null; - object.testDatasetValidation = null; - } - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - if (message.trainingDatasetValidation != null && message.hasOwnProperty("trainingDatasetValidation")) - object.trainingDatasetValidation = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.toObject(message.trainingDatasetValidation, options); - if (message.testDatasetValidation != null && message.hasOwnProperty("testDatasetValidation")) - object.testDatasetValidation = $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.toObject(message.testDatasetValidation, options); - return object; - }; - - /** - * Converts this TrainProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - TrainProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrainProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrainProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata"; - }; - - TrainProcessorVersionMetadata.DatasetValidation = (function() { - - /** - * Properties of a DatasetValidation. - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @interface IDatasetValidation - * @property {number|null} [documentErrorCount] DatasetValidation documentErrorCount - * @property {number|null} [datasetErrorCount] DatasetValidation datasetErrorCount - * @property {Array.|null} [documentErrors] DatasetValidation documentErrors - * @property {Array.|null} [datasetErrors] DatasetValidation datasetErrors - */ - - /** - * Constructs a new DatasetValidation. - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata - * @classdesc Represents a DatasetValidation. - * @implements IDatasetValidation - * @constructor - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation=} [properties] Properties to set - */ - function DatasetValidation(properties) { - this.documentErrors = []; - this.datasetErrors = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DatasetValidation documentErrorCount. - * @member {number} documentErrorCount - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @instance - */ - DatasetValidation.prototype.documentErrorCount = 0; - - /** - * DatasetValidation datasetErrorCount. - * @member {number} datasetErrorCount - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @instance - */ - DatasetValidation.prototype.datasetErrorCount = 0; - - /** - * DatasetValidation documentErrors. - * @member {Array.} documentErrors - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @instance - */ - DatasetValidation.prototype.documentErrors = $util.emptyArray; - - /** - * DatasetValidation datasetErrors. - * @member {Array.} datasetErrors - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @instance - */ - DatasetValidation.prototype.datasetErrors = $util.emptyArray; - - /** - * Creates a new DatasetValidation instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation instance - */ - DatasetValidation.create = function create(properties) { - return new DatasetValidation(properties); - }; - - /** - * Encodes the specified DatasetValidation message. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation} message DatasetValidation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatasetValidation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentErrors != null && message.documentErrors.length) - for (var i = 0; i < message.documentErrors.length; ++i) - $root.google.rpc.Status.encode(message.documentErrors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.datasetErrors != null && message.datasetErrors.length) - for (var i = 0; i < message.datasetErrors.length; ++i) - $root.google.rpc.Status.encode(message.datasetErrors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.documentErrorCount != null && Object.hasOwnProperty.call(message, "documentErrorCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.documentErrorCount); - if (message.datasetErrorCount != null && Object.hasOwnProperty.call(message, "datasetErrorCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.datasetErrorCount); - return writer; - }; - - /** - * Encodes the specified DatasetValidation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.IDatasetValidation} message DatasetValidation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatasetValidation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DatasetValidation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatasetValidation.decode = function decode(reader, 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.v1beta3.TrainProcessorVersionMetadata.DatasetValidation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.documentErrorCount = reader.int32(); - break; - } - case 4: { - message.datasetErrorCount = reader.int32(); - break; - } - case 1: { - if (!(message.documentErrors && message.documentErrors.length)) - message.documentErrors = []; - message.documentErrors.push($root.google.rpc.Status.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.datasetErrors && message.datasetErrors.length)) - message.datasetErrors = []; - message.datasetErrors.push($root.google.rpc.Status.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DatasetValidation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatasetValidation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DatasetValidation message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DatasetValidation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentErrorCount != null && message.hasOwnProperty("documentErrorCount")) - if (!$util.isInteger(message.documentErrorCount)) - return "documentErrorCount: integer expected"; - if (message.datasetErrorCount != null && message.hasOwnProperty("datasetErrorCount")) - if (!$util.isInteger(message.datasetErrorCount)) - return "datasetErrorCount: integer expected"; - if (message.documentErrors != null && message.hasOwnProperty("documentErrors")) { - if (!Array.isArray(message.documentErrors)) - return "documentErrors: array expected"; - for (var i = 0; i < message.documentErrors.length; ++i) { - var error = $root.google.rpc.Status.verify(message.documentErrors[i]); - if (error) - return "documentErrors." + error; - } - } - if (message.datasetErrors != null && message.hasOwnProperty("datasetErrors")) { - if (!Array.isArray(message.datasetErrors)) - return "datasetErrors: array expected"; - for (var i = 0; i < message.datasetErrors.length; ++i) { - var error = $root.google.rpc.Status.verify(message.datasetErrors[i]); - if (error) - return "datasetErrors." + error; - } - } - return null; - }; - - /** - * Creates a DatasetValidation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation} DatasetValidation - */ - DatasetValidation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation) - return object; - var message = new $root.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation(); - if (object.documentErrorCount != null) - message.documentErrorCount = object.documentErrorCount | 0; - if (object.datasetErrorCount != null) - message.datasetErrorCount = object.datasetErrorCount | 0; - if (object.documentErrors) { - if (!Array.isArray(object.documentErrors)) - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.documentErrors: array expected"); - message.documentErrors = []; - for (var i = 0; i < object.documentErrors.length; ++i) { - if (typeof object.documentErrors[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.documentErrors: object expected"); - message.documentErrors[i] = $root.google.rpc.Status.fromObject(object.documentErrors[i]); - } - } - if (object.datasetErrors) { - if (!Array.isArray(object.datasetErrors)) - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.datasetErrors: array expected"); - message.datasetErrors = []; - for (var i = 0; i < object.datasetErrors.length; ++i) { - if (typeof object.datasetErrors[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation.datasetErrors: object expected"); - message.datasetErrors[i] = $root.google.rpc.Status.fromObject(object.datasetErrors[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a DatasetValidation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation} message DatasetValidation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DatasetValidation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.documentErrors = []; - object.datasetErrors = []; - } - if (options.defaults) { - object.documentErrorCount = 0; - object.datasetErrorCount = 0; - } - if (message.documentErrors && message.documentErrors.length) { - object.documentErrors = []; - for (var j = 0; j < message.documentErrors.length; ++j) - object.documentErrors[j] = $root.google.rpc.Status.toObject(message.documentErrors[j], options); - } - if (message.datasetErrors && message.datasetErrors.length) { - object.datasetErrors = []; - for (var j = 0; j < message.datasetErrors.length; ++j) - object.datasetErrors[j] = $root.google.rpc.Status.toObject(message.datasetErrors[j], options); - } - if (message.documentErrorCount != null && message.hasOwnProperty("documentErrorCount")) - object.documentErrorCount = message.documentErrorCount; - if (message.datasetErrorCount != null && message.hasOwnProperty("datasetErrorCount")) - object.datasetErrorCount = message.datasetErrorCount; - return object; - }; - - /** - * Converts this DatasetValidation to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @instance - * @returns {Object.} JSON object - */ - DatasetValidation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DatasetValidation - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DatasetValidation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation"; - }; - - return DatasetValidation; - })(); - - return TrainProcessorVersionMetadata; - })(); - - v1beta3.ReviewDocumentRequest = (function() { - - /** - * Properties of a ReviewDocumentRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IReviewDocumentRequest - * @property {google.cloud.documentai.v1beta3.IDocument|null} [inlineDocument] ReviewDocumentRequest inlineDocument - * @property {string|null} [humanReviewConfig] ReviewDocumentRequest humanReviewConfig - * @property {google.cloud.documentai.v1beta3.IDocument|null} [document] ReviewDocumentRequest document - * @property {boolean|null} [enableSchemaValidation] ReviewDocumentRequest enableSchemaValidation - * @property {google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority|null} [priority] ReviewDocumentRequest priority - * @property {google.cloud.documentai.v1beta3.IDocumentSchema|null} [documentSchema] ReviewDocumentRequest documentSchema - */ - - /** - * Constructs a new ReviewDocumentRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ReviewDocumentRequest. - * @implements IReviewDocumentRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IReviewDocumentRequest=} [properties] Properties to set - */ - function ReviewDocumentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReviewDocumentRequest inlineDocument. - * @member {google.cloud.documentai.v1beta3.IDocument|null|undefined} inlineDocument - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @instance - */ - ReviewDocumentRequest.prototype.inlineDocument = null; - - /** - * ReviewDocumentRequest humanReviewConfig. - * @member {string} humanReviewConfig - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @instance - */ - ReviewDocumentRequest.prototype.humanReviewConfig = ""; - - /** - * ReviewDocumentRequest document. - * @member {google.cloud.documentai.v1beta3.IDocument|null|undefined} document - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @instance - */ - ReviewDocumentRequest.prototype.document = null; - - /** - * ReviewDocumentRequest enableSchemaValidation. - * @member {boolean} enableSchemaValidation - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @instance - */ - ReviewDocumentRequest.prototype.enableSchemaValidation = false; - - /** - * ReviewDocumentRequest priority. - * @member {google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority} priority - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @instance - */ - ReviewDocumentRequest.prototype.priority = 0; - - /** - * ReviewDocumentRequest documentSchema. - * @member {google.cloud.documentai.v1beta3.IDocumentSchema|null|undefined} documentSchema - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @instance - */ - ReviewDocumentRequest.prototype.documentSchema = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ReviewDocumentRequest source. - * @member {"inlineDocument"|undefined} source - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @instance - */ - Object.defineProperty(ReviewDocumentRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["inlineDocument"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ReviewDocumentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @static - * @param {google.cloud.documentai.v1beta3.IReviewDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ReviewDocumentRequest} ReviewDocumentRequest instance - */ - ReviewDocumentRequest.create = function create(properties) { - return new ReviewDocumentRequest(properties); - }; - - /** - * Encodes the specified ReviewDocumentRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @static - * @param {google.cloud.documentai.v1beta3.IReviewDocumentRequest} message ReviewDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReviewDocumentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.humanReviewConfig != null && Object.hasOwnProperty.call(message, "humanReviewConfig")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.humanReviewConfig); - if (message.document != null && Object.hasOwnProperty.call(message, "document")) - $root.google.cloud.documentai.v1beta3.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.enableSchemaValidation != null && Object.hasOwnProperty.call(message, "enableSchemaValidation")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableSchemaValidation); - if (message.inlineDocument != null && Object.hasOwnProperty.call(message, "inlineDocument")) - $root.google.cloud.documentai.v1beta3.Document.encode(message.inlineDocument, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.priority); - if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) - $root.google.cloud.documentai.v1beta3.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReviewDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @static - * @param {google.cloud.documentai.v1beta3.IReviewDocumentRequest} message ReviewDocumentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReviewDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReviewDocumentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ReviewDocumentRequest} ReviewDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReviewDocumentRequest.decode = function decode(reader, 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.v1beta3.ReviewDocumentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.inlineDocument = $root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32()); - break; - } - case 1: { - message.humanReviewConfig = reader.string(); - break; - } - case 2: { - message.document = $root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32()); - break; - } - case 3: { - message.enableSchemaValidation = reader.bool(); - break; - } - case 5: { - message.priority = reader.int32(); - break; - } - case 6: { - message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReviewDocumentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ReviewDocumentRequest} ReviewDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReviewDocumentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReviewDocumentRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReviewDocumentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1beta3.Document.verify(message.inlineDocument); - if (error) - return "inlineDocument." + error; - } - } - if (message.humanReviewConfig != null && message.hasOwnProperty("humanReviewConfig")) - if (!$util.isString(message.humanReviewConfig)) - return "humanReviewConfig: string expected"; - if (message.document != null && message.hasOwnProperty("document")) { - var error = $root.google.cloud.documentai.v1beta3.Document.verify(message.document); - if (error) - return "document." + error; - } - if (message.enableSchemaValidation != null && message.hasOwnProperty("enableSchemaValidation")) - if (typeof message.enableSchemaValidation !== "boolean") - return "enableSchemaValidation: boolean expected"; - if (message.priority != null && message.hasOwnProperty("priority")) - switch (message.priority) { - default: - return "priority: enum value expected"; - case 0: - case 1: - break; - } - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.verify(message.documentSchema); - if (error) - return "documentSchema." + error; - } - return null; - }; - - /** - * Creates a ReviewDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ReviewDocumentRequest} ReviewDocumentRequest - */ - ReviewDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest(); - if (object.inlineDocument != null) { - if (typeof object.inlineDocument !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ReviewDocumentRequest.inlineDocument: object expected"); - message.inlineDocument = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.inlineDocument); - } - if (object.humanReviewConfig != null) - message.humanReviewConfig = String(object.humanReviewConfig); - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ReviewDocumentRequest.document: object expected"); - message.document = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.document); - } - if (object.enableSchemaValidation != null) - message.enableSchemaValidation = Boolean(object.enableSchemaValidation); - switch (object.priority) { - default: - if (typeof object.priority === "number") { - message.priority = object.priority; - break; - } - break; - case "DEFAULT": - case 0: - message.priority = 0; - break; - case "URGENT": - case 1: - message.priority = 1; - break; - } - if (object.documentSchema != null) { - if (typeof object.documentSchema !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ReviewDocumentRequest.documentSchema: object expected"); - message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.fromObject(object.documentSchema); - } - return message; - }; - - /** - * Creates a plain object from a ReviewDocumentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @static - * @param {google.cloud.documentai.v1beta3.ReviewDocumentRequest} message ReviewDocumentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReviewDocumentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.humanReviewConfig = ""; - object.document = null; - object.enableSchemaValidation = false; - object.priority = options.enums === String ? "DEFAULT" : 0; - object.documentSchema = null; - } - if (message.humanReviewConfig != null && message.hasOwnProperty("humanReviewConfig")) - object.humanReviewConfig = message.humanReviewConfig; - if (message.document != null && message.hasOwnProperty("document")) - object.document = $root.google.cloud.documentai.v1beta3.Document.toObject(message.document, options); - if (message.enableSchemaValidation != null && message.hasOwnProperty("enableSchemaValidation")) - object.enableSchemaValidation = message.enableSchemaValidation; - if (message.inlineDocument != null && message.hasOwnProperty("inlineDocument")) { - object.inlineDocument = $root.google.cloud.documentai.v1beta3.Document.toObject(message.inlineDocument, options); - if (options.oneofs) - object.source = "inlineDocument"; - } - if (message.priority != null && message.hasOwnProperty("priority")) - object.priority = options.enums === String ? $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority[message.priority] === undefined ? message.priority : $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority[message.priority] : message.priority; - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) - object.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.toObject(message.documentSchema, options); - return object; - }; - - /** - * Converts this ReviewDocumentRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @instance - * @returns {Object.} JSON object - */ - ReviewDocumentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReviewDocumentRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReviewDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ReviewDocumentRequest"; - }; - - /** - * Priority enum. - * @name google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority - * @enum {number} - * @property {number} DEFAULT=0 DEFAULT value - * @property {number} URGENT=1 URGENT value - */ - ReviewDocumentRequest.Priority = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEFAULT"] = 0; - values[valuesById[1] = "URGENT"] = 1; - return values; - })(); - - return ReviewDocumentRequest; - })(); - - v1beta3.ReviewDocumentResponse = (function() { - - /** - * Properties of a ReviewDocumentResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IReviewDocumentResponse - * @property {string|null} [gcsDestination] ReviewDocumentResponse gcsDestination - * @property {google.cloud.documentai.v1beta3.ReviewDocumentResponse.State|null} [state] ReviewDocumentResponse state - * @property {string|null} [rejectionReason] ReviewDocumentResponse rejectionReason - */ - - /** - * Constructs a new ReviewDocumentResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ReviewDocumentResponse. - * @implements IReviewDocumentResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IReviewDocumentResponse=} [properties] Properties to set - */ - function ReviewDocumentResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReviewDocumentResponse gcsDestination. - * @member {string} gcsDestination - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @instance - */ - ReviewDocumentResponse.prototype.gcsDestination = ""; - - /** - * ReviewDocumentResponse state. - * @member {google.cloud.documentai.v1beta3.ReviewDocumentResponse.State} state - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @instance - */ - ReviewDocumentResponse.prototype.state = 0; - - /** - * ReviewDocumentResponse rejectionReason. - * @member {string} rejectionReason - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @instance - */ - ReviewDocumentResponse.prototype.rejectionReason = ""; - - /** - * Creates a new ReviewDocumentResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @static - * @param {google.cloud.documentai.v1beta3.IReviewDocumentResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ReviewDocumentResponse} ReviewDocumentResponse instance - */ - ReviewDocumentResponse.create = function create(properties) { - return new ReviewDocumentResponse(properties); - }; - - /** - * Encodes the specified ReviewDocumentResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @static - * @param {google.cloud.documentai.v1beta3.IReviewDocumentResponse} message ReviewDocumentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReviewDocumentResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsDestination); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.rejectionReason != null && Object.hasOwnProperty.call(message, "rejectionReason")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.rejectionReason); - return writer; - }; - - /** - * Encodes the specified ReviewDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @static - * @param {google.cloud.documentai.v1beta3.IReviewDocumentResponse} message ReviewDocumentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReviewDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReviewDocumentResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ReviewDocumentResponse} ReviewDocumentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReviewDocumentResponse.decode = function decode(reader, 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.v1beta3.ReviewDocumentResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcsDestination = reader.string(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 3: { - message.rejectionReason = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReviewDocumentResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ReviewDocumentResponse} ReviewDocumentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReviewDocumentResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReviewDocumentResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReviewDocumentResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - if (!$util.isString(message.gcsDestination)) - return "gcsDestination: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.rejectionReason != null && message.hasOwnProperty("rejectionReason")) - if (!$util.isString(message.rejectionReason)) - return "rejectionReason: string expected"; - return null; - }; - - /** - * Creates a ReviewDocumentResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ReviewDocumentResponse} ReviewDocumentResponse - */ - ReviewDocumentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ReviewDocumentResponse) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ReviewDocumentResponse(); - if (object.gcsDestination != null) - message.gcsDestination = String(object.gcsDestination); - 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 "REJECTED": - case 1: - message.state = 1; - break; - case "SUCCEEDED": - case 2: - message.state = 2; - break; - } - if (object.rejectionReason != null) - message.rejectionReason = String(object.rejectionReason); - return message; - }; - - /** - * Creates a plain object from a ReviewDocumentResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @static - * @param {google.cloud.documentai.v1beta3.ReviewDocumentResponse} message ReviewDocumentResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReviewDocumentResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcsDestination = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.rejectionReason = ""; - } - if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) - object.gcsDestination = message.gcsDestination; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State[message.state] : message.state; - if (message.rejectionReason != null && message.hasOwnProperty("rejectionReason")) - object.rejectionReason = message.rejectionReason; - return object; - }; - - /** - * Converts this ReviewDocumentResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @instance - * @returns {Object.} JSON object - */ - ReviewDocumentResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReviewDocumentResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReviewDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ReviewDocumentResponse"; - }; - - /** - * State enum. - * @name google.cloud.documentai.v1beta3.ReviewDocumentResponse.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} REJECTED=1 REJECTED value - * @property {number} SUCCEEDED=2 SUCCEEDED value - */ - ReviewDocumentResponse.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "REJECTED"] = 1; - values[valuesById[2] = "SUCCEEDED"] = 2; - return values; - })(); - - return ReviewDocumentResponse; - })(); - - v1beta3.ReviewDocumentOperationMetadata = (function() { - - /** - * Properties of a ReviewDocumentOperationMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IReviewDocumentOperationMetadata - * @property {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State|null} [state] ReviewDocumentOperationMetadata state - * @property {string|null} [stateMessage] ReviewDocumentOperationMetadata stateMessage - * @property {google.protobuf.ITimestamp|null} [createTime] ReviewDocumentOperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ReviewDocumentOperationMetadata updateTime - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] ReviewDocumentOperationMetadata commonMetadata - * @property {string|null} [questionId] ReviewDocumentOperationMetadata questionId - */ - - /** - * Constructs a new ReviewDocumentOperationMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ReviewDocumentOperationMetadata. - * @implements IReviewDocumentOperationMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata=} [properties] Properties to set - */ - function ReviewDocumentOperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReviewDocumentOperationMetadata state. - * @member {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State} state - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @instance - */ - ReviewDocumentOperationMetadata.prototype.state = 0; - - /** - * ReviewDocumentOperationMetadata stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @instance - */ - ReviewDocumentOperationMetadata.prototype.stateMessage = ""; - - /** - * ReviewDocumentOperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @instance - */ - ReviewDocumentOperationMetadata.prototype.createTime = null; - - /** - * ReviewDocumentOperationMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @instance - */ - ReviewDocumentOperationMetadata.prototype.updateTime = null; - - /** - * ReviewDocumentOperationMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @instance - */ - ReviewDocumentOperationMetadata.prototype.commonMetadata = null; - - /** - * ReviewDocumentOperationMetadata questionId. - * @member {string} questionId - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @instance - */ - ReviewDocumentOperationMetadata.prototype.questionId = ""; - - /** - * Creates a new ReviewDocumentOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata instance - */ - ReviewDocumentOperationMetadata.create = function create(properties) { - return new ReviewDocumentOperationMetadata(properties); - }; - - /** - * Encodes the specified ReviewDocumentOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata} message ReviewDocumentOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReviewDocumentOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); - 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.questionId != null && Object.hasOwnProperty.call(message, "questionId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.questionId); - return writer; - }; - - /** - * Encodes the specified ReviewDocumentOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IReviewDocumentOperationMetadata} message ReviewDocumentOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReviewDocumentOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReviewDocumentOperationMetadata.decode = function decode(reader, 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.v1beta3.ReviewDocumentOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.stateMessage = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - case 6: { - message.questionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReviewDocumentOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReviewDocumentOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReviewDocumentOperationMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReviewDocumentOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - if (message.questionId != null && message.hasOwnProperty("questionId")) - if (!$util.isString(message.questionId)) - return "questionId: string expected"; - return null; - }; - - /** - * Creates a ReviewDocumentOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata} ReviewDocumentOperationMetadata - */ - ReviewDocumentOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata(); - 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 "RUNNING": - case 1: - message.state = 1; - break; - case "CANCELLING": - case 2: - message.state = 2; - break; - case "SUCCEEDED": - case 3: - message.state = 3; - break; - case "FAILED": - case 4: - message.state = 4; - break; - case "CANCELLED": - case 5: - message.state = 5; - break; - } - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - if (object.questionId != null) - message.questionId = String(object.questionId); - return message; - }; - - /** - * Creates a plain object from a ReviewDocumentOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @static - * @param {google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata} message ReviewDocumentOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReviewDocumentOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; - object.createTime = null; - object.updateTime = null; - object.commonMetadata = null; - object.questionId = ""; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State[message.state] : message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - if (message.questionId != null && message.hasOwnProperty("questionId")) - object.questionId = message.questionId; - return object; - }; - - /** - * Converts this ReviewDocumentOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - ReviewDocumentOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReviewDocumentOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReviewDocumentOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata"; - }; - - /** - * State enum. - * @name google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} CANCELLING=2 CANCELLING value - * @property {number} SUCCEEDED=3 SUCCEEDED value - * @property {number} FAILED=4 FAILED value - * @property {number} CANCELLED=5 CANCELLED value - */ - ReviewDocumentOperationMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "CANCELLING"] = 2; - values[valuesById[3] = "SUCCEEDED"] = 3; - values[valuesById[4] = "FAILED"] = 4; - values[valuesById[5] = "CANCELLED"] = 5; - return values; - })(); - - return ReviewDocumentOperationMetadata; - })(); - - v1beta3.EvaluateProcessorVersionRequest = (function() { - - /** - * Properties of an EvaluateProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IEvaluateProcessorVersionRequest - * @property {string|null} [processorVersion] EvaluateProcessorVersionRequest processorVersion - * @property {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null} [evaluationDocuments] EvaluateProcessorVersionRequest evaluationDocuments - */ - - /** - * Constructs a new EvaluateProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an EvaluateProcessorVersionRequest. - * @implements IEvaluateProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest=} [properties] Properties to set - */ - function EvaluateProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluateProcessorVersionRequest processorVersion. - * @member {string} processorVersion - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest - * @instance - */ - EvaluateProcessorVersionRequest.prototype.processorVersion = ""; - - /** - * EvaluateProcessorVersionRequest evaluationDocuments. - * @member {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null|undefined} evaluationDocuments - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest - * @instance - */ - EvaluateProcessorVersionRequest.prototype.evaluationDocuments = null; - - /** - * Creates a new EvaluateProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest instance - */ - EvaluateProcessorVersionRequest.create = function create(properties) { - return new EvaluateProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified EvaluateProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest} message EvaluateProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluateProcessorVersionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorVersion); - if (message.evaluationDocuments != null && Object.hasOwnProperty.call(message, "evaluationDocuments")) - $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.encode(message.evaluationDocuments, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EvaluateProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest} message EvaluateProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluateProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluateProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.EvaluateProcessorVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.processorVersion = reader.string(); - break; - } - case 3: { - message.evaluationDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluateProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluateProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluateProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluateProcessorVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - if (!$util.isString(message.processorVersion)) - return "processorVersion: string expected"; - if (message.evaluationDocuments != null && message.hasOwnProperty("evaluationDocuments")) { - var error = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify(message.evaluationDocuments); - if (error) - return "evaluationDocuments." + error; - } - return null; - }; - - /** - * Creates an EvaluateProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest} EvaluateProcessorVersionRequest - */ - EvaluateProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest(); - if (object.processorVersion != null) - message.processorVersion = String(object.processorVersion); - if (object.evaluationDocuments != null) { - if (typeof object.evaluationDocuments !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest.evaluationDocuments: object expected"); - message.evaluationDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.fromObject(object.evaluationDocuments); - } - return message; - }; - - /** - * Creates a plain object from an EvaluateProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest} message EvaluateProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluateProcessorVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.processorVersion = ""; - object.evaluationDocuments = null; - } - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - object.processorVersion = message.processorVersion; - if (message.evaluationDocuments != null && message.hasOwnProperty("evaluationDocuments")) - object.evaluationDocuments = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.toObject(message.evaluationDocuments, options); - return object; - }; - - /** - * Converts this EvaluateProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - EvaluateProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluateProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluateProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest"; - }; - - return EvaluateProcessorVersionRequest; - })(); - - v1beta3.EvaluateProcessorVersionMetadata = (function() { - - /** - * Properties of an EvaluateProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IEvaluateProcessorVersionMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] EvaluateProcessorVersionMetadata commonMetadata - */ - - /** - * Constructs a new EvaluateProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an EvaluateProcessorVersionMetadata. - * @implements IEvaluateProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata=} [properties] Properties to set - */ - function EvaluateProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluateProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata - * @instance - */ - EvaluateProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * Creates a new EvaluateProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata instance - */ - EvaluateProcessorVersionMetadata.create = function create(properties) { - return new EvaluateProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified EvaluateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata} message EvaluateProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluateProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EvaluateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionMetadata} message EvaluateProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluateProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluateProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.EvaluateProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluateProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluateProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluateProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluateProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates an EvaluateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata} EvaluateProcessorVersionMetadata - */ - EvaluateProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from an EvaluateProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata} message EvaluateProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluateProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this EvaluateProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - EvaluateProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluateProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluateProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata"; - }; - - return EvaluateProcessorVersionMetadata; - })(); - - v1beta3.EvaluateProcessorVersionResponse = (function() { - - /** - * Properties of an EvaluateProcessorVersionResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IEvaluateProcessorVersionResponse - * @property {string|null} [evaluation] EvaluateProcessorVersionResponse evaluation - */ - - /** - * Constructs a new EvaluateProcessorVersionResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an EvaluateProcessorVersionResponse. - * @implements IEvaluateProcessorVersionResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse=} [properties] Properties to set - */ - function EvaluateProcessorVersionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluateProcessorVersionResponse evaluation. - * @member {string} evaluation - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse - * @instance - */ - EvaluateProcessorVersionResponse.prototype.evaluation = ""; - - /** - * Creates a new EvaluateProcessorVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse instance - */ - EvaluateProcessorVersionResponse.create = function create(properties) { - return new EvaluateProcessorVersionResponse(properties); - }; - - /** - * Encodes the specified EvaluateProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse} message EvaluateProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluateProcessorVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluation); - return writer; - }; - - /** - * Encodes the specified EvaluateProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluateProcessorVersionResponse} message EvaluateProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluateProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluateProcessorVersionResponse.decode = function decode(reader, 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.v1beta3.EvaluateProcessorVersionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.evaluation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluateProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluateProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluateProcessorVersionResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluateProcessorVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluation != null && message.hasOwnProperty("evaluation")) - if (!$util.isString(message.evaluation)) - return "evaluation: string expected"; - return null; - }; - - /** - * Creates an EvaluateProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse} EvaluateProcessorVersionResponse - */ - EvaluateProcessorVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse) - return object; - var message = new $root.google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse(); - if (object.evaluation != null) - message.evaluation = String(object.evaluation); - return message; - }; - - /** - * Creates a plain object from an EvaluateProcessorVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse} message EvaluateProcessorVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluateProcessorVersionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.evaluation = ""; - if (message.evaluation != null && message.hasOwnProperty("evaluation")) - object.evaluation = message.evaluation; - return object; - }; - - /** - * Converts this EvaluateProcessorVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse - * @instance - * @returns {Object.} JSON object - */ - EvaluateProcessorVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluateProcessorVersionResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluateProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse"; - }; - - return EvaluateProcessorVersionResponse; - })(); - - v1beta3.GetEvaluationRequest = (function() { - - /** - * Properties of a GetEvaluationRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGetEvaluationRequest - * @property {string|null} [name] GetEvaluationRequest name - */ - - /** - * Constructs a new GetEvaluationRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a GetEvaluationRequest. - * @implements IGetEvaluationRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IGetEvaluationRequest=} [properties] Properties to set - */ - function GetEvaluationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetEvaluationRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest - * @instance - */ - GetEvaluationRequest.prototype.name = ""; - - /** - * Creates a new GetEvaluationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetEvaluationRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.GetEvaluationRequest} GetEvaluationRequest instance - */ - GetEvaluationRequest.create = function create(properties) { - return new GetEvaluationRequest(properties); - }; - - /** - * Encodes the specified GetEvaluationRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetEvaluationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationRequest.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 GetEvaluationRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetEvaluationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetEvaluationRequest} message GetEvaluationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetEvaluationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetEvaluationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.GetEvaluationRequest} GetEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationRequest.decode = function decode(reader, 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.v1beta3.GetEvaluationRequest(); - 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 GetEvaluationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.GetEvaluationRequest} GetEvaluationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetEvaluationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetEvaluationRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetEvaluationRequest.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 GetEvaluationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.GetEvaluationRequest} GetEvaluationRequest - */ - GetEvaluationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.GetEvaluationRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.GetEvaluationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetEvaluationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest - * @static - * @param {google.cloud.documentai.v1beta3.GetEvaluationRequest} message GetEvaluationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetEvaluationRequest.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 GetEvaluationRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest - * @instance - * @returns {Object.} JSON object - */ - GetEvaluationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetEvaluationRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.GetEvaluationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetEvaluationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetEvaluationRequest"; - }; - - return GetEvaluationRequest; - })(); - - v1beta3.ListEvaluationsRequest = (function() { - - /** - * Properties of a ListEvaluationsRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IListEvaluationsRequest - * @property {string|null} [parent] ListEvaluationsRequest parent - * @property {number|null} [pageSize] ListEvaluationsRequest pageSize - * @property {string|null} [pageToken] ListEvaluationsRequest pageToken - */ - - /** - * Constructs a new ListEvaluationsRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ListEvaluationsRequest. - * @implements IListEvaluationsRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IListEvaluationsRequest=} [properties] Properties to set - */ - function ListEvaluationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationsRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.parent = ""; - - /** - * ListEvaluationsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.pageSize = 0; - - /** - * ListEvaluationsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @instance - */ - ListEvaluationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListEvaluationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListEvaluationsRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ListEvaluationsRequest} ListEvaluationsRequest instance - */ - ListEvaluationsRequest.create = function create(properties) { - return new ListEvaluationsRequest(properties); - }; - - /** - * Encodes the specified ListEvaluationsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationsRequest.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 ListEvaluationsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListEvaluationsRequest} message ListEvaluationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ListEvaluationsRequest} ListEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationsRequest.decode = function decode(reader, 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.v1beta3.ListEvaluationsRequest(); - 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 ListEvaluationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ListEvaluationsRequest} ListEvaluationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationsRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationsRequest.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 ListEvaluationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ListEvaluationsRequest} ListEvaluationsRequest - */ - ListEvaluationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ListEvaluationsRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ListEvaluationsRequest(); - 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 ListEvaluationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @static - * @param {google.cloud.documentai.v1beta3.ListEvaluationsRequest} message ListEvaluationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationsRequest.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 ListEvaluationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationsRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListEvaluationsRequest"; - }; - - return ListEvaluationsRequest; - })(); - - v1beta3.ListEvaluationsResponse = (function() { - - /** - * Properties of a ListEvaluationsResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IListEvaluationsResponse - * @property {Array.|null} [evaluations] ListEvaluationsResponse evaluations - * @property {string|null} [nextPageToken] ListEvaluationsResponse nextPageToken - */ - - /** - * Constructs a new ListEvaluationsResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ListEvaluationsResponse. - * @implements IListEvaluationsResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IListEvaluationsResponse=} [properties] Properties to set - */ - function ListEvaluationsResponse(properties) { - this.evaluations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEvaluationsResponse evaluations. - * @member {Array.} evaluations - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse - * @instance - */ - ListEvaluationsResponse.prototype.evaluations = $util.emptyArray; - - /** - * ListEvaluationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse - * @instance - */ - ListEvaluationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListEvaluationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListEvaluationsResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ListEvaluationsResponse} ListEvaluationsResponse instance - */ - ListEvaluationsResponse.create = function create(properties) { - return new ListEvaluationsResponse(properties); - }; - - /** - * Encodes the specified ListEvaluationsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.evaluations != null && message.evaluations.length) - for (var i = 0; i < message.evaluations.length; ++i) - $root.google.cloud.documentai.v1beta3.Evaluation.encode(message.evaluations[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 ListEvaluationsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListEvaluationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListEvaluationsResponse} message ListEvaluationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEvaluationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListEvaluationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ListEvaluationsResponse} ListEvaluationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationsResponse.decode = function decode(reader, 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.v1beta3.ListEvaluationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.evaluations && message.evaluations.length)) - message.evaluations = []; - message.evaluations.push($root.google.cloud.documentai.v1beta3.Evaluation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListEvaluationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ListEvaluationsResponse} ListEvaluationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListEvaluationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListEvaluationsResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListEvaluationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.evaluations != null && message.hasOwnProperty("evaluations")) { - if (!Array.isArray(message.evaluations)) - return "evaluations: array expected"; - for (var i = 0; i < message.evaluations.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.Evaluation.verify(message.evaluations[i]); - if (error) - return "evaluations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListEvaluationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ListEvaluationsResponse} ListEvaluationsResponse - */ - ListEvaluationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ListEvaluationsResponse) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ListEvaluationsResponse(); - if (object.evaluations) { - if (!Array.isArray(object.evaluations)) - throw TypeError(".google.cloud.documentai.v1beta3.ListEvaluationsResponse.evaluations: array expected"); - message.evaluations = []; - for (var i = 0; i < object.evaluations.length; ++i) { - if (typeof object.evaluations[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ListEvaluationsResponse.evaluations: object expected"); - message.evaluations[i] = $root.google.cloud.documentai.v1beta3.Evaluation.fromObject(object.evaluations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListEvaluationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse - * @static - * @param {google.cloud.documentai.v1beta3.ListEvaluationsResponse} message ListEvaluationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListEvaluationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.evaluations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.evaluations && message.evaluations.length) { - object.evaluations = []; - for (var j = 0; j < message.evaluations.length; ++j) - object.evaluations[j] = $root.google.cloud.documentai.v1beta3.Evaluation.toObject(message.evaluations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListEvaluationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListEvaluationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListEvaluationsResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ListEvaluationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListEvaluationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListEvaluationsResponse"; - }; - - return ListEvaluationsResponse; - })(); - - v1beta3.ImportProcessorVersionRequest = (function() { - - /** - * Properties of an ImportProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IImportProcessorVersionRequest - * @property {string|null} [processorVersionSource] ImportProcessorVersionRequest processorVersionSource - * @property {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource|null} [externalProcessorVersionSource] ImportProcessorVersionRequest externalProcessorVersionSource - * @property {string|null} [parent] ImportProcessorVersionRequest parent - */ - - /** - * Constructs a new ImportProcessorVersionRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an ImportProcessorVersionRequest. - * @implements IImportProcessorVersionRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionRequest=} [properties] Properties to set - */ - function ImportProcessorVersionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportProcessorVersionRequest processorVersionSource. - * @member {string|null|undefined} processorVersionSource - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @instance - */ - ImportProcessorVersionRequest.prototype.processorVersionSource = null; - - /** - * ImportProcessorVersionRequest externalProcessorVersionSource. - * @member {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource|null|undefined} externalProcessorVersionSource - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @instance - */ - ImportProcessorVersionRequest.prototype.externalProcessorVersionSource = null; - - /** - * ImportProcessorVersionRequest parent. - * @member {string} parent - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @instance - */ - ImportProcessorVersionRequest.prototype.parent = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ImportProcessorVersionRequest source. - * @member {"processorVersionSource"|"externalProcessorVersionSource"|undefined} source - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @instance - */ - Object.defineProperty(ImportProcessorVersionRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["processorVersionSource", "externalProcessorVersionSource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ImportProcessorVersionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest} ImportProcessorVersionRequest instance - */ - ImportProcessorVersionRequest.create = function create(properties) { - return new ImportProcessorVersionRequest(properties); - }; - - /** - * Encodes the specified ImportProcessorVersionRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionRequest} message ImportProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportProcessorVersionRequest.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.processorVersionSource != null && Object.hasOwnProperty.call(message, "processorVersionSource")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.processorVersionSource); - if (message.externalProcessorVersionSource != null && Object.hasOwnProperty.call(message, "externalProcessorVersionSource")) - $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.encode(message.externalProcessorVersionSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ImportProcessorVersionRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionRequest} message ImportProcessorVersionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportProcessorVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportProcessorVersionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest} ImportProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportProcessorVersionRequest.decode = function decode(reader, 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.v1beta3.ImportProcessorVersionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.processorVersionSource = reader.string(); - break; - } - case 3: { - message.externalProcessorVersionSource = $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.decode(reader, reader.uint32()); - break; - } - case 1: { - message.parent = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportProcessorVersionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest} ImportProcessorVersionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportProcessorVersionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportProcessorVersionRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportProcessorVersionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.processorVersionSource != null && message.hasOwnProperty("processorVersionSource")) { - properties.source = 1; - if (!$util.isString(message.processorVersionSource)) - return "processorVersionSource: string expected"; - } - if (message.externalProcessorVersionSource != null && message.hasOwnProperty("externalProcessorVersionSource")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - { - var error = $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.verify(message.externalProcessorVersionSource); - if (error) - return "externalProcessorVersionSource." + error; - } - } - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - return null; - }; - - /** - * Creates an ImportProcessorVersionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest} ImportProcessorVersionRequest - */ - ImportProcessorVersionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest(); - if (object.processorVersionSource != null) - message.processorVersionSource = String(object.processorVersionSource); - if (object.externalProcessorVersionSource != null) { - if (typeof object.externalProcessorVersionSource !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.externalProcessorVersionSource: object expected"); - message.externalProcessorVersionSource = $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.fromObject(object.externalProcessorVersionSource); - } - if (object.parent != null) - message.parent = String(object.parent); - return message; - }; - - /** - * Creates a plain object from an ImportProcessorVersionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @static - * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest} message ImportProcessorVersionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportProcessorVersionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.processorVersionSource != null && message.hasOwnProperty("processorVersionSource")) { - object.processorVersionSource = message.processorVersionSource; - if (options.oneofs) - object.source = "processorVersionSource"; - } - if (message.externalProcessorVersionSource != null && message.hasOwnProperty("externalProcessorVersionSource")) { - object.externalProcessorVersionSource = $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.toObject(message.externalProcessorVersionSource, options); - if (options.oneofs) - object.source = "externalProcessorVersionSource"; - } - return object; - }; - - /** - * Converts this ImportProcessorVersionRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @instance - * @returns {Object.} JSON object - */ - ImportProcessorVersionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportProcessorVersionRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportProcessorVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportProcessorVersionRequest"; - }; - - ImportProcessorVersionRequest.ExternalProcessorVersionSource = (function() { - - /** - * Properties of an ExternalProcessorVersionSource. - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @interface IExternalProcessorVersionSource - * @property {string|null} [processorVersion] ExternalProcessorVersionSource processorVersion - * @property {string|null} [serviceEndpoint] ExternalProcessorVersionSource serviceEndpoint - */ - - /** - * Constructs a new ExternalProcessorVersionSource. - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest - * @classdesc Represents an ExternalProcessorVersionSource. - * @implements IExternalProcessorVersionSource - * @constructor - * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource=} [properties] Properties to set - */ - function ExternalProcessorVersionSource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExternalProcessorVersionSource processorVersion. - * @member {string} processorVersion - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource - * @instance - */ - ExternalProcessorVersionSource.prototype.processorVersion = ""; - - /** - * ExternalProcessorVersionSource serviceEndpoint. - * @member {string} serviceEndpoint - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource - * @instance - */ - ExternalProcessorVersionSource.prototype.serviceEndpoint = ""; - - /** - * Creates a new ExternalProcessorVersionSource instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource - * @static - * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource} ExternalProcessorVersionSource instance - */ - ExternalProcessorVersionSource.create = function create(properties) { - return new ExternalProcessorVersionSource(properties); - }; - - /** - * Encodes the specified ExternalProcessorVersionSource message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource - * @static - * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource} message ExternalProcessorVersionSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExternalProcessorVersionSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorVersion); - if (message.serviceEndpoint != null && Object.hasOwnProperty.call(message, "serviceEndpoint")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceEndpoint); - return writer; - }; - - /** - * Encodes the specified ExternalProcessorVersionSource message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource - * @static - * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.IExternalProcessorVersionSource} message ExternalProcessorVersionSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExternalProcessorVersionSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExternalProcessorVersionSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource} ExternalProcessorVersionSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExternalProcessorVersionSource.decode = function decode(reader, 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.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.processorVersion = reader.string(); - break; - } - case 2: { - message.serviceEndpoint = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExternalProcessorVersionSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource} ExternalProcessorVersionSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExternalProcessorVersionSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExternalProcessorVersionSource message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExternalProcessorVersionSource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - if (!$util.isString(message.processorVersion)) - return "processorVersion: string expected"; - if (message.serviceEndpoint != null && message.hasOwnProperty("serviceEndpoint")) - if (!$util.isString(message.serviceEndpoint)) - return "serviceEndpoint: string expected"; - return null; - }; - - /** - * Creates an ExternalProcessorVersionSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource} ExternalProcessorVersionSource - */ - ExternalProcessorVersionSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource(); - if (object.processorVersion != null) - message.processorVersion = String(object.processorVersion); - if (object.serviceEndpoint != null) - message.serviceEndpoint = String(object.serviceEndpoint); - return message; - }; - - /** - * Creates a plain object from an ExternalProcessorVersionSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource - * @static - * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource} message ExternalProcessorVersionSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExternalProcessorVersionSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.processorVersion = ""; - object.serviceEndpoint = ""; - } - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - object.processorVersion = message.processorVersion; - if (message.serviceEndpoint != null && message.hasOwnProperty("serviceEndpoint")) - object.serviceEndpoint = message.serviceEndpoint; - return object; - }; - - /** - * Converts this ExternalProcessorVersionSource to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource - * @instance - * @returns {Object.} JSON object - */ - ExternalProcessorVersionSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExternalProcessorVersionSource - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExternalProcessorVersionSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource"; - }; - - return ExternalProcessorVersionSource; - })(); - - return ImportProcessorVersionRequest; - })(); - - v1beta3.ImportProcessorVersionResponse = (function() { - - /** - * Properties of an ImportProcessorVersionResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IImportProcessorVersionResponse - * @property {string|null} [processorVersion] ImportProcessorVersionResponse processorVersion - */ - - /** - * Constructs a new ImportProcessorVersionResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an ImportProcessorVersionResponse. - * @implements IImportProcessorVersionResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionResponse=} [properties] Properties to set - */ - function ImportProcessorVersionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportProcessorVersionResponse processorVersion. - * @member {string} processorVersion - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse - * @instance - */ - ImportProcessorVersionResponse.prototype.processorVersion = ""; - - /** - * Creates a new ImportProcessorVersionResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionResponse} ImportProcessorVersionResponse instance - */ - ImportProcessorVersionResponse.create = function create(properties) { - return new ImportProcessorVersionResponse(properties); - }; - - /** - * Encodes the specified ImportProcessorVersionResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionResponse} message ImportProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportProcessorVersionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorVersion); - return writer; - }; - - /** - * Encodes the specified ImportProcessorVersionResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionResponse} message ImportProcessorVersionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportProcessorVersionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportProcessorVersionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionResponse} ImportProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportProcessorVersionResponse.decode = function decode(reader, 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.v1beta3.ImportProcessorVersionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.processorVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportProcessorVersionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionResponse} ImportProcessorVersionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportProcessorVersionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportProcessorVersionResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportProcessorVersionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - if (!$util.isString(message.processorVersion)) - return "processorVersion: string expected"; - return null; - }; - - /** - * Creates an ImportProcessorVersionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionResponse} ImportProcessorVersionResponse - */ - ImportProcessorVersionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ImportProcessorVersionResponse) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ImportProcessorVersionResponse(); - if (object.processorVersion != null) - message.processorVersion = String(object.processorVersion); - return message; - }; - - /** - * Creates a plain object from an ImportProcessorVersionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse - * @static - * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionResponse} message ImportProcessorVersionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportProcessorVersionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.processorVersion = ""; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - object.processorVersion = message.processorVersion; - return object; - }; - - /** - * Converts this ImportProcessorVersionResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse - * @instance - * @returns {Object.} JSON object - */ - ImportProcessorVersionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportProcessorVersionResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportProcessorVersionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportProcessorVersionResponse"; - }; - - return ImportProcessorVersionResponse; - })(); - - v1beta3.ImportProcessorVersionMetadata = (function() { - - /** - * Properties of an ImportProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IImportProcessorVersionMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] ImportProcessorVersionMetadata commonMetadata - */ - - /** - * Constructs a new ImportProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an ImportProcessorVersionMetadata. - * @implements IImportProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata=} [properties] Properties to set - */ - function ImportProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata - * @instance - */ - ImportProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * Creates a new ImportProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata} ImportProcessorVersionMetadata instance - */ - ImportProcessorVersionMetadata.create = function create(properties) { - return new ImportProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified ImportProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata} message ImportProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ImportProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IImportProcessorVersionMetadata} message ImportProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata} ImportProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.ImportProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata} ImportProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates an ImportProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata} ImportProcessorVersionMetadata - */ - ImportProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from an ImportProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata} message ImportProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this ImportProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - ImportProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata"; - }; - - return ImportProcessorVersionMetadata; - })(); - - v1beta3.UpdateProcessorVersionMetadata = (function() { - - /** - * Properties of an UpdateProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IUpdateProcessorVersionMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] UpdateProcessorVersionMetadata commonMetadata - */ - - /** - * Constructs a new UpdateProcessorVersionMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an UpdateProcessorVersionMetadata. - * @implements IUpdateProcessorVersionMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata=} [properties] Properties to set - */ - function UpdateProcessorVersionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateProcessorVersionMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata - * @instance - */ - UpdateProcessorVersionMetadata.prototype.commonMetadata = null; - - /** - * Creates a new UpdateProcessorVersionMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} UpdateProcessorVersionMetadata instance - */ - UpdateProcessorVersionMetadata.create = function create(properties) { - return new UpdateProcessorVersionMetadata(properties); - }; - - /** - * Encodes the specified UpdateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata} message UpdateProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateProcessorVersionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata} message UpdateProcessorVersionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateProcessorVersionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} UpdateProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.UpdateProcessorVersionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateProcessorVersionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} UpdateProcessorVersionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateProcessorVersionMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateProcessorVersionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates an UpdateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} UpdateProcessorVersionMetadata - */ - UpdateProcessorVersionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from an UpdateProcessorVersionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata - * @static - * @param {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} message UpdateProcessorVersionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateProcessorVersionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this UpdateProcessorVersionMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateProcessorVersionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateProcessorVersionMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata"; - }; - - return UpdateProcessorVersionMetadata; - })(); - - v1beta3.EvaluationReference = (function() { - - /** - * Properties of an EvaluationReference. - * @memberof google.cloud.documentai.v1beta3 - * @interface IEvaluationReference - * @property {string|null} [operation] EvaluationReference operation - * @property {string|null} [evaluation] EvaluationReference evaluation - * @property {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null} [aggregateMetrics] EvaluationReference aggregateMetrics - * @property {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null} [aggregateMetricsExact] EvaluationReference aggregateMetricsExact - */ - - /** - * Constructs a new EvaluationReference. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an EvaluationReference. - * @implements IEvaluationReference - * @constructor - * @param {google.cloud.documentai.v1beta3.IEvaluationReference=} [properties] Properties to set - */ - function EvaluationReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationReference operation. - * @member {string} operation - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @instance - */ - EvaluationReference.prototype.operation = ""; - - /** - * EvaluationReference evaluation. - * @member {string} evaluation - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @instance - */ - EvaluationReference.prototype.evaluation = ""; - - /** - * EvaluationReference aggregateMetrics. - * @member {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null|undefined} aggregateMetrics - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @instance - */ - EvaluationReference.prototype.aggregateMetrics = null; - - /** - * EvaluationReference aggregateMetricsExact. - * @member {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null|undefined} aggregateMetricsExact - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @instance - */ - EvaluationReference.prototype.aggregateMetricsExact = null; - - /** - * Creates a new EvaluationReference instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluationReference=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.EvaluationReference} EvaluationReference instance - */ - EvaluationReference.create = function create(properties) { - return new EvaluationReference(properties); - }; - - /** - * Encodes the specified EvaluationReference message. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluationReference.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluationReference} message EvaluationReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); - if (message.evaluation != null && Object.hasOwnProperty.call(message, "evaluation")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.evaluation); - if (message.aggregateMetrics != null && Object.hasOwnProperty.call(message, "aggregateMetrics")) - $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.encode(message.aggregateMetrics, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.aggregateMetricsExact != null && Object.hasOwnProperty.call(message, "aggregateMetricsExact")) - $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.encode(message.aggregateMetricsExact, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EvaluationReference message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.EvaluationReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluationReference} message EvaluationReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationReference message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.EvaluationReference} EvaluationReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationReference.decode = function decode(reader, 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.v1beta3.EvaluationReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.operation = reader.string(); - break; - } - case 2: { - message.evaluation = reader.string(); - break; - } - case 4: { - message.aggregateMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.decode(reader, reader.uint32()); - break; - } - case 5: { - message.aggregateMetricsExact = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.EvaluationReference} EvaluationReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationReference message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operation != null && message.hasOwnProperty("operation")) - if (!$util.isString(message.operation)) - return "operation: string expected"; - if (message.evaluation != null && message.hasOwnProperty("evaluation")) - if (!$util.isString(message.evaluation)) - return "evaluation: string expected"; - if (message.aggregateMetrics != null && message.hasOwnProperty("aggregateMetrics")) { - var error = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.verify(message.aggregateMetrics); - if (error) - return "aggregateMetrics." + error; - } - if (message.aggregateMetricsExact != null && message.hasOwnProperty("aggregateMetricsExact")) { - var error = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.verify(message.aggregateMetricsExact); - if (error) - return "aggregateMetricsExact." + error; - } - return null; - }; - - /** - * Creates an EvaluationReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.EvaluationReference} EvaluationReference - */ - EvaluationReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.EvaluationReference) - return object; - var message = new $root.google.cloud.documentai.v1beta3.EvaluationReference(); - if (object.operation != null) - message.operation = String(object.operation); - if (object.evaluation != null) - message.evaluation = String(object.evaluation); - if (object.aggregateMetrics != null) { - if (typeof object.aggregateMetrics !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.EvaluationReference.aggregateMetrics: object expected"); - message.aggregateMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.fromObject(object.aggregateMetrics); - } - if (object.aggregateMetricsExact != null) { - if (typeof object.aggregateMetricsExact !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.EvaluationReference.aggregateMetricsExact: object expected"); - message.aggregateMetricsExact = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.fromObject(object.aggregateMetricsExact); - } - return message; - }; - - /** - * Creates a plain object from an EvaluationReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @static - * @param {google.cloud.documentai.v1beta3.EvaluationReference} message EvaluationReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.operation = ""; - object.evaluation = ""; - object.aggregateMetrics = null; - object.aggregateMetricsExact = null; - } - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = message.operation; - if (message.evaluation != null && message.hasOwnProperty("evaluation")) - object.evaluation = message.evaluation; - if (message.aggregateMetrics != null && message.hasOwnProperty("aggregateMetrics")) - object.aggregateMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.toObject(message.aggregateMetrics, options); - if (message.aggregateMetricsExact != null && message.hasOwnProperty("aggregateMetricsExact")) - object.aggregateMetricsExact = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.toObject(message.aggregateMetricsExact, options); - return object; - }; - - /** - * Converts this EvaluationReference to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @instance - * @returns {Object.} JSON object - */ - EvaluationReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationReference - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.EvaluationReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.EvaluationReference"; - }; - - return EvaluationReference; - })(); - - v1beta3.Evaluation = (function() { - - /** - * Properties of an Evaluation. - * @memberof google.cloud.documentai.v1beta3 - * @interface IEvaluation - * @property {string|null} [name] Evaluation name - * @property {google.protobuf.ITimestamp|null} [createTime] Evaluation createTime - * @property {google.cloud.documentai.v1beta3.Evaluation.ICounters|null} [documentCounters] Evaluation documentCounters - * @property {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null} [allEntitiesMetrics] Evaluation allEntitiesMetrics - * @property {Object.|null} [entityMetrics] Evaluation entityMetrics - * @property {string|null} [kmsKeyName] Evaluation kmsKeyName - * @property {string|null} [kmsKeyVersionName] Evaluation kmsKeyVersionName - * @property {Array.|null} [revisions] Evaluation revisions - */ - - /** - * Constructs a new Evaluation. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an Evaluation. - * @implements IEvaluation - * @constructor - * @param {google.cloud.documentai.v1beta3.IEvaluation=} [properties] Properties to set - */ - function Evaluation(properties) { - this.entityMetrics = {}; - this.revisions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Evaluation name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.name = ""; - - /** - * Evaluation createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.createTime = null; - - /** - * Evaluation documentCounters. - * @member {google.cloud.documentai.v1beta3.Evaluation.ICounters|null|undefined} documentCounters - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.documentCounters = null; - - /** - * Evaluation allEntitiesMetrics. - * @member {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null|undefined} allEntitiesMetrics - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.allEntitiesMetrics = null; - - /** - * Evaluation entityMetrics. - * @member {Object.} entityMetrics - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.entityMetrics = $util.emptyObject; - - /** - * Evaluation kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.kmsKeyName = ""; - - /** - * Evaluation kmsKeyVersionName. - * @member {string} kmsKeyVersionName - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.kmsKeyVersionName = ""; - - /** - * Evaluation revisions. - * @member {Array.} revisions - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - */ - Evaluation.prototype.revisions = $util.emptyArray; - - /** - * Creates a new Evaluation instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluation=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Evaluation} Evaluation instance - */ - Evaluation.create = function create(properties) { - return new Evaluation(properties); - }; - - /** - * Encodes the specified Evaluation message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluation} message Evaluation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Evaluation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.allEntitiesMetrics != null && Object.hasOwnProperty.call(message, "allEntitiesMetrics")) - $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.encode(message.allEntitiesMetrics, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.entityMetrics != null && Object.hasOwnProperty.call(message, "entityMetrics")) - for (var keys = Object.keys(message.entityMetrics), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.encode(message.entityMetrics[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.documentCounters != null && Object.hasOwnProperty.call(message, "documentCounters")) - $root.google.cloud.documentai.v1beta3.Evaluation.Counters.encode(message.documentCounters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.kmsKeyName); - if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.kmsKeyVersionName); - if (message.revisions != null && message.revisions.length) - for (var i = 0; i < message.revisions.length; ++i) - $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.encode(message.revisions[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Evaluation message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @static - * @param {google.cloud.documentai.v1beta3.IEvaluation} message Evaluation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Evaluation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Evaluation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Evaluation} Evaluation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Evaluation.decode = function decode(reader, 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.v1beta3.Evaluation(), key, value; - 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.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.decode(reader, reader.uint32()); - break; - } - case 3: { - message.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); - break; - } - case 4: { - if (message.entityMetrics === $util.emptyObject) - message.entityMetrics = {}; - 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.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.entityMetrics[key] = value; - break; - } - case 6: { - message.kmsKeyName = reader.string(); - break; - } - case 7: { - message.kmsKeyVersionName = reader.string(); - break; - } - case 9: { - if (!(message.revisions && message.revisions.length)) - message.revisions = []; - message.revisions.push($root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Evaluation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Evaluation} Evaluation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Evaluation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Evaluation message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Evaluation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.documentCounters != null && message.hasOwnProperty("documentCounters")) { - var error = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.verify(message.documentCounters); - if (error) - return "documentCounters." + error; - } - if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) { - var error = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify(message.allEntitiesMetrics); - if (error) - return "allEntitiesMetrics." + error; - } - if (message.entityMetrics != null && message.hasOwnProperty("entityMetrics")) { - if (!$util.isObject(message.entityMetrics)) - return "entityMetrics: object expected"; - var key = Object.keys(message.entityMetrics); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify(message.entityMetrics[key[i]]); - if (error) - return "entityMetrics." + error; - } - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) - if (!$util.isString(message.kmsKeyVersionName)) - return "kmsKeyVersionName: string expected"; - 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.v1beta3.Evaluation.EvaluationRevision.verify(message.revisions[i]); - if (error) - return "revisions." + error; - } - } - return null; - }; - - /** - * Creates an Evaluation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Evaluation} Evaluation - */ - Evaluation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Evaluation(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.documentCounters != null) { - if (typeof object.documentCounters !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.documentCounters: object expected"); - message.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.fromObject(object.documentCounters); - } - if (object.allEntitiesMetrics != null) { - if (typeof object.allEntitiesMetrics !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.allEntitiesMetrics: object expected"); - message.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.fromObject(object.allEntitiesMetrics); - } - if (object.entityMetrics) { - if (typeof object.entityMetrics !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.entityMetrics: object expected"); - message.entityMetrics = {}; - for (var keys = Object.keys(object.entityMetrics), i = 0; i < keys.length; ++i) { - if (typeof object.entityMetrics[keys[i]] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.entityMetrics: object expected"); - message.entityMetrics[keys[i]] = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.fromObject(object.entityMetrics[keys[i]]); - } - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyVersionName != null) - message.kmsKeyVersionName = String(object.kmsKeyVersionName); - if (object.revisions) { - if (!Array.isArray(object.revisions)) - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.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.v1beta3.Evaluation.revisions: object expected"); - message.revisions[i] = $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.fromObject(object.revisions[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an Evaluation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation} message Evaluation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Evaluation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.revisions = []; - if (options.objects || options.defaults) - object.entityMetrics = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.allEntitiesMetrics = null; - object.documentCounters = null; - object.kmsKeyName = ""; - object.kmsKeyVersionName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) - object.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.toObject(message.allEntitiesMetrics, options); - var keys2; - if (message.entityMetrics && (keys2 = Object.keys(message.entityMetrics)).length) { - object.entityMetrics = {}; - for (var j = 0; j < keys2.length; ++j) - object.entityMetrics[keys2[j]] = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.toObject(message.entityMetrics[keys2[j]], options); - } - if (message.documentCounters != null && message.hasOwnProperty("documentCounters")) - object.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.toObject(message.documentCounters, options); - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) - object.kmsKeyVersionName = message.kmsKeyVersionName; - if (message.revisions && message.revisions.length) { - object.revisions = []; - for (var j = 0; j < message.revisions.length; ++j) - object.revisions[j] = $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.toObject(message.revisions[j], options); - } - return object; - }; - - /** - * Converts this Evaluation to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @instance - * @returns {Object.} JSON object - */ - Evaluation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Evaluation - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Evaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation"; - }; - - Evaluation.Counters = (function() { - - /** - * Properties of a Counters. - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @interface ICounters - * @property {number|null} [inputDocumentsCount] Counters inputDocumentsCount - * @property {number|null} [invalidDocumentsCount] Counters invalidDocumentsCount - * @property {number|null} [failedDocumentsCount] Counters failedDocumentsCount - * @property {number|null} [evaluatedDocumentsCount] Counters evaluatedDocumentsCount - */ - - /** - * Constructs a new Counters. - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @classdesc Represents a Counters. - * @implements ICounters - * @constructor - * @param {google.cloud.documentai.v1beta3.Evaluation.ICounters=} [properties] Properties to set - */ - function Counters(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Counters inputDocumentsCount. - * @member {number} inputDocumentsCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @instance - */ - Counters.prototype.inputDocumentsCount = 0; - - /** - * Counters invalidDocumentsCount. - * @member {number} invalidDocumentsCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @instance - */ - Counters.prototype.invalidDocumentsCount = 0; - - /** - * Counters failedDocumentsCount. - * @member {number} failedDocumentsCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @instance - */ - Counters.prototype.failedDocumentsCount = 0; - - /** - * Counters evaluatedDocumentsCount. - * @member {number} evaluatedDocumentsCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @instance - */ - Counters.prototype.evaluatedDocumentsCount = 0; - - /** - * Creates a new Counters instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.ICounters=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Evaluation.Counters} Counters instance - */ - Counters.create = function create(properties) { - return new Counters(properties); - }; - - /** - * Encodes the specified Counters message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Counters.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.ICounters} message Counters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Counters.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputDocumentsCount != null && Object.hasOwnProperty.call(message, "inputDocumentsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.inputDocumentsCount); - if (message.invalidDocumentsCount != null && Object.hasOwnProperty.call(message, "invalidDocumentsCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.invalidDocumentsCount); - if (message.failedDocumentsCount != null && Object.hasOwnProperty.call(message, "failedDocumentsCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.failedDocumentsCount); - if (message.evaluatedDocumentsCount != null && Object.hasOwnProperty.call(message, "evaluatedDocumentsCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.evaluatedDocumentsCount); - return writer; - }; - - /** - * Encodes the specified Counters message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Counters.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.ICounters} message Counters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Counters.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Counters message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Evaluation.Counters} Counters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Counters.decode = function decode(reader, 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.v1beta3.Evaluation.Counters(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.inputDocumentsCount = reader.int32(); - break; - } - case 2: { - message.invalidDocumentsCount = reader.int32(); - break; - } - case 3: { - message.failedDocumentsCount = reader.int32(); - break; - } - case 4: { - message.evaluatedDocumentsCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Counters message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Evaluation.Counters} Counters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Counters.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Counters message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Counters.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputDocumentsCount != null && message.hasOwnProperty("inputDocumentsCount")) - if (!$util.isInteger(message.inputDocumentsCount)) - return "inputDocumentsCount: integer expected"; - if (message.invalidDocumentsCount != null && message.hasOwnProperty("invalidDocumentsCount")) - if (!$util.isInteger(message.invalidDocumentsCount)) - return "invalidDocumentsCount: integer expected"; - if (message.failedDocumentsCount != null && message.hasOwnProperty("failedDocumentsCount")) - if (!$util.isInteger(message.failedDocumentsCount)) - return "failedDocumentsCount: integer expected"; - if (message.evaluatedDocumentsCount != null && message.hasOwnProperty("evaluatedDocumentsCount")) - if (!$util.isInteger(message.evaluatedDocumentsCount)) - return "evaluatedDocumentsCount: integer expected"; - return null; - }; - - /** - * Creates a Counters message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Evaluation.Counters} Counters - */ - Counters.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.Counters) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Evaluation.Counters(); - if (object.inputDocumentsCount != null) - message.inputDocumentsCount = object.inputDocumentsCount | 0; - if (object.invalidDocumentsCount != null) - message.invalidDocumentsCount = object.invalidDocumentsCount | 0; - if (object.failedDocumentsCount != null) - message.failedDocumentsCount = object.failedDocumentsCount | 0; - if (object.evaluatedDocumentsCount != null) - message.evaluatedDocumentsCount = object.evaluatedDocumentsCount | 0; - return message; - }; - - /** - * Creates a plain object from a Counters message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.Counters} message Counters - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Counters.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inputDocumentsCount = 0; - object.invalidDocumentsCount = 0; - object.failedDocumentsCount = 0; - object.evaluatedDocumentsCount = 0; - } - if (message.inputDocumentsCount != null && message.hasOwnProperty("inputDocumentsCount")) - object.inputDocumentsCount = message.inputDocumentsCount; - if (message.invalidDocumentsCount != null && message.hasOwnProperty("invalidDocumentsCount")) - object.invalidDocumentsCount = message.invalidDocumentsCount; - if (message.failedDocumentsCount != null && message.hasOwnProperty("failedDocumentsCount")) - object.failedDocumentsCount = message.failedDocumentsCount; - if (message.evaluatedDocumentsCount != null && message.hasOwnProperty("evaluatedDocumentsCount")) - object.evaluatedDocumentsCount = message.evaluatedDocumentsCount; - return object; - }; - - /** - * Converts this Counters to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @instance - * @returns {Object.} JSON object - */ - Counters.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Counters - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Evaluation.Counters - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Counters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.Counters"; - }; - - return Counters; - })(); - - Evaluation.Metrics = (function() { - - /** - * Properties of a Metrics. - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @interface IMetrics - * @property {number|null} [precision] Metrics precision - * @property {number|null} [recall] Metrics recall - * @property {number|null} [f1Score] Metrics f1Score - * @property {number|null} [predictedOccurrencesCount] Metrics predictedOccurrencesCount - * @property {number|null} [groundTruthOccurrencesCount] Metrics groundTruthOccurrencesCount - * @property {number|null} [predictedDocumentCount] Metrics predictedDocumentCount - * @property {number|null} [groundTruthDocumentCount] Metrics groundTruthDocumentCount - * @property {number|null} [truePositivesCount] Metrics truePositivesCount - * @property {number|null} [falsePositivesCount] Metrics falsePositivesCount - * @property {number|null} [falseNegativesCount] Metrics falseNegativesCount - * @property {number|null} [totalDocumentsCount] Metrics totalDocumentsCount - */ - - /** - * Constructs a new Metrics. - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @classdesc Represents a Metrics. - * @implements IMetrics - * @constructor - * @param {google.cloud.documentai.v1beta3.Evaluation.IMetrics=} [properties] Properties to set - */ - function Metrics(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Metrics precision. - * @member {number} precision - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.precision = 0; - - /** - * Metrics recall. - * @member {number} recall - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.recall = 0; - - /** - * Metrics f1Score. - * @member {number} f1Score - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.f1Score = 0; - - /** - * Metrics predictedOccurrencesCount. - * @member {number} predictedOccurrencesCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.predictedOccurrencesCount = 0; - - /** - * Metrics groundTruthOccurrencesCount. - * @member {number} groundTruthOccurrencesCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.groundTruthOccurrencesCount = 0; - - /** - * Metrics predictedDocumentCount. - * @member {number} predictedDocumentCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.predictedDocumentCount = 0; - - /** - * Metrics groundTruthDocumentCount. - * @member {number} groundTruthDocumentCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.groundTruthDocumentCount = 0; - - /** - * Metrics truePositivesCount. - * @member {number} truePositivesCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.truePositivesCount = 0; - - /** - * Metrics falsePositivesCount. - * @member {number} falsePositivesCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.falsePositivesCount = 0; - - /** - * Metrics falseNegativesCount. - * @member {number} falseNegativesCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.falseNegativesCount = 0; - - /** - * Metrics totalDocumentsCount. - * @member {number} totalDocumentsCount - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - */ - Metrics.prototype.totalDocumentsCount = 0; - - /** - * Creates a new Metrics instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IMetrics=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Evaluation.Metrics} Metrics instance - */ - Metrics.create = function create(properties) { - return new Metrics(properties); - }; - - /** - * Encodes the specified Metrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Metrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IMetrics} message Metrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.precision != null && Object.hasOwnProperty.call(message, "precision")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.precision); - if (message.recall != null && Object.hasOwnProperty.call(message, "recall")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.recall); - if (message.f1Score != null && Object.hasOwnProperty.call(message, "f1Score")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.f1Score); - if (message.predictedOccurrencesCount != null && Object.hasOwnProperty.call(message, "predictedOccurrencesCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.predictedOccurrencesCount); - if (message.groundTruthOccurrencesCount != null && Object.hasOwnProperty.call(message, "groundTruthOccurrencesCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.groundTruthOccurrencesCount); - if (message.truePositivesCount != null && Object.hasOwnProperty.call(message, "truePositivesCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.truePositivesCount); - if (message.falsePositivesCount != null && Object.hasOwnProperty.call(message, "falsePositivesCount")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.falsePositivesCount); - if (message.falseNegativesCount != null && Object.hasOwnProperty.call(message, "falseNegativesCount")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.falseNegativesCount); - if (message.totalDocumentsCount != null && Object.hasOwnProperty.call(message, "totalDocumentsCount")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.totalDocumentsCount); - if (message.predictedDocumentCount != null && Object.hasOwnProperty.call(message, "predictedDocumentCount")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.predictedDocumentCount); - if (message.groundTruthDocumentCount != null && Object.hasOwnProperty.call(message, "groundTruthDocumentCount")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.groundTruthDocumentCount); - return writer; - }; - - /** - * Encodes the specified Metrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.Metrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IMetrics} message Metrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Metrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Evaluation.Metrics} Metrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metrics.decode = function decode(reader, 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.v1beta3.Evaluation.Metrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.precision = reader.float(); - break; - } - case 2: { - message.recall = reader.float(); - break; - } - case 3: { - message.f1Score = reader.float(); - break; - } - case 4: { - message.predictedOccurrencesCount = reader.int32(); - break; - } - case 5: { - message.groundTruthOccurrencesCount = reader.int32(); - break; - } - case 10: { - message.predictedDocumentCount = reader.int32(); - break; - } - case 11: { - message.groundTruthDocumentCount = reader.int32(); - break; - } - case 6: { - message.truePositivesCount = reader.int32(); - break; - } - case 7: { - message.falsePositivesCount = reader.int32(); - break; - } - case 8: { - message.falseNegativesCount = reader.int32(); - break; - } - case 9: { - message.totalDocumentsCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Metrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Evaluation.Metrics} Metrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Metrics message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.precision != null && message.hasOwnProperty("precision")) - if (typeof message.precision !== "number") - return "precision: number expected"; - if (message.recall != null && message.hasOwnProperty("recall")) - if (typeof message.recall !== "number") - return "recall: number expected"; - if (message.f1Score != null && message.hasOwnProperty("f1Score")) - if (typeof message.f1Score !== "number") - return "f1Score: number expected"; - if (message.predictedOccurrencesCount != null && message.hasOwnProperty("predictedOccurrencesCount")) - if (!$util.isInteger(message.predictedOccurrencesCount)) - return "predictedOccurrencesCount: integer expected"; - if (message.groundTruthOccurrencesCount != null && message.hasOwnProperty("groundTruthOccurrencesCount")) - if (!$util.isInteger(message.groundTruthOccurrencesCount)) - return "groundTruthOccurrencesCount: integer expected"; - if (message.predictedDocumentCount != null && message.hasOwnProperty("predictedDocumentCount")) - if (!$util.isInteger(message.predictedDocumentCount)) - return "predictedDocumentCount: integer expected"; - if (message.groundTruthDocumentCount != null && message.hasOwnProperty("groundTruthDocumentCount")) - if (!$util.isInteger(message.groundTruthDocumentCount)) - return "groundTruthDocumentCount: integer expected"; - if (message.truePositivesCount != null && message.hasOwnProperty("truePositivesCount")) - if (!$util.isInteger(message.truePositivesCount)) - return "truePositivesCount: integer expected"; - if (message.falsePositivesCount != null && message.hasOwnProperty("falsePositivesCount")) - if (!$util.isInteger(message.falsePositivesCount)) - return "falsePositivesCount: integer expected"; - if (message.falseNegativesCount != null && message.hasOwnProperty("falseNegativesCount")) - if (!$util.isInteger(message.falseNegativesCount)) - return "falseNegativesCount: integer expected"; - if (message.totalDocumentsCount != null && message.hasOwnProperty("totalDocumentsCount")) - if (!$util.isInteger(message.totalDocumentsCount)) - return "totalDocumentsCount: integer expected"; - return null; - }; - - /** - * Creates a Metrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Evaluation.Metrics} Metrics - */ - Metrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.Metrics) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Evaluation.Metrics(); - if (object.precision != null) - message.precision = Number(object.precision); - if (object.recall != null) - message.recall = Number(object.recall); - if (object.f1Score != null) - message.f1Score = Number(object.f1Score); - if (object.predictedOccurrencesCount != null) - message.predictedOccurrencesCount = object.predictedOccurrencesCount | 0; - if (object.groundTruthOccurrencesCount != null) - message.groundTruthOccurrencesCount = object.groundTruthOccurrencesCount | 0; - if (object.predictedDocumentCount != null) - message.predictedDocumentCount = object.predictedDocumentCount | 0; - if (object.groundTruthDocumentCount != null) - message.groundTruthDocumentCount = object.groundTruthDocumentCount | 0; - if (object.truePositivesCount != null) - message.truePositivesCount = object.truePositivesCount | 0; - if (object.falsePositivesCount != null) - message.falsePositivesCount = object.falsePositivesCount | 0; - if (object.falseNegativesCount != null) - message.falseNegativesCount = object.falseNegativesCount | 0; - if (object.totalDocumentsCount != null) - message.totalDocumentsCount = object.totalDocumentsCount | 0; - return message; - }; - - /** - * Creates a plain object from a Metrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.Metrics} message Metrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.precision = 0; - object.recall = 0; - object.f1Score = 0; - object.predictedOccurrencesCount = 0; - object.groundTruthOccurrencesCount = 0; - object.truePositivesCount = 0; - object.falsePositivesCount = 0; - object.falseNegativesCount = 0; - object.totalDocumentsCount = 0; - object.predictedDocumentCount = 0; - object.groundTruthDocumentCount = 0; - } - if (message.precision != null && message.hasOwnProperty("precision")) - object.precision = options.json && !isFinite(message.precision) ? String(message.precision) : message.precision; - if (message.recall != null && message.hasOwnProperty("recall")) - object.recall = options.json && !isFinite(message.recall) ? String(message.recall) : message.recall; - if (message.f1Score != null && message.hasOwnProperty("f1Score")) - object.f1Score = options.json && !isFinite(message.f1Score) ? String(message.f1Score) : message.f1Score; - if (message.predictedOccurrencesCount != null && message.hasOwnProperty("predictedOccurrencesCount")) - object.predictedOccurrencesCount = message.predictedOccurrencesCount; - if (message.groundTruthOccurrencesCount != null && message.hasOwnProperty("groundTruthOccurrencesCount")) - object.groundTruthOccurrencesCount = message.groundTruthOccurrencesCount; - if (message.truePositivesCount != null && message.hasOwnProperty("truePositivesCount")) - object.truePositivesCount = message.truePositivesCount; - if (message.falsePositivesCount != null && message.hasOwnProperty("falsePositivesCount")) - object.falsePositivesCount = message.falsePositivesCount; - if (message.falseNegativesCount != null && message.hasOwnProperty("falseNegativesCount")) - object.falseNegativesCount = message.falseNegativesCount; - if (message.totalDocumentsCount != null && message.hasOwnProperty("totalDocumentsCount")) - object.totalDocumentsCount = message.totalDocumentsCount; - if (message.predictedDocumentCount != null && message.hasOwnProperty("predictedDocumentCount")) - object.predictedDocumentCount = message.predictedDocumentCount; - if (message.groundTruthDocumentCount != null && message.hasOwnProperty("groundTruthDocumentCount")) - object.groundTruthDocumentCount = message.groundTruthDocumentCount; - return object; - }; - - /** - * Converts this Metrics to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @instance - * @returns {Object.} JSON object - */ - Metrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Metrics - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Evaluation.Metrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Metrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.Metrics"; - }; - - return Metrics; - })(); - - Evaluation.ConfidenceLevelMetrics = (function() { - - /** - * Properties of a ConfidenceLevelMetrics. - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @interface IConfidenceLevelMetrics - * @property {number|null} [confidenceLevel] ConfidenceLevelMetrics confidenceLevel - * @property {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null} [metrics] ConfidenceLevelMetrics metrics - */ - - /** - * Constructs a new ConfidenceLevelMetrics. - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @classdesc Represents a ConfidenceLevelMetrics. - * @implements IConfidenceLevelMetrics - * @constructor - * @param {google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics=} [properties] Properties to set - */ - function ConfidenceLevelMetrics(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConfidenceLevelMetrics confidenceLevel. - * @member {number} confidenceLevel - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @instance - */ - ConfidenceLevelMetrics.prototype.confidenceLevel = 0; - - /** - * ConfidenceLevelMetrics metrics. - * @member {google.cloud.documentai.v1beta3.Evaluation.IMetrics|null|undefined} metrics - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @instance - */ - ConfidenceLevelMetrics.prototype.metrics = null; - - /** - * Creates a new ConfidenceLevelMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics instance - */ - ConfidenceLevelMetrics.create = function create(properties) { - return new ConfidenceLevelMetrics(properties); - }; - - /** - * Encodes the specified ConfidenceLevelMetrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics} message ConfidenceLevelMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConfidenceLevelMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.confidenceLevel != null && Object.hasOwnProperty.call(message, "confidenceLevel")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.confidenceLevel); - if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) - $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.encode(message.metrics, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ConfidenceLevelMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IConfidenceLevelMetrics} message ConfidenceLevelMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConfidenceLevelMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConfidenceLevelMetrics.decode = function decode(reader, 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.v1beta3.Evaluation.ConfidenceLevelMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.confidenceLevel = reader.float(); - break; - } - case 2: { - message.metrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConfidenceLevelMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConfidenceLevelMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConfidenceLevelMetrics message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConfidenceLevelMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.confidenceLevel != null && message.hasOwnProperty("confidenceLevel")) - if (typeof message.confidenceLevel !== "number") - return "confidenceLevel: number expected"; - if (message.metrics != null && message.hasOwnProperty("metrics")) { - var error = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.verify(message.metrics); - if (error) - return "metrics." + error; - } - return null; - }; - - /** - * Creates a ConfidenceLevelMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics} ConfidenceLevelMetrics - */ - ConfidenceLevelMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics(); - if (object.confidenceLevel != null) - message.confidenceLevel = Number(object.confidenceLevel); - if (object.metrics != null) { - if (typeof object.metrics !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.metrics: object expected"); - message.metrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.fromObject(object.metrics); - } - return message; - }; - - /** - * Creates a plain object from a ConfidenceLevelMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics} message ConfidenceLevelMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConfidenceLevelMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.confidenceLevel = 0; - object.metrics = null; - } - if (message.confidenceLevel != null && message.hasOwnProperty("confidenceLevel")) - object.confidenceLevel = options.json && !isFinite(message.confidenceLevel) ? String(message.confidenceLevel) : message.confidenceLevel; - if (message.metrics != null && message.hasOwnProperty("metrics")) - object.metrics = $root.google.cloud.documentai.v1beta3.Evaluation.Metrics.toObject(message.metrics, options); - return object; - }; - - /** - * Converts this ConfidenceLevelMetrics to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @instance - * @returns {Object.} JSON object - */ - ConfidenceLevelMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConfidenceLevelMetrics - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConfidenceLevelMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics"; - }; - - return ConfidenceLevelMetrics; - })(); - - Evaluation.MultiConfidenceMetrics = (function() { - - /** - * Properties of a MultiConfidenceMetrics. - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @interface IMultiConfidenceMetrics - * @property {Array.|null} [confidenceLevelMetrics] MultiConfidenceMetrics confidenceLevelMetrics - * @property {Array.|null} [confidenceLevelMetricsExact] MultiConfidenceMetrics confidenceLevelMetricsExact - * @property {number|null} [auprc] MultiConfidenceMetrics auprc - * @property {number|null} [estimatedCalibrationError] MultiConfidenceMetrics estimatedCalibrationError - * @property {number|null} [auprcExact] MultiConfidenceMetrics auprcExact - * @property {number|null} [estimatedCalibrationErrorExact] MultiConfidenceMetrics estimatedCalibrationErrorExact - * @property {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType|null} [metricsType] MultiConfidenceMetrics metricsType - */ - - /** - * Constructs a new MultiConfidenceMetrics. - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @classdesc Represents a MultiConfidenceMetrics. - * @implements IMultiConfidenceMetrics - * @constructor - * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics=} [properties] Properties to set - */ - function MultiConfidenceMetrics(properties) { - this.confidenceLevelMetrics = []; - this.confidenceLevelMetricsExact = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MultiConfidenceMetrics confidenceLevelMetrics. - * @member {Array.} confidenceLevelMetrics - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.confidenceLevelMetrics = $util.emptyArray; - - /** - * MultiConfidenceMetrics confidenceLevelMetricsExact. - * @member {Array.} confidenceLevelMetricsExact - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.confidenceLevelMetricsExact = $util.emptyArray; - - /** - * MultiConfidenceMetrics auprc. - * @member {number} auprc - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.auprc = 0; - - /** - * MultiConfidenceMetrics estimatedCalibrationError. - * @member {number} estimatedCalibrationError - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.estimatedCalibrationError = 0; - - /** - * MultiConfidenceMetrics auprcExact. - * @member {number} auprcExact - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.auprcExact = 0; - - /** - * MultiConfidenceMetrics estimatedCalibrationErrorExact. - * @member {number} estimatedCalibrationErrorExact - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.estimatedCalibrationErrorExact = 0; - - /** - * MultiConfidenceMetrics metricsType. - * @member {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType} metricsType - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @instance - */ - MultiConfidenceMetrics.prototype.metricsType = 0; - - /** - * Creates a new MultiConfidenceMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics instance - */ - MultiConfidenceMetrics.create = function create(properties) { - return new MultiConfidenceMetrics(properties); - }; - - /** - * Encodes the specified MultiConfidenceMetrics message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics} message MultiConfidenceMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiConfidenceMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.confidenceLevelMetrics != null && message.confidenceLevelMetrics.length) - for (var i = 0; i < message.confidenceLevelMetrics.length; ++i) - $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.encode(message.confidenceLevelMetrics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.auprc != null && Object.hasOwnProperty.call(message, "auprc")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.auprc); - if (message.estimatedCalibrationError != null && Object.hasOwnProperty.call(message, "estimatedCalibrationError")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.estimatedCalibrationError); - if (message.confidenceLevelMetricsExact != null && message.confidenceLevelMetricsExact.length) - for (var i = 0; i < message.confidenceLevelMetricsExact.length; ++i) - $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.encode(message.confidenceLevelMetricsExact[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.auprcExact != null && Object.hasOwnProperty.call(message, "auprcExact")) - writer.uint32(/* id 5, wireType 5 =*/45).float(message.auprcExact); - if (message.estimatedCalibrationErrorExact != null && Object.hasOwnProperty.call(message, "estimatedCalibrationErrorExact")) - writer.uint32(/* id 6, wireType 5 =*/53).float(message.estimatedCalibrationErrorExact); - if (message.metricsType != null && Object.hasOwnProperty.call(message, "metricsType")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.metricsType); - return writer; - }; - - /** - * Encodes the specified MultiConfidenceMetrics message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics} message MultiConfidenceMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MultiConfidenceMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MultiConfidenceMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiConfidenceMetrics.decode = function decode(reader, 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.v1beta3.Evaluation.MultiConfidenceMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.confidenceLevelMetrics && message.confidenceLevelMetrics.length)) - message.confidenceLevelMetrics = []; - message.confidenceLevelMetrics.push($root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.confidenceLevelMetricsExact && message.confidenceLevelMetricsExact.length)) - message.confidenceLevelMetricsExact = []; - message.confidenceLevelMetricsExact.push($root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.decode(reader, reader.uint32())); - break; - } - case 2: { - message.auprc = reader.float(); - break; - } - case 3: { - message.estimatedCalibrationError = reader.float(); - break; - } - case 5: { - message.auprcExact = reader.float(); - break; - } - case 6: { - message.estimatedCalibrationErrorExact = reader.float(); - break; - } - case 7: { - message.metricsType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MultiConfidenceMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MultiConfidenceMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MultiConfidenceMetrics message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MultiConfidenceMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.confidenceLevelMetrics != null && message.hasOwnProperty("confidenceLevelMetrics")) { - if (!Array.isArray(message.confidenceLevelMetrics)) - return "confidenceLevelMetrics: array expected"; - for (var i = 0; i < message.confidenceLevelMetrics.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.verify(message.confidenceLevelMetrics[i]); - if (error) - return "confidenceLevelMetrics." + error; - } - } - if (message.confidenceLevelMetricsExact != null && message.hasOwnProperty("confidenceLevelMetricsExact")) { - if (!Array.isArray(message.confidenceLevelMetricsExact)) - return "confidenceLevelMetricsExact: array expected"; - for (var i = 0; i < message.confidenceLevelMetricsExact.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.verify(message.confidenceLevelMetricsExact[i]); - if (error) - return "confidenceLevelMetricsExact." + error; - } - } - if (message.auprc != null && message.hasOwnProperty("auprc")) - if (typeof message.auprc !== "number") - return "auprc: number expected"; - if (message.estimatedCalibrationError != null && message.hasOwnProperty("estimatedCalibrationError")) - if (typeof message.estimatedCalibrationError !== "number") - return "estimatedCalibrationError: number expected"; - if (message.auprcExact != null && message.hasOwnProperty("auprcExact")) - if (typeof message.auprcExact !== "number") - return "auprcExact: number expected"; - if (message.estimatedCalibrationErrorExact != null && message.hasOwnProperty("estimatedCalibrationErrorExact")) - if (typeof message.estimatedCalibrationErrorExact !== "number") - return "estimatedCalibrationErrorExact: number expected"; - if (message.metricsType != null && message.hasOwnProperty("metricsType")) - switch (message.metricsType) { - default: - return "metricsType: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a MultiConfidenceMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} MultiConfidenceMetrics - */ - MultiConfidenceMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics(); - if (object.confidenceLevelMetrics) { - if (!Array.isArray(object.confidenceLevelMetrics)) - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.confidenceLevelMetrics: array expected"); - message.confidenceLevelMetrics = []; - for (var i = 0; i < object.confidenceLevelMetrics.length; ++i) { - if (typeof object.confidenceLevelMetrics[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.confidenceLevelMetrics: object expected"); - message.confidenceLevelMetrics[i] = $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.fromObject(object.confidenceLevelMetrics[i]); - } - } - if (object.confidenceLevelMetricsExact) { - if (!Array.isArray(object.confidenceLevelMetricsExact)) - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.confidenceLevelMetricsExact: array expected"); - message.confidenceLevelMetricsExact = []; - for (var i = 0; i < object.confidenceLevelMetricsExact.length; ++i) { - if (typeof object.confidenceLevelMetricsExact[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.confidenceLevelMetricsExact: object expected"); - message.confidenceLevelMetricsExact[i] = $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.fromObject(object.confidenceLevelMetricsExact[i]); - } - } - if (object.auprc != null) - message.auprc = Number(object.auprc); - if (object.estimatedCalibrationError != null) - message.estimatedCalibrationError = Number(object.estimatedCalibrationError); - if (object.auprcExact != null) - message.auprcExact = Number(object.auprcExact); - if (object.estimatedCalibrationErrorExact != null) - message.estimatedCalibrationErrorExact = Number(object.estimatedCalibrationErrorExact); - switch (object.metricsType) { - default: - if (typeof object.metricsType === "number") { - message.metricsType = object.metricsType; - break; - } - break; - case "METRICS_TYPE_UNSPECIFIED": - case 0: - message.metricsType = 0; - break; - case "AGGREGATE": - case 1: - message.metricsType = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a MultiConfidenceMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics} message MultiConfidenceMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MultiConfidenceMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.confidenceLevelMetrics = []; - object.confidenceLevelMetricsExact = []; - } - if (options.defaults) { - object.auprc = 0; - object.estimatedCalibrationError = 0; - object.auprcExact = 0; - object.estimatedCalibrationErrorExact = 0; - object.metricsType = options.enums === String ? "METRICS_TYPE_UNSPECIFIED" : 0; - } - if (message.confidenceLevelMetrics && message.confidenceLevelMetrics.length) { - object.confidenceLevelMetrics = []; - for (var j = 0; j < message.confidenceLevelMetrics.length; ++j) - object.confidenceLevelMetrics[j] = $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.toObject(message.confidenceLevelMetrics[j], options); - } - if (message.auprc != null && message.hasOwnProperty("auprc")) - object.auprc = options.json && !isFinite(message.auprc) ? String(message.auprc) : message.auprc; - if (message.estimatedCalibrationError != null && message.hasOwnProperty("estimatedCalibrationError")) - object.estimatedCalibrationError = options.json && !isFinite(message.estimatedCalibrationError) ? String(message.estimatedCalibrationError) : message.estimatedCalibrationError; - if (message.confidenceLevelMetricsExact && message.confidenceLevelMetricsExact.length) { - object.confidenceLevelMetricsExact = []; - for (var j = 0; j < message.confidenceLevelMetricsExact.length; ++j) - object.confidenceLevelMetricsExact[j] = $root.google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics.toObject(message.confidenceLevelMetricsExact[j], options); - } - if (message.auprcExact != null && message.hasOwnProperty("auprcExact")) - object.auprcExact = options.json && !isFinite(message.auprcExact) ? String(message.auprcExact) : message.auprcExact; - if (message.estimatedCalibrationErrorExact != null && message.hasOwnProperty("estimatedCalibrationErrorExact")) - object.estimatedCalibrationErrorExact = options.json && !isFinite(message.estimatedCalibrationErrorExact) ? String(message.estimatedCalibrationErrorExact) : message.estimatedCalibrationErrorExact; - if (message.metricsType != null && message.hasOwnProperty("metricsType")) - object.metricsType = options.enums === String ? $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType[message.metricsType] === undefined ? message.metricsType : $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType[message.metricsType] : message.metricsType; - return object; - }; - - /** - * Converts this MultiConfidenceMetrics to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @instance - * @returns {Object.} JSON object - */ - MultiConfidenceMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MultiConfidenceMetrics - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MultiConfidenceMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics"; - }; - - /** - * MetricsType enum. - * @name google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType - * @enum {number} - * @property {number} METRICS_TYPE_UNSPECIFIED=0 METRICS_TYPE_UNSPECIFIED value - * @property {number} AGGREGATE=1 AGGREGATE value - */ - MultiConfidenceMetrics.MetricsType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "METRICS_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "AGGREGATE"] = 1; - return values; - })(); - - return MultiConfidenceMetrics; - })(); - - Evaluation.EvaluationRevision = (function() { - - /** - * Properties of an EvaluationRevision. - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @interface IEvaluationRevision - * @property {string|null} [revisionId] EvaluationRevision revisionId - * @property {google.cloud.documentai.v1beta3.Evaluation.ICounters|null} [documentCounters] EvaluationRevision documentCounters - * @property {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null} [allEntitiesMetrics] EvaluationRevision allEntitiesMetrics - * @property {Object.|null} [entityMetrics] EvaluationRevision entityMetrics - */ - - /** - * Constructs a new EvaluationRevision. - * @memberof google.cloud.documentai.v1beta3.Evaluation - * @classdesc Represents an EvaluationRevision. - * @implements IEvaluationRevision - * @constructor - * @param {google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision=} [properties] Properties to set - */ - function EvaluationRevision(properties) { - this.entityMetrics = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EvaluationRevision revisionId. - * @member {string} revisionId - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @instance - */ - EvaluationRevision.prototype.revisionId = ""; - - /** - * EvaluationRevision documentCounters. - * @member {google.cloud.documentai.v1beta3.Evaluation.ICounters|null|undefined} documentCounters - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @instance - */ - EvaluationRevision.prototype.documentCounters = null; - - /** - * EvaluationRevision allEntitiesMetrics. - * @member {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null|undefined} allEntitiesMetrics - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @instance - */ - EvaluationRevision.prototype.allEntitiesMetrics = null; - - /** - * EvaluationRevision entityMetrics. - * @member {Object.} entityMetrics - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @instance - */ - EvaluationRevision.prototype.entityMetrics = $util.emptyObject; - - /** - * Creates a new EvaluationRevision instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} EvaluationRevision instance - */ - EvaluationRevision.create = function create(properties) { - return new EvaluationRevision(properties); - }; - - /** - * Encodes the specified EvaluationRevision message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision} message EvaluationRevision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationRevision.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.documentCounters != null && Object.hasOwnProperty.call(message, "documentCounters")) - $root.google.cloud.documentai.v1beta3.Evaluation.Counters.encode(message.documentCounters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.allEntitiesMetrics != null && Object.hasOwnProperty.call(message, "allEntitiesMetrics")) - $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.encode(message.allEntitiesMetrics, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.entityMetrics != null && Object.hasOwnProperty.call(message, "entityMetrics")) - for (var keys = Object.keys(message.entityMetrics), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.encode(message.entityMetrics[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified EvaluationRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision} message EvaluationRevision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EvaluationRevision.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EvaluationRevision message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} EvaluationRevision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationRevision.decode = function decode(reader, 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.v1beta3.Evaluation.EvaluationRevision(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.revisionId = reader.string(); - break; - } - case 2: { - message.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.decode(reader, reader.uint32()); - break; - } - case 3: { - message.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); - break; - } - case 4: { - if (message.entityMetrics === $util.emptyObject) - message.entityMetrics = {}; - 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.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.entityMetrics[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EvaluationRevision message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} EvaluationRevision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EvaluationRevision.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EvaluationRevision message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EvaluationRevision.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.documentCounters != null && message.hasOwnProperty("documentCounters")) { - var error = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.verify(message.documentCounters); - if (error) - return "documentCounters." + error; - } - if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) { - var error = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify(message.allEntitiesMetrics); - if (error) - return "allEntitiesMetrics." + error; - } - if (message.entityMetrics != null && message.hasOwnProperty("entityMetrics")) { - if (!$util.isObject(message.entityMetrics)) - return "entityMetrics: object expected"; - var key = Object.keys(message.entityMetrics); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify(message.entityMetrics[key[i]]); - if (error) - return "entityMetrics." + error; - } - } - return null; - }; - - /** - * Creates an EvaluationRevision message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} EvaluationRevision - */ - EvaluationRevision.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision(); - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - if (object.documentCounters != null) { - if (typeof object.documentCounters !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.documentCounters: object expected"); - message.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.fromObject(object.documentCounters); - } - if (object.allEntitiesMetrics != null) { - if (typeof object.allEntitiesMetrics !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.allEntitiesMetrics: object expected"); - message.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.fromObject(object.allEntitiesMetrics); - } - if (object.entityMetrics) { - if (typeof object.entityMetrics !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.entityMetrics: object expected"); - message.entityMetrics = {}; - for (var keys = Object.keys(object.entityMetrics), i = 0; i < keys.length; ++i) { - if (typeof object.entityMetrics[keys[i]] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.entityMetrics: object expected"); - message.entityMetrics[keys[i]] = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.fromObject(object.entityMetrics[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from an EvaluationRevision message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @static - * @param {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} message EvaluationRevision - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EvaluationRevision.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.entityMetrics = {}; - if (options.defaults) { - object.revisionId = ""; - object.documentCounters = null; - object.allEntitiesMetrics = null; - } - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - object.revisionId = message.revisionId; - if (message.documentCounters != null && message.hasOwnProperty("documentCounters")) - object.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.toObject(message.documentCounters, options); - if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) - object.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.toObject(message.allEntitiesMetrics, options); - var keys2; - if (message.entityMetrics && (keys2 = Object.keys(message.entityMetrics)).length) { - object.entityMetrics = {}; - for (var j = 0; j < keys2.length; ++j) - object.entityMetrics[keys2[j]] = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.toObject(message.entityMetrics[keys2[j]], options); - } - return object; - }; - - /** - * Converts this EvaluationRevision to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @instance - * @returns {Object.} JSON object - */ - EvaluationRevision.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EvaluationRevision - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EvaluationRevision.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision"; - }; - - return EvaluationRevision; - })(); - - return Evaluation; - })(); - - v1beta3.CommonOperationMetadata = (function() { - - /** - * Properties of a CommonOperationMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface ICommonOperationMetadata - * @property {google.cloud.documentai.v1beta3.CommonOperationMetadata.State|null} [state] CommonOperationMetadata state - * @property {string|null} [stateMessage] CommonOperationMetadata stateMessage - * @property {string|null} [resource] CommonOperationMetadata resource - * @property {google.protobuf.ITimestamp|null} [createTime] CommonOperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] CommonOperationMetadata updateTime - */ - - /** - * Constructs a new CommonOperationMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a CommonOperationMetadata. - * @implements ICommonOperationMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.ICommonOperationMetadata=} [properties] Properties to set - */ - function CommonOperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonOperationMetadata state. - * @member {google.cloud.documentai.v1beta3.CommonOperationMetadata.State} state - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @instance - */ - CommonOperationMetadata.prototype.state = 0; - - /** - * CommonOperationMetadata stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @instance - */ - CommonOperationMetadata.prototype.stateMessage = ""; - - /** - * CommonOperationMetadata resource. - * @member {string} resource - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @instance - */ - CommonOperationMetadata.prototype.resource = ""; - - /** - * CommonOperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @instance - */ - CommonOperationMetadata.prototype.createTime = null; - - /** - * CommonOperationMetadata updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @instance - */ - CommonOperationMetadata.prototype.updateTime = null; - - /** - * Creates a new CommonOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @static - * @param {google.cloud.documentai.v1beta3.ICommonOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.CommonOperationMetadata} CommonOperationMetadata instance - */ - CommonOperationMetadata.create = function create(properties) { - return new CommonOperationMetadata(properties); - }; - - /** - * Encodes the specified CommonOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.CommonOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @static - * @param {google.cloud.documentai.v1beta3.ICommonOperationMetadata} message CommonOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); - 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.resource); - return writer; - }; - - /** - * Encodes the specified CommonOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.CommonOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @static - * @param {google.cloud.documentai.v1beta3.ICommonOperationMetadata} message CommonOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.CommonOperationMetadata} CommonOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonOperationMetadata.decode = function decode(reader, 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.v1beta3.CommonOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.stateMessage = reader.string(); - break; - } - case 5: { - message.resource = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CommonOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.CommonOperationMetadata} CommonOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonOperationMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - return null; - }; - - /** - * Creates a CommonOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.CommonOperationMetadata} CommonOperationMetadata - */ - CommonOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.CommonOperationMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.CommonOperationMetadata(); - 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 "RUNNING": - case 1: - message.state = 1; - break; - case "CANCELLING": - case 2: - message.state = 2; - break; - case "SUCCEEDED": - case 3: - message.state = 3; - break; - case "FAILED": - case 4: - message.state = 4; - break; - case "CANCELLED": - case 5: - message.state = 5; - break; - } - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.resource != null) - message.resource = String(object.resource); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.CommonOperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.CommonOperationMetadata.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - return message; - }; - - /** - * Creates a plain object from a CommonOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @static - * @param {google.cloud.documentai.v1beta3.CommonOperationMetadata} message CommonOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; - object.createTime = null; - object.updateTime = null; - object.resource = ""; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.State[message.state] : message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - return object; - }; - - /** - * Converts this CommonOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - CommonOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.CommonOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.CommonOperationMetadata"; - }; - - /** - * State enum. - * @name google.cloud.documentai.v1beta3.CommonOperationMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} CANCELLING=2 CANCELLING value - * @property {number} SUCCEEDED=3 SUCCEEDED value - * @property {number} FAILED=4 FAILED value - * @property {number} CANCELLED=5 CANCELLED value - */ - CommonOperationMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "CANCELLING"] = 2; - values[valuesById[3] = "SUCCEEDED"] = 3; - values[valuesById[4] = "FAILED"] = 4; - values[valuesById[5] = "CANCELLED"] = 5; - return values; - })(); - - return CommonOperationMetadata; - })(); - - v1beta3.ProcessorVersion = (function() { - - /** - * Properties of a ProcessorVersion. - * @memberof google.cloud.documentai.v1beta3 - * @interface IProcessorVersion - * @property {string|null} [name] ProcessorVersion name - * @property {string|null} [displayName] ProcessorVersion displayName - * @property {google.cloud.documentai.v1beta3.IDocumentSchema|null} [documentSchema] ProcessorVersion documentSchema - * @property {google.cloud.documentai.v1beta3.ProcessorVersion.State|null} [state] ProcessorVersion state - * @property {google.protobuf.ITimestamp|null} [createTime] ProcessorVersion createTime - * @property {google.cloud.documentai.v1beta3.IEvaluationReference|null} [latestEvaluation] ProcessorVersion latestEvaluation - * @property {string|null} [kmsKeyName] ProcessorVersion kmsKeyName - * @property {string|null} [kmsKeyVersionName] ProcessorVersion kmsKeyVersionName - * @property {boolean|null} [googleManaged] ProcessorVersion googleManaged - * @property {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo|null} [deprecationInfo] ProcessorVersion deprecationInfo - * @property {google.cloud.documentai.v1beta3.ProcessorVersion.ModelType|null} [modelType] ProcessorVersion modelType - * @property {boolean|null} [satisfiesPzs] ProcessorVersion satisfiesPzs - * @property {boolean|null} [satisfiesPzi] ProcessorVersion satisfiesPzi - * @property {google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo|null} [genAiModelInfo] ProcessorVersion genAiModelInfo - */ - - /** - * Constructs a new ProcessorVersion. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ProcessorVersion. - * @implements IProcessorVersion - * @constructor - * @param {google.cloud.documentai.v1beta3.IProcessorVersion=} [properties] Properties to set - */ - function ProcessorVersion(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProcessorVersion name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.name = ""; - - /** - * ProcessorVersion displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.displayName = ""; - - /** - * ProcessorVersion documentSchema. - * @member {google.cloud.documentai.v1beta3.IDocumentSchema|null|undefined} documentSchema - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.documentSchema = null; - - /** - * ProcessorVersion state. - * @member {google.cloud.documentai.v1beta3.ProcessorVersion.State} state - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.state = 0; - - /** - * ProcessorVersion createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.createTime = null; - - /** - * ProcessorVersion latestEvaluation. - * @member {google.cloud.documentai.v1beta3.IEvaluationReference|null|undefined} latestEvaluation - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.latestEvaluation = null; - - /** - * ProcessorVersion kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.kmsKeyName = ""; - - /** - * ProcessorVersion kmsKeyVersionName. - * @member {string} kmsKeyVersionName - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.kmsKeyVersionName = ""; - - /** - * ProcessorVersion googleManaged. - * @member {boolean} googleManaged - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.googleManaged = false; - - /** - * ProcessorVersion deprecationInfo. - * @member {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo|null|undefined} deprecationInfo - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.deprecationInfo = null; - - /** - * ProcessorVersion modelType. - * @member {google.cloud.documentai.v1beta3.ProcessorVersion.ModelType} modelType - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.modelType = 0; - - /** - * ProcessorVersion satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.satisfiesPzs = false; - - /** - * ProcessorVersion satisfiesPzi. - * @member {boolean} satisfiesPzi - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.satisfiesPzi = false; - - /** - * ProcessorVersion genAiModelInfo. - * @member {google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo|null|undefined} genAiModelInfo - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - */ - ProcessorVersion.prototype.genAiModelInfo = null; - - /** - * Creates a new ProcessorVersion instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @static - * @param {google.cloud.documentai.v1beta3.IProcessorVersion=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion} ProcessorVersion instance - */ - ProcessorVersion.create = function create(properties) { - return new ProcessorVersion(properties); - }; - - /** - * Encodes the specified ProcessorVersion message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @static - * @param {google.cloud.documentai.v1beta3.IProcessorVersion} message ProcessorVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorVersion.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.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.latestEvaluation != null && Object.hasOwnProperty.call(message, "latestEvaluation")) - $root.google.cloud.documentai.v1beta3.EvaluationReference.encode(message.latestEvaluation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.kmsKeyName); - if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.kmsKeyVersionName); - if (message.googleManaged != null && Object.hasOwnProperty.call(message, "googleManaged")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.googleManaged); - if (message.documentSchema != null && Object.hasOwnProperty.call(message, "documentSchema")) - $root.google.cloud.documentai.v1beta3.DocumentSchema.encode(message.documentSchema, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.deprecationInfo != null && Object.hasOwnProperty.call(message, "deprecationInfo")) - $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.encode(message.deprecationInfo, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.modelType); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.satisfiesPzs); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.satisfiesPzi); - if (message.genAiModelInfo != null && Object.hasOwnProperty.call(message, "genAiModelInfo")) - $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.encode(message.genAiModelInfo, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ProcessorVersion message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @static - * @param {google.cloud.documentai.v1beta3.IProcessorVersion} message ProcessorVersion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorVersion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessorVersion message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion} ProcessorVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorVersion.decode = function decode(reader, 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.v1beta3.ProcessorVersion(); - 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 12: { - message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.decode(reader, reader.uint32()); - break; - } - case 6: { - message.state = reader.int32(); - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.latestEvaluation = $root.google.cloud.documentai.v1beta3.EvaluationReference.decode(reader, reader.uint32()); - break; - } - case 9: { - message.kmsKeyName = reader.string(); - break; - } - case 10: { - message.kmsKeyVersionName = reader.string(); - break; - } - case 11: { - message.googleManaged = reader.bool(); - break; - } - case 13: { - message.deprecationInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.decode(reader, reader.uint32()); - break; - } - case 15: { - message.modelType = reader.int32(); - break; - } - case 16: { - message.satisfiesPzs = reader.bool(); - break; - } - case 17: { - message.satisfiesPzi = reader.bool(); - break; - } - case 18: { - message.genAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessorVersion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion} ProcessorVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorVersion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessorVersion message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessorVersion.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.documentSchema != null && message.hasOwnProperty("documentSchema")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentSchema.verify(message.documentSchema); - if (error) - return "documentSchema." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.latestEvaluation != null && message.hasOwnProperty("latestEvaluation")) { - var error = $root.google.cloud.documentai.v1beta3.EvaluationReference.verify(message.latestEvaluation); - if (error) - return "latestEvaluation." + error; - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) - if (!$util.isString(message.kmsKeyVersionName)) - return "kmsKeyVersionName: string expected"; - if (message.googleManaged != null && message.hasOwnProperty("googleManaged")) - if (typeof message.googleManaged !== "boolean") - return "googleManaged: boolean expected"; - if (message.deprecationInfo != null && message.hasOwnProperty("deprecationInfo")) { - var error = $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.verify(message.deprecationInfo); - if (error) - return "deprecationInfo." + error; - } - if (message.modelType != null && message.hasOwnProperty("modelType")) - switch (message.modelType) { - default: - return "modelType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; - if (message.genAiModelInfo != null && message.hasOwnProperty("genAiModelInfo")) { - var error = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.verify(message.genAiModelInfo); - if (error) - return "genAiModelInfo." + error; - } - return null; - }; - - /** - * Creates a ProcessorVersion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion} ProcessorVersion - */ - ProcessorVersion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersion) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.documentSchema != null) { - if (typeof object.documentSchema !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.documentSchema: object expected"); - message.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.fromObject(object.documentSchema); - } - 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 "DEPLOYED": - case 1: - message.state = 1; - break; - case "DEPLOYING": - case 2: - message.state = 2; - break; - case "UNDEPLOYED": - case 3: - message.state = 3; - break; - case "UNDEPLOYING": - case 4: - message.state = 4; - break; - case "CREATING": - case 5: - message.state = 5; - break; - case "DELETING": - case 6: - message.state = 6; - break; - case "FAILED": - case 7: - message.state = 7; - break; - case "IMPORTING": - case 8: - message.state = 8; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.latestEvaluation != null) { - if (typeof object.latestEvaluation !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.latestEvaluation: object expected"); - message.latestEvaluation = $root.google.cloud.documentai.v1beta3.EvaluationReference.fromObject(object.latestEvaluation); - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyVersionName != null) - message.kmsKeyVersionName = String(object.kmsKeyVersionName); - if (object.googleManaged != null) - message.googleManaged = Boolean(object.googleManaged); - if (object.deprecationInfo != null) { - if (typeof object.deprecationInfo !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.deprecationInfo: object expected"); - message.deprecationInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.fromObject(object.deprecationInfo); - } - switch (object.modelType) { - default: - if (typeof object.modelType === "number") { - message.modelType = object.modelType; - break; - } - break; - case "MODEL_TYPE_UNSPECIFIED": - case 0: - message.modelType = 0; - break; - case "MODEL_TYPE_GENERATIVE": - case 1: - message.modelType = 1; - break; - case "MODEL_TYPE_CUSTOM": - case 2: - message.modelType = 2; - break; - } - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); - if (object.genAiModelInfo != null) { - if (typeof object.genAiModelInfo !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.genAiModelInfo: object expected"); - message.genAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.fromObject(object.genAiModelInfo); - } - return message; - }; - - /** - * Creates a plain object from a ProcessorVersion message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion} message ProcessorVersion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessorVersion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.latestEvaluation = null; - object.kmsKeyName = ""; - object.kmsKeyVersionName = ""; - object.googleManaged = false; - object.documentSchema = null; - object.deprecationInfo = null; - object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; - object.satisfiesPzs = false; - object.satisfiesPzi = false; - object.genAiModelInfo = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.ProcessorVersion.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.ProcessorVersion.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.latestEvaluation != null && message.hasOwnProperty("latestEvaluation")) - object.latestEvaluation = $root.google.cloud.documentai.v1beta3.EvaluationReference.toObject(message.latestEvaluation, options); - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) - object.kmsKeyVersionName = message.kmsKeyVersionName; - if (message.googleManaged != null && message.hasOwnProperty("googleManaged")) - object.googleManaged = message.googleManaged; - if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) - object.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.toObject(message.documentSchema, options); - if (message.deprecationInfo != null && message.hasOwnProperty("deprecationInfo")) - object.deprecationInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.toObject(message.deprecationInfo, options); - if (message.modelType != null && message.hasOwnProperty("modelType")) - object.modelType = options.enums === String ? $root.google.cloud.documentai.v1beta3.ProcessorVersion.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.documentai.v1beta3.ProcessorVersion.ModelType[message.modelType] : message.modelType; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; - if (message.genAiModelInfo != null && message.hasOwnProperty("genAiModelInfo")) - object.genAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.toObject(message.genAiModelInfo, options); - return object; - }; - - /** - * Converts this ProcessorVersion to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @instance - * @returns {Object.} JSON object - */ - ProcessorVersion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessorVersion - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessorVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion"; - }; - - ProcessorVersion.DeprecationInfo = (function() { - - /** - * Properties of a DeprecationInfo. - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @interface IDeprecationInfo - * @property {google.protobuf.ITimestamp|null} [deprecationTime] DeprecationInfo deprecationTime - * @property {string|null} [replacementProcessorVersion] DeprecationInfo replacementProcessorVersion - */ - - /** - * Constructs a new DeprecationInfo. - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @classdesc Represents a DeprecationInfo. - * @implements IDeprecationInfo - * @constructor - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo=} [properties] Properties to set - */ - function DeprecationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeprecationInfo deprecationTime. - * @member {google.protobuf.ITimestamp|null|undefined} deprecationTime - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo - * @instance - */ - DeprecationInfo.prototype.deprecationTime = null; - - /** - * DeprecationInfo replacementProcessorVersion. - * @member {string} replacementProcessorVersion - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo - * @instance - */ - DeprecationInfo.prototype.replacementProcessorVersion = ""; - - /** - * Creates a new DeprecationInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo instance - */ - DeprecationInfo.create = function create(properties) { - return new DeprecationInfo(properties); - }; - - /** - * Encodes the specified DeprecationInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo} message DeprecationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeprecationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecationTime != null && Object.hasOwnProperty.call(message, "deprecationTime")) - $root.google.protobuf.Timestamp.encode(message.deprecationTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.replacementProcessorVersion != null && Object.hasOwnProperty.call(message, "replacementProcessorVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.replacementProcessorVersion); - return writer; - }; - - /** - * Encodes the specified DeprecationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IDeprecationInfo} message DeprecationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeprecationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeprecationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeprecationInfo.decode = function decode(reader, 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.v1beta3.ProcessorVersion.DeprecationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.replacementProcessorVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeprecationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeprecationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeprecationInfo message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeprecationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecationTime != null && message.hasOwnProperty("deprecationTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deprecationTime); - if (error) - return "deprecationTime." + error; - } - if (message.replacementProcessorVersion != null && message.hasOwnProperty("replacementProcessorVersion")) - if (!$util.isString(message.replacementProcessorVersion)) - return "replacementProcessorVersion: string expected"; - return null; - }; - - /** - * Creates a DeprecationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} DeprecationInfo - */ - DeprecationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo(); - if (object.deprecationTime != null) { - if (typeof object.deprecationTime !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo.deprecationTime: object expected"); - message.deprecationTime = $root.google.protobuf.Timestamp.fromObject(object.deprecationTime); - } - if (object.replacementProcessorVersion != null) - message.replacementProcessorVersion = String(object.replacementProcessorVersion); - return message; - }; - - /** - * Creates a plain object from a DeprecationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo} message DeprecationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeprecationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.deprecationTime = null; - object.replacementProcessorVersion = ""; - } - if (message.deprecationTime != null && message.hasOwnProperty("deprecationTime")) - object.deprecationTime = $root.google.protobuf.Timestamp.toObject(message.deprecationTime, options); - if (message.replacementProcessorVersion != null && message.hasOwnProperty("replacementProcessorVersion")) - object.replacementProcessorVersion = message.replacementProcessorVersion; - return object; - }; - - /** - * Converts this DeprecationInfo to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo - * @instance - * @returns {Object.} JSON object - */ - DeprecationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeprecationInfo - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeprecationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion.DeprecationInfo"; - }; - - return DeprecationInfo; - })(); - - ProcessorVersion.GenAiModelInfo = (function() { - - /** - * Properties of a GenAiModelInfo. - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @interface IGenAiModelInfo - * @property {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null} [foundationGenAiModelInfo] GenAiModelInfo foundationGenAiModelInfo - * @property {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null} [customGenAiModelInfo] GenAiModelInfo customGenAiModelInfo - */ - - /** - * Constructs a new GenAiModelInfo. - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion - * @classdesc Represents a GenAiModelInfo. - * @implements IGenAiModelInfo - * @constructor - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo=} [properties] Properties to set - */ - function GenAiModelInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GenAiModelInfo foundationGenAiModelInfo. - * @member {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo|null|undefined} foundationGenAiModelInfo - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @instance - */ - GenAiModelInfo.prototype.foundationGenAiModelInfo = null; - - /** - * GenAiModelInfo customGenAiModelInfo. - * @member {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo|null|undefined} customGenAiModelInfo - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @instance - */ - GenAiModelInfo.prototype.customGenAiModelInfo = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GenAiModelInfo modelInfo. - * @member {"foundationGenAiModelInfo"|"customGenAiModelInfo"|undefined} modelInfo - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @instance - */ - Object.defineProperty(GenAiModelInfo.prototype, "modelInfo", { - get: $util.oneOfGetter($oneOfFields = ["foundationGenAiModelInfo", "customGenAiModelInfo"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GenAiModelInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo} GenAiModelInfo instance - */ - GenAiModelInfo.create = function create(properties) { - return new GenAiModelInfo(properties); - }; - - /** - * Encodes the specified GenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo} message GenAiModelInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenAiModelInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.foundationGenAiModelInfo != null && Object.hasOwnProperty.call(message, "foundationGenAiModelInfo")) - $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.encode(message.foundationGenAiModelInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.customGenAiModelInfo != null && Object.hasOwnProperty.call(message, "customGenAiModelInfo")) - $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.encode(message.customGenAiModelInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.IGenAiModelInfo} message GenAiModelInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GenAiModelInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GenAiModelInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo} GenAiModelInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenAiModelInfo.decode = function decode(reader, 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.v1beta3.ProcessorVersion.GenAiModelInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.foundationGenAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.decode(reader, reader.uint32()); - break; - } - case 2: { - message.customGenAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GenAiModelInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo} GenAiModelInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GenAiModelInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GenAiModelInfo message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GenAiModelInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.foundationGenAiModelInfo != null && message.hasOwnProperty("foundationGenAiModelInfo")) { - properties.modelInfo = 1; - { - var error = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify(message.foundationGenAiModelInfo); - if (error) - return "foundationGenAiModelInfo." + error; - } - } - if (message.customGenAiModelInfo != null && message.hasOwnProperty("customGenAiModelInfo")) { - if (properties.modelInfo === 1) - return "modelInfo: multiple values"; - properties.modelInfo = 1; - { - var error = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify(message.customGenAiModelInfo); - if (error) - return "customGenAiModelInfo." + error; - } - } - return null; - }; - - /** - * Creates a GenAiModelInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo} GenAiModelInfo - */ - GenAiModelInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo(); - if (object.foundationGenAiModelInfo != null) { - if (typeof object.foundationGenAiModelInfo !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.foundationGenAiModelInfo: object expected"); - message.foundationGenAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.fromObject(object.foundationGenAiModelInfo); - } - if (object.customGenAiModelInfo != null) { - if (typeof object.customGenAiModelInfo !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.customGenAiModelInfo: object expected"); - message.customGenAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.fromObject(object.customGenAiModelInfo); - } - return message; - }; - - /** - * Creates a plain object from a GenAiModelInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo} message GenAiModelInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GenAiModelInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.foundationGenAiModelInfo != null && message.hasOwnProperty("foundationGenAiModelInfo")) { - object.foundationGenAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.toObject(message.foundationGenAiModelInfo, options); - if (options.oneofs) - object.modelInfo = "foundationGenAiModelInfo"; - } - if (message.customGenAiModelInfo != null && message.hasOwnProperty("customGenAiModelInfo")) { - object.customGenAiModelInfo = $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.toObject(message.customGenAiModelInfo, options); - if (options.oneofs) - object.modelInfo = "customGenAiModelInfo"; - } - return object; - }; - - /** - * Converts this GenAiModelInfo to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @instance - * @returns {Object.} JSON object - */ - GenAiModelInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GenAiModelInfo - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GenAiModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo"; - }; - - GenAiModelInfo.FoundationGenAiModelInfo = (function() { - - /** - * Properties of a FoundationGenAiModelInfo. - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @interface IFoundationGenAiModelInfo - * @property {boolean|null} [finetuningAllowed] FoundationGenAiModelInfo finetuningAllowed - * @property {number|null} [minTrainLabeledDocuments] FoundationGenAiModelInfo minTrainLabeledDocuments - */ - - /** - * Constructs a new FoundationGenAiModelInfo. - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @classdesc Represents a FoundationGenAiModelInfo. - * @implements IFoundationGenAiModelInfo - * @constructor - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo=} [properties] Properties to set - */ - function FoundationGenAiModelInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FoundationGenAiModelInfo finetuningAllowed. - * @member {boolean} finetuningAllowed - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @instance - */ - FoundationGenAiModelInfo.prototype.finetuningAllowed = false; - - /** - * FoundationGenAiModelInfo minTrainLabeledDocuments. - * @member {number} minTrainLabeledDocuments - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @instance - */ - FoundationGenAiModelInfo.prototype.minTrainLabeledDocuments = 0; - - /** - * Creates a new FoundationGenAiModelInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo instance - */ - FoundationGenAiModelInfo.create = function create(properties) { - return new FoundationGenAiModelInfo(properties); - }; - - /** - * Encodes the specified FoundationGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo} message FoundationGenAiModelInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FoundationGenAiModelInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.finetuningAllowed != null && Object.hasOwnProperty.call(message, "finetuningAllowed")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.finetuningAllowed); - if (message.minTrainLabeledDocuments != null && Object.hasOwnProperty.call(message, "minTrainLabeledDocuments")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minTrainLabeledDocuments); - return writer; - }; - - /** - * Encodes the specified FoundationGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.IFoundationGenAiModelInfo} message FoundationGenAiModelInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FoundationGenAiModelInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FoundationGenAiModelInfo.decode = function decode(reader, 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.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.finetuningAllowed = reader.bool(); - break; - } - case 2: { - message.minTrainLabeledDocuments = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FoundationGenAiModelInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FoundationGenAiModelInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FoundationGenAiModelInfo message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FoundationGenAiModelInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.finetuningAllowed != null && message.hasOwnProperty("finetuningAllowed")) - if (typeof message.finetuningAllowed !== "boolean") - return "finetuningAllowed: boolean expected"; - if (message.minTrainLabeledDocuments != null && message.hasOwnProperty("minTrainLabeledDocuments")) - if (!$util.isInteger(message.minTrainLabeledDocuments)) - return "minTrainLabeledDocuments: integer expected"; - return null; - }; - - /** - * Creates a FoundationGenAiModelInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} FoundationGenAiModelInfo - */ - FoundationGenAiModelInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo(); - if (object.finetuningAllowed != null) - message.finetuningAllowed = Boolean(object.finetuningAllowed); - if (object.minTrainLabeledDocuments != null) - message.minTrainLabeledDocuments = object.minTrainLabeledDocuments | 0; - return message; - }; - - /** - * Creates a plain object from a FoundationGenAiModelInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo} message FoundationGenAiModelInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FoundationGenAiModelInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.finetuningAllowed = false; - object.minTrainLabeledDocuments = 0; - } - if (message.finetuningAllowed != null && message.hasOwnProperty("finetuningAllowed")) - object.finetuningAllowed = message.finetuningAllowed; - if (message.minTrainLabeledDocuments != null && message.hasOwnProperty("minTrainLabeledDocuments")) - object.minTrainLabeledDocuments = message.minTrainLabeledDocuments; - return object; - }; - - /** - * Converts this FoundationGenAiModelInfo to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @instance - * @returns {Object.} JSON object - */ - FoundationGenAiModelInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FoundationGenAiModelInfo - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FoundationGenAiModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.FoundationGenAiModelInfo"; - }; - - return FoundationGenAiModelInfo; - })(); - - GenAiModelInfo.CustomGenAiModelInfo = (function() { - - /** - * Properties of a CustomGenAiModelInfo. - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @interface ICustomGenAiModelInfo - * @property {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType|null} [customModelType] CustomGenAiModelInfo customModelType - * @property {string|null} [baseProcessorVersionId] CustomGenAiModelInfo baseProcessorVersionId - */ - - /** - * Constructs a new CustomGenAiModelInfo. - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo - * @classdesc Represents a CustomGenAiModelInfo. - * @implements ICustomGenAiModelInfo - * @constructor - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo=} [properties] Properties to set - */ - function CustomGenAiModelInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomGenAiModelInfo customModelType. - * @member {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType} customModelType - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @instance - */ - CustomGenAiModelInfo.prototype.customModelType = 0; - - /** - * CustomGenAiModelInfo baseProcessorVersionId. - * @member {string} baseProcessorVersionId - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @instance - */ - CustomGenAiModelInfo.prototype.baseProcessorVersionId = ""; - - /** - * Creates a new CustomGenAiModelInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo instance - */ - CustomGenAiModelInfo.create = function create(properties) { - return new CustomGenAiModelInfo(properties); - }; - - /** - * Encodes the specified CustomGenAiModelInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo} message CustomGenAiModelInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomGenAiModelInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.customModelType != null && Object.hasOwnProperty.call(message, "customModelType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.customModelType); - if (message.baseProcessorVersionId != null && Object.hasOwnProperty.call(message, "baseProcessorVersionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseProcessorVersionId); - return writer; - }; - - /** - * Encodes the specified CustomGenAiModelInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.ICustomGenAiModelInfo} message CustomGenAiModelInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomGenAiModelInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomGenAiModelInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomGenAiModelInfo.decode = function decode(reader, 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.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.customModelType = reader.int32(); - break; - } - case 2: { - message.baseProcessorVersionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomGenAiModelInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomGenAiModelInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomGenAiModelInfo message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomGenAiModelInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.customModelType != null && message.hasOwnProperty("customModelType")) - switch (message.customModelType) { - default: - return "customModelType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.baseProcessorVersionId != null && message.hasOwnProperty("baseProcessorVersionId")) - if (!$util.isString(message.baseProcessorVersionId)) - return "baseProcessorVersionId: string expected"; - return null; - }; - - /** - * Creates a CustomGenAiModelInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} CustomGenAiModelInfo - */ - CustomGenAiModelInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo(); - switch (object.customModelType) { - default: - if (typeof object.customModelType === "number") { - message.customModelType = object.customModelType; - break; - } - break; - case "CUSTOM_MODEL_TYPE_UNSPECIFIED": - case 0: - message.customModelType = 0; - break; - case "VERSIONED_FOUNDATION": - case 1: - message.customModelType = 1; - break; - case "FINE_TUNED": - case 2: - message.customModelType = 2; - break; - } - if (object.baseProcessorVersionId != null) - message.baseProcessorVersionId = String(object.baseProcessorVersionId); - return message; - }; - - /** - * Creates a plain object from a CustomGenAiModelInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo} message CustomGenAiModelInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomGenAiModelInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.customModelType = options.enums === String ? "CUSTOM_MODEL_TYPE_UNSPECIFIED" : 0; - object.baseProcessorVersionId = ""; - } - if (message.customModelType != null && message.hasOwnProperty("customModelType")) - object.customModelType = options.enums === String ? $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType[message.customModelType] === undefined ? message.customModelType : $root.google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType[message.customModelType] : message.customModelType; - if (message.baseProcessorVersionId != null && message.hasOwnProperty("baseProcessorVersionId")) - object.baseProcessorVersionId = message.baseProcessorVersionId; - return object; - }; - - /** - * Converts this CustomGenAiModelInfo to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @instance - * @returns {Object.} JSON object - */ - CustomGenAiModelInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomGenAiModelInfo - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomGenAiModelInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo"; - }; - - /** - * CustomModelType enum. - * @name google.cloud.documentai.v1beta3.ProcessorVersion.GenAiModelInfo.CustomGenAiModelInfo.CustomModelType - * @enum {number} - * @property {number} CUSTOM_MODEL_TYPE_UNSPECIFIED=0 CUSTOM_MODEL_TYPE_UNSPECIFIED value - * @property {number} VERSIONED_FOUNDATION=1 VERSIONED_FOUNDATION value - * @property {number} FINE_TUNED=2 FINE_TUNED value - */ - CustomGenAiModelInfo.CustomModelType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CUSTOM_MODEL_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "VERSIONED_FOUNDATION"] = 1; - values[valuesById[2] = "FINE_TUNED"] = 2; - return values; - })(); - - return CustomGenAiModelInfo; - })(); - - return GenAiModelInfo; - })(); - - /** - * State enum. - * @name google.cloud.documentai.v1beta3.ProcessorVersion.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} DEPLOYED=1 DEPLOYED value - * @property {number} DEPLOYING=2 DEPLOYING value - * @property {number} UNDEPLOYED=3 UNDEPLOYED value - * @property {number} UNDEPLOYING=4 UNDEPLOYING value - * @property {number} CREATING=5 CREATING value - * @property {number} DELETING=6 DELETING value - * @property {number} FAILED=7 FAILED value - * @property {number} IMPORTING=8 IMPORTING value - */ - ProcessorVersion.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DEPLOYED"] = 1; - values[valuesById[2] = "DEPLOYING"] = 2; - values[valuesById[3] = "UNDEPLOYED"] = 3; - values[valuesById[4] = "UNDEPLOYING"] = 4; - values[valuesById[5] = "CREATING"] = 5; - values[valuesById[6] = "DELETING"] = 6; - values[valuesById[7] = "FAILED"] = 7; - values[valuesById[8] = "IMPORTING"] = 8; - return values; - })(); - - /** - * ModelType enum. - * @name google.cloud.documentai.v1beta3.ProcessorVersion.ModelType - * @enum {number} - * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value - * @property {number} MODEL_TYPE_GENERATIVE=1 MODEL_TYPE_GENERATIVE value - * @property {number} MODEL_TYPE_CUSTOM=2 MODEL_TYPE_CUSTOM value - */ - ProcessorVersion.ModelType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "MODEL_TYPE_GENERATIVE"] = 1; - values[valuesById[2] = "MODEL_TYPE_CUSTOM"] = 2; - return values; - })(); - - return ProcessorVersion; - })(); - - v1beta3.ProcessorVersionAlias = (function() { - - /** - * Properties of a ProcessorVersionAlias. - * @memberof google.cloud.documentai.v1beta3 - * @interface IProcessorVersionAlias - * @property {string|null} [alias] ProcessorVersionAlias alias - * @property {string|null} [processorVersion] ProcessorVersionAlias processorVersion - */ - - /** - * Constructs a new ProcessorVersionAlias. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ProcessorVersionAlias. - * @implements IProcessorVersionAlias - * @constructor - * @param {google.cloud.documentai.v1beta3.IProcessorVersionAlias=} [properties] Properties to set - */ - function ProcessorVersionAlias(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProcessorVersionAlias alias. - * @member {string} alias - * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias - * @instance - */ - ProcessorVersionAlias.prototype.alias = ""; - - /** - * ProcessorVersionAlias processorVersion. - * @member {string} processorVersion - * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias - * @instance - */ - ProcessorVersionAlias.prototype.processorVersion = ""; - - /** - * Creates a new ProcessorVersionAlias instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias - * @static - * @param {google.cloud.documentai.v1beta3.IProcessorVersionAlias=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessorVersionAlias} ProcessorVersionAlias instance - */ - ProcessorVersionAlias.create = function create(properties) { - return new ProcessorVersionAlias(properties); - }; - - /** - * Encodes the specified ProcessorVersionAlias message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersionAlias.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias - * @static - * @param {google.cloud.documentai.v1beta3.IProcessorVersionAlias} message ProcessorVersionAlias message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorVersionAlias.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.alias); - if (message.processorVersion != null && Object.hasOwnProperty.call(message, "processorVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.processorVersion); - return writer; - }; - - /** - * Encodes the specified ProcessorVersionAlias message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorVersionAlias.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias - * @static - * @param {google.cloud.documentai.v1beta3.IProcessorVersionAlias} message ProcessorVersionAlias message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorVersionAlias.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessorVersionAlias message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessorVersionAlias} ProcessorVersionAlias - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorVersionAlias.decode = function decode(reader, 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.v1beta3.ProcessorVersionAlias(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.alias = reader.string(); - break; - } - case 2: { - message.processorVersion = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessorVersionAlias message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessorVersionAlias} ProcessorVersionAlias - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorVersionAlias.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessorVersionAlias message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessorVersionAlias.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.alias != null && message.hasOwnProperty("alias")) - if (!$util.isString(message.alias)) - return "alias: string expected"; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - if (!$util.isString(message.processorVersion)) - return "processorVersion: string expected"; - return null; - }; - - /** - * Creates a ProcessorVersionAlias message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessorVersionAlias} ProcessorVersionAlias - */ - ProcessorVersionAlias.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorVersionAlias) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessorVersionAlias(); - if (object.alias != null) - message.alias = String(object.alias); - if (object.processorVersion != null) - message.processorVersion = String(object.processorVersion); - return message; - }; - - /** - * Creates a plain object from a ProcessorVersionAlias message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorVersionAlias} message ProcessorVersionAlias - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessorVersionAlias.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.alias = ""; - object.processorVersion = ""; - } - if (message.alias != null && message.hasOwnProperty("alias")) - object.alias = message.alias; - if (message.processorVersion != null && message.hasOwnProperty("processorVersion")) - object.processorVersion = message.processorVersion; - return object; - }; - - /** - * Converts this ProcessorVersionAlias to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias - * @instance - * @returns {Object.} JSON object - */ - ProcessorVersionAlias.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessorVersionAlias - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessorVersionAlias - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessorVersionAlias.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorVersionAlias"; - }; - - return ProcessorVersionAlias; - })(); - - v1beta3.Processor = (function() { - - /** - * Properties of a Processor. - * @memberof google.cloud.documentai.v1beta3 - * @interface IProcessor - * @property {string|null} [name] Processor name - * @property {string|null} [type] Processor type - * @property {string|null} [displayName] Processor displayName - * @property {google.cloud.documentai.v1beta3.Processor.State|null} [state] Processor state - * @property {string|null} [defaultProcessorVersion] Processor defaultProcessorVersion - * @property {Array.|null} [processorVersionAliases] Processor processorVersionAliases - * @property {string|null} [processEndpoint] Processor processEndpoint - * @property {google.protobuf.ITimestamp|null} [createTime] Processor createTime - * @property {string|null} [kmsKeyName] Processor kmsKeyName - * @property {boolean|null} [satisfiesPzs] Processor satisfiesPzs - * @property {boolean|null} [satisfiesPzi] Processor satisfiesPzi - */ - - /** - * Constructs a new Processor. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a Processor. - * @implements IProcessor - * @constructor - * @param {google.cloud.documentai.v1beta3.IProcessor=} [properties] Properties to set - */ - function Processor(properties) { - this.processorVersionAliases = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Processor name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance - */ - Processor.prototype.name = ""; - - /** - * Processor type. - * @member {string} type - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance - */ - Processor.prototype.type = ""; - - /** - * Processor displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance - */ - Processor.prototype.displayName = ""; - - /** - * Processor state. - * @member {google.cloud.documentai.v1beta3.Processor.State} state - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance - */ - Processor.prototype.state = 0; - - /** - * Processor defaultProcessorVersion. - * @member {string} defaultProcessorVersion - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance - */ - Processor.prototype.defaultProcessorVersion = ""; - - /** - * Processor processorVersionAliases. - * @member {Array.} processorVersionAliases - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance - */ - Processor.prototype.processorVersionAliases = $util.emptyArray; - - /** - * Processor processEndpoint. - * @member {string} processEndpoint - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance - */ - Processor.prototype.processEndpoint = ""; - - /** - * Processor createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance - */ - Processor.prototype.createTime = null; - - /** - * Processor kmsKeyName. - * @member {string} kmsKeyName - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance - */ - Processor.prototype.kmsKeyName = ""; - - /** - * Processor satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance - */ - Processor.prototype.satisfiesPzs = false; - - /** - * Processor satisfiesPzi. - * @member {boolean} satisfiesPzi - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance - */ - Processor.prototype.satisfiesPzi = false; - - /** - * Creates a new Processor instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Processor - * @static - * @param {google.cloud.documentai.v1beta3.IProcessor=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Processor} Processor instance - */ - Processor.create = function create(properties) { - return new Processor(properties); - }; - - /** - * Encodes the specified Processor message. Does not implicitly {@link google.cloud.documentai.v1beta3.Processor.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Processor - * @static - * @param {google.cloud.documentai.v1beta3.IProcessor} message Processor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Processor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.processEndpoint != null && Object.hasOwnProperty.call(message, "processEndpoint")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.processEndpoint); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.kmsKeyName); - if (message.defaultProcessorVersion != null && Object.hasOwnProperty.call(message, "defaultProcessorVersion")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.defaultProcessorVersion); - if (message.processorVersionAliases != null && message.processorVersionAliases.length) - for (var i = 0; i < message.processorVersionAliases.length; ++i) - $root.google.cloud.documentai.v1beta3.ProcessorVersionAlias.encode(message.processorVersionAliases[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.satisfiesPzs); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.satisfiesPzi); - return writer; - }; - - /** - * Encodes the specified Processor message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Processor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Processor - * @static - * @param {google.cloud.documentai.v1beta3.IProcessor} message Processor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Processor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Processor message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Processor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Processor} Processor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Processor.decode = function decode(reader, 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.v1beta3.Processor(); - 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.type = reader.string(); - break; - } - case 3: { - message.displayName = reader.string(); - break; - } - case 4: { - message.state = reader.int32(); - break; - } - case 9: { - message.defaultProcessorVersion = reader.string(); - break; - } - case 10: { - if (!(message.processorVersionAliases && message.processorVersionAliases.length)) - message.processorVersionAliases = []; - message.processorVersionAliases.push($root.google.cloud.documentai.v1beta3.ProcessorVersionAlias.decode(reader, reader.uint32())); - break; - } - case 6: { - message.processEndpoint = reader.string(); - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.kmsKeyName = reader.string(); - break; - } - case 12: { - message.satisfiesPzs = reader.bool(); - break; - } - case 13: { - message.satisfiesPzi = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Processor message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Processor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Processor} Processor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Processor.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Processor message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Processor - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Processor.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.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) - if (!$util.isString(message.defaultProcessorVersion)) - return "defaultProcessorVersion: string expected"; - if (message.processorVersionAliases != null && message.hasOwnProperty("processorVersionAliases")) { - if (!Array.isArray(message.processorVersionAliases)) - return "processorVersionAliases: array expected"; - for (var i = 0; i < message.processorVersionAliases.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.ProcessorVersionAlias.verify(message.processorVersionAliases[i]); - if (error) - return "processorVersionAliases." + error; - } - } - if (message.processEndpoint != null && message.hasOwnProperty("processEndpoint")) - if (!$util.isString(message.processEndpoint)) - return "processEndpoint: 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.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; - return null; - }; - - /** - * Creates a Processor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Processor - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Processor} Processor - */ - Processor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Processor) - return object; - var message = new $root.google.cloud.documentai.v1beta3.Processor(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) - message.type = String(object.type); - if (object.displayName != null) - message.displayName = String(object.displayName); - 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 "ENABLED": - case 1: - message.state = 1; - break; - case "DISABLED": - case 2: - message.state = 2; - break; - case "ENABLING": - case 3: - message.state = 3; - break; - case "DISABLING": - case 4: - message.state = 4; - break; - case "CREATING": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "DELETING": - case 7: - message.state = 7; - break; - } - if (object.defaultProcessorVersion != null) - message.defaultProcessorVersion = String(object.defaultProcessorVersion); - if (object.processorVersionAliases) { - if (!Array.isArray(object.processorVersionAliases)) - throw TypeError(".google.cloud.documentai.v1beta3.Processor.processorVersionAliases: array expected"); - message.processorVersionAliases = []; - for (var i = 0; i < object.processorVersionAliases.length; ++i) { - if (typeof object.processorVersionAliases[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Processor.processorVersionAliases: object expected"); - message.processorVersionAliases[i] = $root.google.cloud.documentai.v1beta3.ProcessorVersionAlias.fromObject(object.processorVersionAliases[i]); - } - } - if (object.processEndpoint != null) - message.processEndpoint = String(object.processEndpoint); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Processor.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); - return message; - }; - - /** - * Creates a plain object from a Processor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Processor - * @static - * @param {google.cloud.documentai.v1beta3.Processor} message Processor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Processor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.processorVersionAliases = []; - if (options.defaults) { - object.name = ""; - object.type = ""; - object.displayName = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.processEndpoint = ""; - object.createTime = null; - object.kmsKeyName = ""; - object.defaultProcessorVersion = ""; - object.satisfiesPzs = false; - object.satisfiesPzi = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.Processor.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.Processor.State[message.state] : message.state; - if (message.processEndpoint != null && message.hasOwnProperty("processEndpoint")) - object.processEndpoint = message.processEndpoint; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) - object.kmsKeyName = message.kmsKeyName; - if (message.defaultProcessorVersion != null && message.hasOwnProperty("defaultProcessorVersion")) - object.defaultProcessorVersion = message.defaultProcessorVersion; - if (message.processorVersionAliases && message.processorVersionAliases.length) { - object.processorVersionAliases = []; - for (var j = 0; j < message.processorVersionAliases.length; ++j) - object.processorVersionAliases[j] = $root.google.cloud.documentai.v1beta3.ProcessorVersionAlias.toObject(message.processorVersionAliases[j], options); - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; - return object; - }; - - /** - * Converts this Processor to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Processor - * @instance - * @returns {Object.} JSON object - */ - Processor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Processor - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Processor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Processor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Processor"; - }; - - /** - * State enum. - * @name google.cloud.documentai.v1beta3.Processor.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ENABLED=1 ENABLED value - * @property {number} DISABLED=2 DISABLED value - * @property {number} ENABLING=3 ENABLING value - * @property {number} DISABLING=4 DISABLING value - * @property {number} CREATING=5 CREATING value - * @property {number} FAILED=6 FAILED value - * @property {number} DELETING=7 DELETING value - */ - Processor.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENABLED"] = 1; - values[valuesById[2] = "DISABLED"] = 2; - values[valuesById[3] = "ENABLING"] = 3; - values[valuesById[4] = "DISABLING"] = 4; - values[valuesById[5] = "CREATING"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[7] = "DELETING"] = 7; - return values; - })(); - - return Processor; - })(); - - v1beta3.ProcessorType = (function() { - - /** - * Properties of a ProcessorType. - * @memberof google.cloud.documentai.v1beta3 - * @interface IProcessorType - * @property {string|null} [name] ProcessorType name - * @property {string|null} [type] ProcessorType type - * @property {string|null} [category] ProcessorType category - * @property {Array.|null} [availableLocations] ProcessorType availableLocations - * @property {boolean|null} [allowCreation] ProcessorType allowCreation - * @property {google.api.LaunchStage|null} [launchStage] ProcessorType launchStage - * @property {Array.|null} [sampleDocumentUris] ProcessorType sampleDocumentUris - */ - - /** - * Constructs a new ProcessorType. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ProcessorType. - * @implements IProcessorType - * @constructor - * @param {google.cloud.documentai.v1beta3.IProcessorType=} [properties] Properties to set - */ - function ProcessorType(properties) { - this.availableLocations = []; - this.sampleDocumentUris = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProcessorType name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @instance - */ - ProcessorType.prototype.name = ""; - - /** - * ProcessorType type. - * @member {string} type - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @instance - */ - ProcessorType.prototype.type = ""; - - /** - * ProcessorType category. - * @member {string} category - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @instance - */ - ProcessorType.prototype.category = ""; - - /** - * ProcessorType availableLocations. - * @member {Array.} availableLocations - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @instance - */ - ProcessorType.prototype.availableLocations = $util.emptyArray; - - /** - * ProcessorType allowCreation. - * @member {boolean} allowCreation - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @instance - */ - ProcessorType.prototype.allowCreation = false; - - /** - * ProcessorType launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @instance - */ - ProcessorType.prototype.launchStage = 0; - - /** - * ProcessorType sampleDocumentUris. - * @member {Array.} sampleDocumentUris - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @instance - */ - ProcessorType.prototype.sampleDocumentUris = $util.emptyArray; - - /** - * Creates a new ProcessorType instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @static - * @param {google.cloud.documentai.v1beta3.IProcessorType=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType instance - */ - ProcessorType.create = function create(properties) { - return new ProcessorType(properties); - }; - - /** - * Encodes the specified ProcessorType message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @static - * @param {google.cloud.documentai.v1beta3.IProcessorType} message ProcessorType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorType.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.category != null && Object.hasOwnProperty.call(message, "category")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.category); - if (message.availableLocations != null && message.availableLocations.length) - for (var i = 0; i < message.availableLocations.length; ++i) - $root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.encode(message.availableLocations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.allowCreation != null && Object.hasOwnProperty.call(message, "allowCreation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowCreation); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.launchStage); - if (message.sampleDocumentUris != null && message.sampleDocumentUris.length) - for (var i = 0; i < message.sampleDocumentUris.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.sampleDocumentUris[i]); - return writer; - }; - - /** - * Encodes the specified ProcessorType message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @static - * @param {google.cloud.documentai.v1beta3.IProcessorType} message ProcessorType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProcessorType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProcessorType message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorType.decode = function decode(reader, 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.v1beta3.ProcessorType(); - 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.type = reader.string(); - break; - } - case 3: { - message.category = reader.string(); - break; - } - case 4: { - if (!(message.availableLocations && message.availableLocations.length)) - message.availableLocations = []; - message.availableLocations.push($root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.decode(reader, reader.uint32())); - break; - } - case 6: { - message.allowCreation = reader.bool(); - break; - } - case 8: { - message.launchStage = reader.int32(); - break; - } - case 9: { - if (!(message.sampleDocumentUris && message.sampleDocumentUris.length)) - message.sampleDocumentUris = []; - message.sampleDocumentUris.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProcessorType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProcessorType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProcessorType message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProcessorType.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.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.category != null && message.hasOwnProperty("category")) - if (!$util.isString(message.category)) - return "category: string expected"; - if (message.availableLocations != null && message.hasOwnProperty("availableLocations")) { - if (!Array.isArray(message.availableLocations)) - return "availableLocations: array expected"; - for (var i = 0; i < message.availableLocations.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.verify(message.availableLocations[i]); - if (error) - return "availableLocations." + error; - } - } - if (message.allowCreation != null && message.hasOwnProperty("allowCreation")) - if (typeof message.allowCreation !== "boolean") - return "allowCreation: boolean 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.sampleDocumentUris != null && message.hasOwnProperty("sampleDocumentUris")) { - if (!Array.isArray(message.sampleDocumentUris)) - return "sampleDocumentUris: array expected"; - for (var i = 0; i < message.sampleDocumentUris.length; ++i) - if (!$util.isString(message.sampleDocumentUris[i])) - return "sampleDocumentUris: string[] expected"; - } - return null; - }; - - /** - * Creates a ProcessorType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessorType} ProcessorType - */ - ProcessorType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorType) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessorType(); - if (object.name != null) - message.name = String(object.name); - if (object.type != null) - message.type = String(object.type); - if (object.category != null) - message.category = String(object.category); - if (object.availableLocations) { - if (!Array.isArray(object.availableLocations)) - throw TypeError(".google.cloud.documentai.v1beta3.ProcessorType.availableLocations: array expected"); - message.availableLocations = []; - for (var i = 0; i < object.availableLocations.length; ++i) { - if (typeof object.availableLocations[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ProcessorType.availableLocations: object expected"); - message.availableLocations[i] = $root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.fromObject(object.availableLocations[i]); - } - } - if (object.allowCreation != null) - message.allowCreation = Boolean(object.allowCreation); - 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.sampleDocumentUris) { - if (!Array.isArray(object.sampleDocumentUris)) - throw TypeError(".google.cloud.documentai.v1beta3.ProcessorType.sampleDocumentUris: array expected"); - message.sampleDocumentUris = []; - for (var i = 0; i < object.sampleDocumentUris.length; ++i) - message.sampleDocumentUris[i] = String(object.sampleDocumentUris[i]); - } - return message; - }; - - /** - * Creates a plain object from a ProcessorType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorType} message ProcessorType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProcessorType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.availableLocations = []; - object.sampleDocumentUris = []; - } - if (options.defaults) { - object.name = ""; - object.type = ""; - object.category = ""; - object.allowCreation = false; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.category != null && message.hasOwnProperty("category")) - object.category = message.category; - if (message.availableLocations && message.availableLocations.length) { - object.availableLocations = []; - for (var j = 0; j < message.availableLocations.length; ++j) - object.availableLocations[j] = $root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.toObject(message.availableLocations[j], options); - } - if (message.allowCreation != null && message.hasOwnProperty("allowCreation")) - object.allowCreation = message.allowCreation; - 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.sampleDocumentUris && message.sampleDocumentUris.length) { - object.sampleDocumentUris = []; - for (var j = 0; j < message.sampleDocumentUris.length; ++j) - object.sampleDocumentUris[j] = message.sampleDocumentUris[j]; - } - return object; - }; - - /** - * Converts this ProcessorType to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @instance - * @returns {Object.} JSON object - */ - ProcessorType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProcessorType - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProcessorType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorType"; - }; - - ProcessorType.LocationInfo = (function() { - - /** - * Properties of a LocationInfo. - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @interface ILocationInfo - * @property {string|null} [locationId] LocationInfo locationId - */ - - /** - * Constructs a new LocationInfo. - * @memberof google.cloud.documentai.v1beta3.ProcessorType - * @classdesc Represents a LocationInfo. - * @implements ILocationInfo - * @constructor - * @param {google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo=} [properties] Properties to set - */ - function LocationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LocationInfo locationId. - * @member {string} locationId - * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo - * @instance - */ - LocationInfo.prototype.locationId = ""; - - /** - * Creates a new LocationInfo instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} LocationInfo instance - */ - LocationInfo.create = function create(properties) { - return new LocationInfo(properties); - }; - - /** - * Encodes the specified LocationInfo message. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo} message LocationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.locationId); - return writer; - }; - - /** - * Encodes the specified LocationInfo message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ProcessorType.LocationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorType.ILocationInfo} message LocationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LocationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LocationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} LocationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationInfo.decode = function decode(reader, 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.v1beta3.ProcessorType.LocationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.locationId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LocationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} LocationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LocationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LocationInfo message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LocationInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.locationId != null && message.hasOwnProperty("locationId")) - if (!$util.isString(message.locationId)) - return "locationId: string expected"; - return null; - }; - - /** - * Creates a LocationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} LocationInfo - */ - LocationInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ProcessorType.LocationInfo(); - if (object.locationId != null) - message.locationId = String(object.locationId); - return message; - }; - - /** - * Creates a plain object from a LocationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo - * @static - * @param {google.cloud.documentai.v1beta3.ProcessorType.LocationInfo} message LocationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.locationId = ""; - if (message.locationId != null && message.hasOwnProperty("locationId")) - object.locationId = message.locationId; - return object; - }; - - /** - * Converts this LocationInfo to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo - * @instance - * @returns {Object.} JSON object - */ - LocationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LocationInfo - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ProcessorType.LocationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LocationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ProcessorType.LocationInfo"; - }; - - return LocationInfo; - })(); - - return ProcessorType; - })(); - - v1beta3.DocumentService = (function() { - - /** - * Constructs a new DocumentService service. - * @memberof google.cloud.documentai.v1beta3 - * @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.documentai.v1beta3.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.documentai.v1beta3.DocumentService|updateDataset}. - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @typedef UpdateDatasetCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateDataset. - * @function updateDataset - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.updateDataset = function updateDataset(request, callback) { - return this.rpcCall(updateDataset, $root.google.cloud.documentai.v1beta3.UpdateDatasetRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateDataset" }); - - /** - * Calls UpdateDataset. - * @function updateDataset - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetRequest} request UpdateDatasetRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|importDocuments}. - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @typedef ImportDocumentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ImportDocuments. - * @function importDocuments - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IImportDocumentsRequest} request ImportDocumentsRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentService.ImportDocumentsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.importDocuments = function importDocuments(request, callback) { - return this.rpcCall(importDocuments, $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportDocuments" }); - - /** - * Calls ImportDocuments. - * @function importDocuments - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IImportDocumentsRequest} request ImportDocumentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|getDocument}. - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @typedef GetDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.GetDocumentResponse} [response] GetDocumentResponse - */ - - /** - * Calls GetDocument. - * @function getDocument - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IGetDocumentRequest} request GetDocumentRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentService.GetDocumentCallback} callback Node-style callback called with the error, if any, and GetDocumentResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.getDocument = function getDocument(request, callback) { - return this.rpcCall(getDocument, $root.google.cloud.documentai.v1beta3.GetDocumentRequest, $root.google.cloud.documentai.v1beta3.GetDocumentResponse, request, callback); - }, "name", { value: "GetDocument" }); - - /** - * Calls GetDocument. - * @function getDocument - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IGetDocumentRequest} request GetDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|listDocuments}. - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @typedef ListDocumentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.ListDocumentsResponse} [response] ListDocumentsResponse - */ - - /** - * Calls ListDocuments. - * @function listDocuments - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IListDocumentsRequest} request ListDocumentsRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentService.ListDocumentsCallback} callback Node-style callback called with the error, if any, and ListDocumentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.listDocuments = function listDocuments(request, callback) { - return this.rpcCall(listDocuments, $root.google.cloud.documentai.v1beta3.ListDocumentsRequest, $root.google.cloud.documentai.v1beta3.ListDocumentsResponse, request, callback); - }, "name", { value: "ListDocuments" }); - - /** - * Calls ListDocuments. - * @function listDocuments - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IListDocumentsRequest} request ListDocumentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|batchDeleteDocuments}. - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @typedef BatchDeleteDocumentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchDeleteDocuments. - * @function batchDeleteDocuments - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest} request BatchDeleteDocumentsRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentService.BatchDeleteDocumentsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.batchDeleteDocuments = function batchDeleteDocuments(request, callback) { - return this.rpcCall(batchDeleteDocuments, $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchDeleteDocuments" }); - - /** - * Calls BatchDeleteDocuments. - * @function batchDeleteDocuments - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest} request BatchDeleteDocumentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|getDatasetSchema}. - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @typedef GetDatasetSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.DatasetSchema} [response] DatasetSchema - */ - - /** - * Calls GetDatasetSchema. - * @function getDatasetSchema - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest} request GetDatasetSchemaRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentService.GetDatasetSchemaCallback} callback Node-style callback called with the error, if any, and DatasetSchema - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.getDatasetSchema = function getDatasetSchema(request, callback) { - return this.rpcCall(getDatasetSchema, $root.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest, $root.google.cloud.documentai.v1beta3.DatasetSchema, request, callback); - }, "name", { value: "GetDatasetSchema" }); - - /** - * Calls GetDatasetSchema. - * @function getDatasetSchema - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest} request GetDatasetSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.documentai.v1beta3.DocumentService|updateDatasetSchema}. - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @typedef UpdateDatasetSchemaCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.documentai.v1beta3.DatasetSchema} [response] DatasetSchema - */ - - /** - * Calls UpdateDatasetSchema. - * @function updateDatasetSchema - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest} request UpdateDatasetSchemaRequest message or plain object - * @param {google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetSchemaCallback} callback Node-style callback called with the error, if any, and DatasetSchema - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DocumentService.prototype.updateDatasetSchema = function updateDatasetSchema(request, callback) { - return this.rpcCall(updateDatasetSchema, $root.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest, $root.google.cloud.documentai.v1beta3.DatasetSchema, request, callback); - }, "name", { value: "UpdateDatasetSchema" }); - - /** - * Calls UpdateDatasetSchema. - * @function updateDatasetSchema - * @memberof google.cloud.documentai.v1beta3.DocumentService - * @instance - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest} request UpdateDatasetSchemaRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return DocumentService; - })(); - - /** - * DatasetSplitType enum. - * @name google.cloud.documentai.v1beta3.DatasetSplitType - * @enum {number} - * @property {number} DATASET_SPLIT_TYPE_UNSPECIFIED=0 DATASET_SPLIT_TYPE_UNSPECIFIED value - * @property {number} DATASET_SPLIT_TRAIN=1 DATASET_SPLIT_TRAIN value - * @property {number} DATASET_SPLIT_TEST=2 DATASET_SPLIT_TEST value - * @property {number} DATASET_SPLIT_UNASSIGNED=3 DATASET_SPLIT_UNASSIGNED value - */ - v1beta3.DatasetSplitType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATASET_SPLIT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DATASET_SPLIT_TRAIN"] = 1; - values[valuesById[2] = "DATASET_SPLIT_TEST"] = 2; - values[valuesById[3] = "DATASET_SPLIT_UNASSIGNED"] = 3; - return values; - })(); - - /** - * DocumentLabelingState enum. - * @name google.cloud.documentai.v1beta3.DocumentLabelingState - * @enum {number} - * @property {number} DOCUMENT_LABELING_STATE_UNSPECIFIED=0 DOCUMENT_LABELING_STATE_UNSPECIFIED value - * @property {number} DOCUMENT_LABELED=1 DOCUMENT_LABELED value - * @property {number} DOCUMENT_UNLABELED=2 DOCUMENT_UNLABELED value - * @property {number} DOCUMENT_AUTO_LABELED=3 DOCUMENT_AUTO_LABELED value - */ - v1beta3.DocumentLabelingState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DOCUMENT_LABELING_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DOCUMENT_LABELED"] = 1; - values[valuesById[2] = "DOCUMENT_UNLABELED"] = 2; - values[valuesById[3] = "DOCUMENT_AUTO_LABELED"] = 3; - return values; - })(); - - v1beta3.UpdateDatasetRequest = (function() { - - /** - * Properties of an UpdateDatasetRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IUpdateDatasetRequest - * @property {google.cloud.documentai.v1beta3.IDataset|null} [dataset] UpdateDatasetRequest dataset - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatasetRequest updateMask - */ - - /** - * Constructs a new UpdateDatasetRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an UpdateDatasetRequest. - * @implements IUpdateDatasetRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetRequest=} [properties] Properties to set - */ - function UpdateDatasetRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDatasetRequest dataset. - * @member {google.cloud.documentai.v1beta3.IDataset|null|undefined} dataset - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest - * @instance - */ - UpdateDatasetRequest.prototype.dataset = null; - - /** - * UpdateDatasetRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest - * @instance - */ - UpdateDatasetRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateDatasetRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest - * @static - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.UpdateDatasetRequest} UpdateDatasetRequest instance - */ - UpdateDatasetRequest.create = function create(properties) { - return new UpdateDatasetRequest(properties); - }; - - /** - * Encodes the specified UpdateDatasetRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest - * @static - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatasetRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - $root.google.cloud.documentai.v1beta3.Dataset.encode(message.dataset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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(); - return writer; - }; - - /** - * Encodes the specified UpdateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest - * @static - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetRequest} message UpdateDatasetRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDatasetRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.UpdateDatasetRequest} UpdateDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatasetRequest.decode = function decode(reader, 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.v1beta3.UpdateDatasetRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.dataset = $root.google.cloud.documentai.v1beta3.Dataset.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDatasetRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.UpdateDatasetRequest} UpdateDatasetRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDatasetRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDatasetRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) { - var error = $root.google.cloud.documentai.v1beta3.Dataset.verify(message.dataset); - if (error) - return "dataset." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateDatasetRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.UpdateDatasetRequest} UpdateDatasetRequest - */ - UpdateDatasetRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.UpdateDatasetRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.UpdateDatasetRequest(); - if (object.dataset != null) { - if (typeof object.dataset !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.UpdateDatasetRequest.dataset: object expected"); - message.dataset = $root.google.cloud.documentai.v1beta3.Dataset.fromObject(object.dataset); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.UpdateDatasetRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDatasetRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest - * @static - * @param {google.cloud.documentai.v1beta3.UpdateDatasetRequest} message UpdateDatasetRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDatasetRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.dataset = null; - object.updateMask = null; - } - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = $root.google.cloud.documentai.v1beta3.Dataset.toObject(message.dataset, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateDatasetRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDatasetRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDatasetRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UpdateDatasetRequest"; - }; - - return UpdateDatasetRequest; - })(); - - v1beta3.UpdateDatasetOperationMetadata = (function() { - - /** - * Properties of an UpdateDatasetOperationMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IUpdateDatasetOperationMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] UpdateDatasetOperationMetadata commonMetadata - */ - - /** - * Constructs a new UpdateDatasetOperationMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an UpdateDatasetOperationMetadata. - * @implements IUpdateDatasetOperationMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata=} [properties] Properties to set - */ - function UpdateDatasetOperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDatasetOperationMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata - * @instance - */ - UpdateDatasetOperationMetadata.prototype.commonMetadata = null; - - /** - * Creates a new UpdateDatasetOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} UpdateDatasetOperationMetadata instance - */ - UpdateDatasetOperationMetadata.create = function create(properties) { - return new UpdateDatasetOperationMetadata(properties); - }; - - /** - * Encodes the specified UpdateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata} message UpdateDatasetOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatasetOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetOperationMetadata} message UpdateDatasetOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatasetOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDatasetOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} UpdateDatasetOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatasetOperationMetadata.decode = function decode(reader, 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.v1beta3.UpdateDatasetOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDatasetOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} UpdateDatasetOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatasetOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDatasetOperationMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDatasetOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - return null; - }; - - /** - * Creates an UpdateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} UpdateDatasetOperationMetadata - */ - UpdateDatasetOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDatasetOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata - * @static - * @param {google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata} message UpdateDatasetOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDatasetOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.commonMetadata = null; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - return object; - }; - - /** - * Converts this UpdateDatasetOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - UpdateDatasetOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDatasetOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDatasetOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata"; - }; - - return UpdateDatasetOperationMetadata; - })(); - - v1beta3.ImportDocumentsRequest = (function() { - - /** - * Properties of an ImportDocumentsRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IImportDocumentsRequest - * @property {string|null} [dataset] ImportDocumentsRequest dataset - * @property {Array.|null} [batchDocumentsImportConfigs] ImportDocumentsRequest batchDocumentsImportConfigs - */ - - /** - * Constructs a new ImportDocumentsRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an ImportDocumentsRequest. - * @implements IImportDocumentsRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IImportDocumentsRequest=} [properties] Properties to set - */ - function ImportDocumentsRequest(properties) { - this.batchDocumentsImportConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportDocumentsRequest dataset. - * @member {string} dataset - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @instance - */ - ImportDocumentsRequest.prototype.dataset = ""; - - /** - * ImportDocumentsRequest batchDocumentsImportConfigs. - * @member {Array.} batchDocumentsImportConfigs - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @instance - */ - ImportDocumentsRequest.prototype.batchDocumentsImportConfigs = $util.emptyArray; - - /** - * Creates a new ImportDocumentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IImportDocumentsRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest} ImportDocumentsRequest instance - */ - ImportDocumentsRequest.create = function create(properties) { - return new ImportDocumentsRequest(properties); - }; - - /** - * Encodes the specified ImportDocumentsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IImportDocumentsRequest} message ImportDocumentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportDocumentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.batchDocumentsImportConfigs != null && message.batchDocumentsImportConfigs.length) - for (var i = 0; i < message.batchDocumentsImportConfigs.length; ++i) - $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.encode(message.batchDocumentsImportConfigs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ImportDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IImportDocumentsRequest} message ImportDocumentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportDocumentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest} ImportDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportDocumentsRequest.decode = function decode(reader, 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.v1beta3.ImportDocumentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.dataset = reader.string(); - break; - } - case 4: { - if (!(message.batchDocumentsImportConfigs && message.batchDocumentsImportConfigs.length)) - message.batchDocumentsImportConfigs = []; - message.batchDocumentsImportConfigs.push($root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportDocumentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest} ImportDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportDocumentsRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportDocumentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.batchDocumentsImportConfigs != null && message.hasOwnProperty("batchDocumentsImportConfigs")) { - if (!Array.isArray(message.batchDocumentsImportConfigs)) - return "batchDocumentsImportConfigs: array expected"; - for (var i = 0; i < message.batchDocumentsImportConfigs.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.verify(message.batchDocumentsImportConfigs[i]); - if (error) - return "batchDocumentsImportConfigs." + error; - } - } - return null; - }; - - /** - * Creates an ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest} ImportDocumentsRequest - */ - ImportDocumentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest(); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.batchDocumentsImportConfigs) { - if (!Array.isArray(object.batchDocumentsImportConfigs)) - throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsRequest.batchDocumentsImportConfigs: array expected"); - message.batchDocumentsImportConfigs = []; - for (var i = 0; i < object.batchDocumentsImportConfigs.length; ++i) { - if (typeof object.batchDocumentsImportConfigs[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsRequest.batchDocumentsImportConfigs: object expected"); - message.batchDocumentsImportConfigs[i] = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.fromObject(object.batchDocumentsImportConfigs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest} message ImportDocumentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportDocumentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.batchDocumentsImportConfigs = []; - if (options.defaults) - object.dataset = ""; - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.batchDocumentsImportConfigs && message.batchDocumentsImportConfigs.length) { - object.batchDocumentsImportConfigs = []; - for (var j = 0; j < message.batchDocumentsImportConfigs.length; ++j) - object.batchDocumentsImportConfigs[j] = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.toObject(message.batchDocumentsImportConfigs[j], options); - } - return object; - }; - - /** - * Converts this ImportDocumentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @instance - * @returns {Object.} JSON object - */ - ImportDocumentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportDocumentsRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsRequest"; - }; - - ImportDocumentsRequest.BatchDocumentsImportConfig = (function() { - - /** - * Properties of a BatchDocumentsImportConfig. - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @interface IBatchDocumentsImportConfig - * @property {google.cloud.documentai.v1beta3.DatasetSplitType|null} [datasetSplit] BatchDocumentsImportConfig datasetSplit - * @property {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig|null} [autoSplitConfig] BatchDocumentsImportConfig autoSplitConfig - * @property {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null} [batchInputConfig] BatchDocumentsImportConfig batchInputConfig - * @property {string|null} [documentType] BatchDocumentsImportConfig documentType - */ - - /** - * Constructs a new BatchDocumentsImportConfig. - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest - * @classdesc Represents a BatchDocumentsImportConfig. - * @implements IBatchDocumentsImportConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig=} [properties] Properties to set - */ - function BatchDocumentsImportConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDocumentsImportConfig datasetSplit. - * @member {google.cloud.documentai.v1beta3.DatasetSplitType|null|undefined} datasetSplit - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @instance - */ - BatchDocumentsImportConfig.prototype.datasetSplit = null; - - /** - * BatchDocumentsImportConfig autoSplitConfig. - * @member {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig|null|undefined} autoSplitConfig - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @instance - */ - BatchDocumentsImportConfig.prototype.autoSplitConfig = null; - - /** - * BatchDocumentsImportConfig batchInputConfig. - * @member {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null|undefined} batchInputConfig - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @instance - */ - BatchDocumentsImportConfig.prototype.batchInputConfig = null; - - /** - * BatchDocumentsImportConfig documentType. - * @member {string} documentType - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @instance - */ - BatchDocumentsImportConfig.prototype.documentType = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BatchDocumentsImportConfig splitTypeConfig. - * @member {"datasetSplit"|"autoSplitConfig"|undefined} splitTypeConfig - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @instance - */ - Object.defineProperty(BatchDocumentsImportConfig.prototype, "splitTypeConfig", { - get: $util.oneOfGetter($oneOfFields = ["datasetSplit", "autoSplitConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BatchDocumentsImportConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig} BatchDocumentsImportConfig instance - */ - BatchDocumentsImportConfig.create = function create(properties) { - return new BatchDocumentsImportConfig(properties); - }; - - /** - * Encodes the specified BatchDocumentsImportConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig} message BatchDocumentsImportConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDocumentsImportConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.batchInputConfig != null && Object.hasOwnProperty.call(message, "batchInputConfig")) - $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.encode(message.batchInputConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.datasetSplit != null && Object.hasOwnProperty.call(message, "datasetSplit")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.datasetSplit); - if (message.autoSplitConfig != null && Object.hasOwnProperty.call(message, "autoSplitConfig")) - $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.encode(message.autoSplitConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.documentType); - return writer; - }; - - /** - * Encodes the specified BatchDocumentsImportConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.IBatchDocumentsImportConfig} message BatchDocumentsImportConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDocumentsImportConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchDocumentsImportConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig} BatchDocumentsImportConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDocumentsImportConfig.decode = function decode(reader, 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.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.datasetSplit = reader.int32(); - break; - } - case 3: { - message.autoSplitConfig = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.decode(reader, reader.uint32()); - break; - } - case 1: { - message.batchInputConfig = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.documentType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchDocumentsImportConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig} BatchDocumentsImportConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDocumentsImportConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchDocumentsImportConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDocumentsImportConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.datasetSplit != null && message.hasOwnProperty("datasetSplit")) { - properties.splitTypeConfig = 1; - switch (message.datasetSplit) { - default: - return "datasetSplit: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.autoSplitConfig != null && message.hasOwnProperty("autoSplitConfig")) { - if (properties.splitTypeConfig === 1) - return "splitTypeConfig: multiple values"; - properties.splitTypeConfig = 1; - { - var error = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.verify(message.autoSplitConfig); - if (error) - return "autoSplitConfig." + error; - } - } - if (message.batchInputConfig != null && message.hasOwnProperty("batchInputConfig")) { - var error = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.verify(message.batchInputConfig); - if (error) - return "batchInputConfig." + error; - } - if (message.documentType != null && message.hasOwnProperty("documentType")) - if (!$util.isString(message.documentType)) - return "documentType: string expected"; - return null; - }; - - /** - * Creates a BatchDocumentsImportConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig} BatchDocumentsImportConfig - */ - BatchDocumentsImportConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig(); - switch (object.datasetSplit) { - default: - if (typeof object.datasetSplit === "number") { - message.datasetSplit = object.datasetSplit; - break; - } - break; - case "DATASET_SPLIT_TYPE_UNSPECIFIED": - case 0: - message.datasetSplit = 0; - break; - case "DATASET_SPLIT_TRAIN": - case 1: - message.datasetSplit = 1; - break; - case "DATASET_SPLIT_TEST": - case 2: - message.datasetSplit = 2; - break; - case "DATASET_SPLIT_UNASSIGNED": - case 3: - message.datasetSplit = 3; - break; - } - if (object.autoSplitConfig != null) { - if (typeof object.autoSplitConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.autoSplitConfig: object expected"); - message.autoSplitConfig = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.fromObject(object.autoSplitConfig); - } - if (object.batchInputConfig != null) { - if (typeof object.batchInputConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.batchInputConfig: object expected"); - message.batchInputConfig = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.fromObject(object.batchInputConfig); - } - if (object.documentType != null) - message.documentType = String(object.documentType); - return message; - }; - - /** - * Creates a plain object from a BatchDocumentsImportConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig} message BatchDocumentsImportConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDocumentsImportConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.batchInputConfig = null; - object.documentType = ""; - } - if (message.batchInputConfig != null && message.hasOwnProperty("batchInputConfig")) - object.batchInputConfig = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.toObject(message.batchInputConfig, options); - if (message.datasetSplit != null && message.hasOwnProperty("datasetSplit")) { - object.datasetSplit = options.enums === String ? $root.google.cloud.documentai.v1beta3.DatasetSplitType[message.datasetSplit] === undefined ? message.datasetSplit : $root.google.cloud.documentai.v1beta3.DatasetSplitType[message.datasetSplit] : message.datasetSplit; - if (options.oneofs) - object.splitTypeConfig = "datasetSplit"; - } - if (message.autoSplitConfig != null && message.hasOwnProperty("autoSplitConfig")) { - object.autoSplitConfig = $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.toObject(message.autoSplitConfig, options); - if (options.oneofs) - object.splitTypeConfig = "autoSplitConfig"; - } - if (message.documentType != null && message.hasOwnProperty("documentType")) - object.documentType = message.documentType; - return object; - }; - - /** - * Converts this BatchDocumentsImportConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @instance - * @returns {Object.} JSON object - */ - BatchDocumentsImportConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchDocumentsImportConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchDocumentsImportConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig"; - }; - - BatchDocumentsImportConfig.AutoSplitConfig = (function() { - - /** - * Properties of an AutoSplitConfig. - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @interface IAutoSplitConfig - * @property {number|null} [trainingSplitRatio] AutoSplitConfig trainingSplitRatio - */ - - /** - * Constructs a new AutoSplitConfig. - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig - * @classdesc Represents an AutoSplitConfig. - * @implements IAutoSplitConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig=} [properties] Properties to set - */ - function AutoSplitConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutoSplitConfig trainingSplitRatio. - * @member {number} trainingSplitRatio - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig - * @instance - */ - AutoSplitConfig.prototype.trainingSplitRatio = 0; - - /** - * Creates a new AutoSplitConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig} AutoSplitConfig instance - */ - AutoSplitConfig.create = function create(properties) { - return new AutoSplitConfig(properties); - }; - - /** - * Encodes the specified AutoSplitConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig} message AutoSplitConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoSplitConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.trainingSplitRatio != null && Object.hasOwnProperty.call(message, "trainingSplitRatio")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.trainingSplitRatio); - return writer; - }; - - /** - * Encodes the specified AutoSplitConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig} message AutoSplitConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoSplitConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutoSplitConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig} AutoSplitConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoSplitConfig.decode = function decode(reader, 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.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.trainingSplitRatio = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutoSplitConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig} AutoSplitConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoSplitConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutoSplitConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoSplitConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.trainingSplitRatio != null && message.hasOwnProperty("trainingSplitRatio")) - if (typeof message.trainingSplitRatio !== "number") - return "trainingSplitRatio: number expected"; - return null; - }; - - /** - * Creates an AutoSplitConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig} AutoSplitConfig - */ - AutoSplitConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig(); - if (object.trainingSplitRatio != null) - message.trainingSplitRatio = Number(object.trainingSplitRatio); - return message; - }; - - /** - * Creates a plain object from an AutoSplitConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig} message AutoSplitConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoSplitConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.trainingSplitRatio = 0; - if (message.trainingSplitRatio != null && message.hasOwnProperty("trainingSplitRatio")) - object.trainingSplitRatio = options.json && !isFinite(message.trainingSplitRatio) ? String(message.trainingSplitRatio) : message.trainingSplitRatio; - return object; - }; - - /** - * Converts this AutoSplitConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig - * @instance - * @returns {Object.} JSON object - */ - AutoSplitConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutoSplitConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoSplitConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig"; - }; - - return AutoSplitConfig; - })(); - - return BatchDocumentsImportConfig; - })(); - - return ImportDocumentsRequest; - })(); - - v1beta3.ImportDocumentsResponse = (function() { - - /** - * Properties of an ImportDocumentsResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IImportDocumentsResponse - */ - - /** - * Constructs a new ImportDocumentsResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an ImportDocumentsResponse. - * @implements IImportDocumentsResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IImportDocumentsResponse=} [properties] Properties to set - */ - function ImportDocumentsResponse(properties) { - if (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 ImportDocumentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IImportDocumentsResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsResponse} ImportDocumentsResponse instance - */ - ImportDocumentsResponse.create = function create(properties) { - return new ImportDocumentsResponse(properties); - }; - - /** - * Encodes the specified ImportDocumentsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IImportDocumentsResponse} message ImportDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportDocumentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified ImportDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IImportDocumentsResponse} message ImportDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportDocumentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsResponse} ImportDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportDocumentsResponse.decode = function decode(reader, 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.v1beta3.ImportDocumentsResponse(); - 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 ImportDocumentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsResponse} ImportDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportDocumentsResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportDocumentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an ImportDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsResponse} ImportDocumentsResponse - */ - ImportDocumentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsResponse) - return object; - return new $root.google.cloud.documentai.v1beta3.ImportDocumentsResponse(); - }; - - /** - * Creates a plain object from an ImportDocumentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsResponse} message ImportDocumentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportDocumentsResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this ImportDocumentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse - * @instance - * @returns {Object.} JSON object - */ - ImportDocumentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportDocumentsResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsResponse"; - }; - - return ImportDocumentsResponse; - })(); - - v1beta3.ImportDocumentsMetadata = (function() { - - /** - * Properties of an ImportDocumentsMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IImportDocumentsMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] ImportDocumentsMetadata commonMetadata - * @property {Array.|null} [individualImportStatuses] ImportDocumentsMetadata individualImportStatuses - * @property {Array.|null} [importConfigValidationResults] ImportDocumentsMetadata importConfigValidationResults - * @property {number|null} [totalDocumentCount] ImportDocumentsMetadata totalDocumentCount - */ - - /** - * Constructs a new ImportDocumentsMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an ImportDocumentsMetadata. - * @implements IImportDocumentsMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IImportDocumentsMetadata=} [properties] Properties to set - */ - function ImportDocumentsMetadata(properties) { - this.individualImportStatuses = []; - this.importConfigValidationResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportDocumentsMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @instance - */ - ImportDocumentsMetadata.prototype.commonMetadata = null; - - /** - * ImportDocumentsMetadata individualImportStatuses. - * @member {Array.} individualImportStatuses - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @instance - */ - ImportDocumentsMetadata.prototype.individualImportStatuses = $util.emptyArray; - - /** - * ImportDocumentsMetadata importConfigValidationResults. - * @member {Array.} importConfigValidationResults - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @instance - */ - ImportDocumentsMetadata.prototype.importConfigValidationResults = $util.emptyArray; - - /** - * ImportDocumentsMetadata totalDocumentCount. - * @member {number} totalDocumentCount - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @instance - */ - ImportDocumentsMetadata.prototype.totalDocumentCount = 0; - - /** - * Creates a new ImportDocumentsMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IImportDocumentsMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata} ImportDocumentsMetadata instance - */ - ImportDocumentsMetadata.create = function create(properties) { - return new ImportDocumentsMetadata(properties); - }; - - /** - * Encodes the specified ImportDocumentsMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IImportDocumentsMetadata} message ImportDocumentsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportDocumentsMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.individualImportStatuses != null && message.individualImportStatuses.length) - for (var i = 0; i < message.individualImportStatuses.length; ++i) - $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.encode(message.individualImportStatuses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.totalDocumentCount != null && Object.hasOwnProperty.call(message, "totalDocumentCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalDocumentCount); - if (message.importConfigValidationResults != null && message.importConfigValidationResults.length) - for (var i = 0; i < message.importConfigValidationResults.length; ++i) - $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.encode(message.importConfigValidationResults[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ImportDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IImportDocumentsMetadata} message ImportDocumentsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportDocumentsMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportDocumentsMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata} ImportDocumentsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportDocumentsMetadata.decode = function decode(reader, 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.v1beta3.ImportDocumentsMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.individualImportStatuses && message.individualImportStatuses.length)) - message.individualImportStatuses = []; - message.individualImportStatuses.push($root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.importConfigValidationResults && message.importConfigValidationResults.length)) - message.importConfigValidationResults = []; - message.importConfigValidationResults.push($root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.decode(reader, reader.uint32())); - break; - } - case 3: { - message.totalDocumentCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportDocumentsMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata} ImportDocumentsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportDocumentsMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportDocumentsMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportDocumentsMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - if (message.individualImportStatuses != null && message.hasOwnProperty("individualImportStatuses")) { - if (!Array.isArray(message.individualImportStatuses)) - return "individualImportStatuses: array expected"; - for (var i = 0; i < message.individualImportStatuses.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.verify(message.individualImportStatuses[i]); - if (error) - return "individualImportStatuses." + error; - } - } - if (message.importConfigValidationResults != null && message.hasOwnProperty("importConfigValidationResults")) { - if (!Array.isArray(message.importConfigValidationResults)) - return "importConfigValidationResults: array expected"; - for (var i = 0; i < message.importConfigValidationResults.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.verify(message.importConfigValidationResults[i]); - if (error) - return "importConfigValidationResults." + error; - } - } - if (message.totalDocumentCount != null && message.hasOwnProperty("totalDocumentCount")) - if (!$util.isInteger(message.totalDocumentCount)) - return "totalDocumentCount: integer expected"; - return null; - }; - - /** - * Creates an ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata} ImportDocumentsMetadata - */ - ImportDocumentsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - if (object.individualImportStatuses) { - if (!Array.isArray(object.individualImportStatuses)) - throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.individualImportStatuses: array expected"); - message.individualImportStatuses = []; - for (var i = 0; i < object.individualImportStatuses.length; ++i) { - if (typeof object.individualImportStatuses[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.individualImportStatuses: object expected"); - message.individualImportStatuses[i] = $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.fromObject(object.individualImportStatuses[i]); - } - } - if (object.importConfigValidationResults) { - if (!Array.isArray(object.importConfigValidationResults)) - throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.importConfigValidationResults: array expected"); - message.importConfigValidationResults = []; - for (var i = 0; i < object.importConfigValidationResults.length; ++i) { - if (typeof object.importConfigValidationResults[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.importConfigValidationResults: object expected"); - message.importConfigValidationResults[i] = $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.fromObject(object.importConfigValidationResults[i]); - } - } - if (object.totalDocumentCount != null) - message.totalDocumentCount = object.totalDocumentCount | 0; - return message; - }; - - /** - * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata} message ImportDocumentsMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportDocumentsMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.individualImportStatuses = []; - object.importConfigValidationResults = []; - } - if (options.defaults) { - object.commonMetadata = null; - object.totalDocumentCount = 0; - } - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - if (message.individualImportStatuses && message.individualImportStatuses.length) { - object.individualImportStatuses = []; - for (var j = 0; j < message.individualImportStatuses.length; ++j) - object.individualImportStatuses[j] = $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.toObject(message.individualImportStatuses[j], options); - } - if (message.totalDocumentCount != null && message.hasOwnProperty("totalDocumentCount")) - object.totalDocumentCount = message.totalDocumentCount; - if (message.importConfigValidationResults && message.importConfigValidationResults.length) { - object.importConfigValidationResults = []; - for (var j = 0; j < message.importConfigValidationResults.length; ++j) - object.importConfigValidationResults[j] = $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.toObject(message.importConfigValidationResults[j], options); - } - return object; - }; - - /** - * Converts this ImportDocumentsMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @instance - * @returns {Object.} JSON object - */ - ImportDocumentsMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportDocumentsMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportDocumentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsMetadata"; - }; - - ImportDocumentsMetadata.IndividualImportStatus = (function() { - - /** - * Properties of an IndividualImportStatus. - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @interface IIndividualImportStatus - * @property {string|null} [inputGcsSource] IndividualImportStatus inputGcsSource - * @property {google.rpc.IStatus|null} [status] IndividualImportStatus status - * @property {google.cloud.documentai.v1beta3.IDocumentId|null} [outputDocumentId] IndividualImportStatus outputDocumentId - */ - - /** - * Constructs a new IndividualImportStatus. - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @classdesc Represents an IndividualImportStatus. - * @implements IIndividualImportStatus - * @constructor - * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus=} [properties] Properties to set - */ - function IndividualImportStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IndividualImportStatus inputGcsSource. - * @member {string} inputGcsSource - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @instance - */ - IndividualImportStatus.prototype.inputGcsSource = ""; - - /** - * IndividualImportStatus status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @instance - */ - IndividualImportStatus.prototype.status = null; - - /** - * IndividualImportStatus outputDocumentId. - * @member {google.cloud.documentai.v1beta3.IDocumentId|null|undefined} outputDocumentId - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @instance - */ - IndividualImportStatus.prototype.outputDocumentId = null; - - /** - * Creates a new IndividualImportStatus instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus} IndividualImportStatus instance - */ - IndividualImportStatus.create = function create(properties) { - return new IndividualImportStatus(properties); - }; - - /** - * Encodes the specified IndividualImportStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus} message IndividualImportStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualImportStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputGcsSource != null && Object.hasOwnProperty.call(message, "inputGcsSource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputGcsSource); - 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(); - if (message.outputDocumentId != null && Object.hasOwnProperty.call(message, "outputDocumentId")) - $root.google.cloud.documentai.v1beta3.DocumentId.encode(message.outputDocumentId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified IndividualImportStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IIndividualImportStatus} message IndividualImportStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualImportStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IndividualImportStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus} IndividualImportStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualImportStatus.decode = function decode(reader, 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.v1beta3.ImportDocumentsMetadata.IndividualImportStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.inputGcsSource = reader.string(); - break; - } - case 2: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 4: { - message.outputDocumentId = $root.google.cloud.documentai.v1beta3.DocumentId.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IndividualImportStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus} IndividualImportStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualImportStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IndividualImportStatus message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndividualImportStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) - if (!$util.isString(message.inputGcsSource)) - return "inputGcsSource: string expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - if (message.outputDocumentId != null && message.hasOwnProperty("outputDocumentId")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentId.verify(message.outputDocumentId); - if (error) - return "outputDocumentId." + error; - } - return null; - }; - - /** - * Creates an IndividualImportStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus} IndividualImportStatus - */ - IndividualImportStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus(); - if (object.inputGcsSource != null) - message.inputGcsSource = String(object.inputGcsSource); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - if (object.outputDocumentId != null) { - if (typeof object.outputDocumentId !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus.outputDocumentId: object expected"); - message.outputDocumentId = $root.google.cloud.documentai.v1beta3.DocumentId.fromObject(object.outputDocumentId); - } - return message; - }; - - /** - * Creates a plain object from an IndividualImportStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus} message IndividualImportStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndividualImportStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inputGcsSource = ""; - object.status = null; - object.outputDocumentId = null; - } - if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) - object.inputGcsSource = message.inputGcsSource; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.outputDocumentId != null && message.hasOwnProperty("outputDocumentId")) - object.outputDocumentId = $root.google.cloud.documentai.v1beta3.DocumentId.toObject(message.outputDocumentId, options); - return object; - }; - - /** - * Converts this IndividualImportStatus to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @instance - * @returns {Object.} JSON object - */ - IndividualImportStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IndividualImportStatus - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndividualImportStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IndividualImportStatus"; - }; - - return IndividualImportStatus; - })(); - - ImportDocumentsMetadata.ImportConfigValidationResult = (function() { - - /** - * Properties of an ImportConfigValidationResult. - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @interface IImportConfigValidationResult - * @property {string|null} [inputGcsSource] ImportConfigValidationResult inputGcsSource - * @property {google.rpc.IStatus|null} [status] ImportConfigValidationResult status - */ - - /** - * Constructs a new ImportConfigValidationResult. - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata - * @classdesc Represents an ImportConfigValidationResult. - * @implements IImportConfigValidationResult - * @constructor - * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult=} [properties] Properties to set - */ - function ImportConfigValidationResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportConfigValidationResult inputGcsSource. - * @member {string} inputGcsSource - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult - * @instance - */ - ImportConfigValidationResult.prototype.inputGcsSource = ""; - - /** - * ImportConfigValidationResult status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult - * @instance - */ - ImportConfigValidationResult.prototype.status = null; - - /** - * Creates a new ImportConfigValidationResult instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult} ImportConfigValidationResult instance - */ - ImportConfigValidationResult.create = function create(properties) { - return new ImportConfigValidationResult(properties); - }; - - /** - * Encodes the specified ImportConfigValidationResult message. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult} message ImportConfigValidationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportConfigValidationResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputGcsSource != null && Object.hasOwnProperty.call(message, "inputGcsSource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.inputGcsSource); - 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 ImportConfigValidationResult message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.IImportConfigValidationResult} message ImportConfigValidationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportConfigValidationResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportConfigValidationResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult} ImportConfigValidationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportConfigValidationResult.decode = function decode(reader, 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.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.inputGcsSource = 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 ImportConfigValidationResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult} ImportConfigValidationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportConfigValidationResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportConfigValidationResult message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportConfigValidationResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) - if (!$util.isString(message.inputGcsSource)) - return "inputGcsSource: 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 ImportConfigValidationResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult} ImportConfigValidationResult - */ - ImportConfigValidationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult(); - if (object.inputGcsSource != null) - message.inputGcsSource = String(object.inputGcsSource); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - return message; - }; - - /** - * Creates a plain object from an ImportConfigValidationResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult - * @static - * @param {google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult} message ImportConfigValidationResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportConfigValidationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.inputGcsSource = ""; - object.status = null; - } - if (message.inputGcsSource != null && message.hasOwnProperty("inputGcsSource")) - object.inputGcsSource = message.inputGcsSource; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - return object; - }; - - /** - * Converts this ImportConfigValidationResult to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult - * @instance - * @returns {Object.} JSON object - */ - ImportConfigValidationResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ImportConfigValidationResult - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportConfigValidationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ImportDocumentsMetadata.ImportConfigValidationResult"; - }; - - return ImportConfigValidationResult; - })(); - - return ImportDocumentsMetadata; - })(); - - v1beta3.GetDocumentRequest = (function() { - - /** - * Properties of a GetDocumentRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGetDocumentRequest - * @property {string|null} [dataset] GetDocumentRequest dataset - * @property {google.cloud.documentai.v1beta3.IDocumentId|null} [documentId] GetDocumentRequest documentId - * @property {google.protobuf.IFieldMask|null} [readMask] GetDocumentRequest readMask - * @property {google.cloud.documentai.v1beta3.IDocumentPageRange|null} [pageRange] GetDocumentRequest pageRange - */ - - /** - * Constructs a new GetDocumentRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a GetDocumentRequest. - * @implements IGetDocumentRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.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 dataset. - * @member {string} dataset - * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest - * @instance - */ - GetDocumentRequest.prototype.dataset = ""; - - /** - * GetDocumentRequest documentId. - * @member {google.cloud.documentai.v1beta3.IDocumentId|null|undefined} documentId - * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest - * @instance - */ - GetDocumentRequest.prototype.documentId = null; - - /** - * GetDocumentRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest - * @instance - */ - GetDocumentRequest.prototype.readMask = null; - - /** - * GetDocumentRequest pageRange. - * @member {google.cloud.documentai.v1beta3.IDocumentPageRange|null|undefined} pageRange - * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest - * @instance - */ - GetDocumentRequest.prototype.pageRange = null; - - /** - * Creates a new GetDocumentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.GetDocumentRequest} GetDocumentRequest instance - */ - GetDocumentRequest.create = function create(properties) { - return new GetDocumentRequest(properties); - }; - - /** - * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDocumentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest - * @static - * @param {google.cloud.documentai.v1beta3.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.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) - $root.google.cloud.documentai.v1beta3.DocumentId.encode(message.documentId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.pageRange != null && Object.hasOwnProperty.call(message, "pageRange")) - $root.google.cloud.documentai.v1beta3.DocumentPageRange.encode(message.pageRange, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDocumentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest - * @static - * @param {google.cloud.documentai.v1beta3.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.documentai.v1beta3.GetDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.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.documentai.v1beta3.GetDocumentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.dataset = reader.string(); - break; - } - case 2: { - message.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.decode(reader, reader.uint32()); - break; - } - case 3: { - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 4: { - message.pageRange = $root.google.cloud.documentai.v1beta3.DocumentPageRange.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.documentai.v1beta3.GetDocumentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.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.documentai.v1beta3.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.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.documentId != null && message.hasOwnProperty("documentId")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentId.verify(message.documentId); - if (error) - return "documentId." + error; - } - if (message.readMask != null && message.hasOwnProperty("readMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.readMask); - if (error) - return "readMask." + error; - } - if (message.pageRange != null && message.hasOwnProperty("pageRange")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentPageRange.verify(message.pageRange); - if (error) - return "pageRange." + error; - } - return null; - }; - - /** - * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.GetDocumentRequest} GetDocumentRequest - */ - GetDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.GetDocumentRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.GetDocumentRequest(); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.documentId != null) { - if (typeof object.documentId !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.GetDocumentRequest.documentId: object expected"); - message.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.fromObject(object.documentId); - } - if (object.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.GetDocumentRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); - } - if (object.pageRange != null) { - if (typeof object.pageRange !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.GetDocumentRequest.pageRange: object expected"); - message.pageRange = $root.google.cloud.documentai.v1beta3.DocumentPageRange.fromObject(object.pageRange); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.GetDocumentRequest - * @static - * @param {google.cloud.documentai.v1beta3.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.dataset = ""; - object.documentId = null; - object.readMask = null; - object.pageRange = null; - } - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.documentId != null && message.hasOwnProperty("documentId")) - object.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.toObject(message.documentId, options); - if (message.readMask != null && message.hasOwnProperty("readMask")) - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); - if (message.pageRange != null && message.hasOwnProperty("pageRange")) - object.pageRange = $root.google.cloud.documentai.v1beta3.DocumentPageRange.toObject(message.pageRange, options); - return object; - }; - - /** - * Converts this GetDocumentRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.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.documentai.v1beta3.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.documentai.v1beta3.GetDocumentRequest"; - }; - - return GetDocumentRequest; - })(); - - v1beta3.GetDocumentResponse = (function() { - - /** - * Properties of a GetDocumentResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGetDocumentResponse - * @property {google.cloud.documentai.v1beta3.IDocument|null} [document] GetDocumentResponse document - */ - - /** - * Constructs a new GetDocumentResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a GetDocumentResponse. - * @implements IGetDocumentResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IGetDocumentResponse=} [properties] Properties to set - */ - function GetDocumentResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDocumentResponse document. - * @member {google.cloud.documentai.v1beta3.IDocument|null|undefined} document - * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse - * @instance - */ - GetDocumentResponse.prototype.document = null; - - /** - * Creates a new GetDocumentResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse - * @static - * @param {google.cloud.documentai.v1beta3.IGetDocumentResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.GetDocumentResponse} GetDocumentResponse instance - */ - GetDocumentResponse.create = function create(properties) { - return new GetDocumentResponse(properties); - }; - - /** - * Encodes the specified GetDocumentResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDocumentResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse - * @static - * @param {google.cloud.documentai.v1beta3.IGetDocumentResponse} message GetDocumentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.document != null && Object.hasOwnProperty.call(message, "document")) - $root.google.cloud.documentai.v1beta3.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetDocumentResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDocumentResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse - * @static - * @param {google.cloud.documentai.v1beta3.IGetDocumentResponse} message GetDocumentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDocumentResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.GetDocumentResponse} GetDocumentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentResponse.decode = function decode(reader, 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.v1beta3.GetDocumentResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.document = $root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDocumentResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.GetDocumentResponse} GetDocumentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDocumentResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDocumentResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDocumentResponse.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.documentai.v1beta3.Document.verify(message.document); - if (error) - return "document." + error; - } - return null; - }; - - /** - * Creates a GetDocumentResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.GetDocumentResponse} GetDocumentResponse - */ - GetDocumentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.GetDocumentResponse) - return object; - var message = new $root.google.cloud.documentai.v1beta3.GetDocumentResponse(); - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.GetDocumentResponse.document: object expected"); - message.document = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.document); - } - return message; - }; - - /** - * Creates a plain object from a GetDocumentResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse - * @static - * @param {google.cloud.documentai.v1beta3.GetDocumentResponse} message GetDocumentResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDocumentResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.document = null; - if (message.document != null && message.hasOwnProperty("document")) - object.document = $root.google.cloud.documentai.v1beta3.Document.toObject(message.document, options); - return object; - }; - - /** - * Converts this GetDocumentResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse - * @instance - * @returns {Object.} JSON object - */ - GetDocumentResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDocumentResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.GetDocumentResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetDocumentResponse"; - }; - - return GetDocumentResponse; - })(); - - v1beta3.ListDocumentsRequest = (function() { - - /** - * Properties of a ListDocumentsRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IListDocumentsRequest - * @property {string|null} [dataset] ListDocumentsRequest dataset - * @property {number|null} [pageSize] ListDocumentsRequest pageSize - * @property {string|null} [pageToken] ListDocumentsRequest pageToken - * @property {string|null} [filter] ListDocumentsRequest filter - * @property {boolean|null} [returnTotalSize] ListDocumentsRequest returnTotalSize - * @property {number|null} [skip] ListDocumentsRequest skip - */ - - /** - * Constructs a new ListDocumentsRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ListDocumentsRequest. - * @implements IListDocumentsRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IListDocumentsRequest=} [properties] Properties to set - */ - function ListDocumentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDocumentsRequest dataset. - * @member {string} dataset - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @instance - */ - ListDocumentsRequest.prototype.dataset = ""; - - /** - * ListDocumentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @instance - */ - ListDocumentsRequest.prototype.pageSize = 0; - - /** - * ListDocumentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @instance - */ - ListDocumentsRequest.prototype.pageToken = ""; - - /** - * ListDocumentsRequest filter. - * @member {string} filter - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @instance - */ - ListDocumentsRequest.prototype.filter = ""; - - /** - * ListDocumentsRequest returnTotalSize. - * @member {boolean} returnTotalSize - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @instance - */ - ListDocumentsRequest.prototype.returnTotalSize = false; - - /** - * ListDocumentsRequest skip. - * @member {number} skip - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @instance - */ - ListDocumentsRequest.prototype.skip = 0; - - /** - * Creates a new ListDocumentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListDocumentsRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ListDocumentsRequest} ListDocumentsRequest instance - */ - ListDocumentsRequest.create = function create(properties) { - return new ListDocumentsRequest(properties); - }; - - /** - * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDocumentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - 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.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.returnTotalSize != null && Object.hasOwnProperty.call(message, "returnTotalSize")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.returnTotalSize); - if (message.skip != null && Object.hasOwnProperty.call(message, "skip")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.skip); - return writer; - }; - - /** - * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDocumentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ListDocumentsRequest} ListDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDocumentsRequest.decode = function decode(reader, 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.v1beta3.ListDocumentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.dataset = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 6: { - message.returnTotalSize = reader.bool(); - break; - } - case 8: { - message.skip = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ListDocumentsRequest} ListDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDocumentsRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDocumentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: 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.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.returnTotalSize != null && message.hasOwnProperty("returnTotalSize")) - if (typeof message.returnTotalSize !== "boolean") - return "returnTotalSize: boolean expected"; - if (message.skip != null && message.hasOwnProperty("skip")) - if (!$util.isInteger(message.skip)) - return "skip: integer expected"; - return null; - }; - - /** - * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ListDocumentsRequest} ListDocumentsRequest - */ - ListDocumentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ListDocumentsRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ListDocumentsRequest(); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.returnTotalSize != null) - message.returnTotalSize = Boolean(object.returnTotalSize); - if (object.skip != null) - message.skip = object.skip | 0; - return message; - }; - - /** - * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @static - * @param {google.cloud.documentai.v1beta3.ListDocumentsRequest} message ListDocumentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDocumentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.dataset = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.returnTotalSize = false; - object.skip = 0; - } - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.returnTotalSize != null && message.hasOwnProperty("returnTotalSize")) - object.returnTotalSize = message.returnTotalSize; - if (message.skip != null && message.hasOwnProperty("skip")) - object.skip = message.skip; - return object; - }; - - /** - * Converts this ListDocumentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListDocumentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDocumentsRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ListDocumentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListDocumentsRequest"; - }; - - return ListDocumentsRequest; - })(); - - v1beta3.ListDocumentsResponse = (function() { - - /** - * Properties of a ListDocumentsResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IListDocumentsResponse - * @property {Array.|null} [documentMetadata] ListDocumentsResponse documentMetadata - * @property {string|null} [nextPageToken] ListDocumentsResponse nextPageToken - * @property {number|null} [totalSize] ListDocumentsResponse totalSize - */ - - /** - * Constructs a new ListDocumentsResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a ListDocumentsResponse. - * @implements IListDocumentsResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IListDocumentsResponse=} [properties] Properties to set - */ - function ListDocumentsResponse(properties) { - this.documentMetadata = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDocumentsResponse documentMetadata. - * @member {Array.} documentMetadata - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @instance - */ - ListDocumentsResponse.prototype.documentMetadata = $util.emptyArray; - - /** - * ListDocumentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @instance - */ - ListDocumentsResponse.prototype.nextPageToken = ""; - - /** - * ListDocumentsResponse totalSize. - * @member {number} totalSize - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @instance - */ - ListDocumentsResponse.prototype.totalSize = 0; - - /** - * Creates a new ListDocumentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListDocumentsResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.ListDocumentsResponse} ListDocumentsResponse instance - */ - ListDocumentsResponse.create = function create(properties) { - return new ListDocumentsResponse(properties); - }; - - /** - * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDocumentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentMetadata != null && message.documentMetadata.length) - for (var i = 0; i < message.documentMetadata.length; ++i) - $root.google.cloud.documentai.v1beta3.DocumentMetadata.encode(message.documentMetadata[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); - return writer; - }; - - /** - * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.ListDocumentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDocumentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.ListDocumentsResponse} ListDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDocumentsResponse.decode = function decode(reader, 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.v1beta3.ListDocumentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.documentMetadata && message.documentMetadata.length)) - message.documentMetadata = []; - message.documentMetadata.push($root.google.cloud.documentai.v1beta3.DocumentMetadata.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - message.totalSize = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.ListDocumentsResponse} ListDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDocumentsResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDocumentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentMetadata != null && message.hasOwnProperty("documentMetadata")) { - if (!Array.isArray(message.documentMetadata)) - return "documentMetadata: array expected"; - for (var i = 0; i < message.documentMetadata.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.DocumentMetadata.verify(message.documentMetadata[i]); - if (error) - return "documentMetadata." + 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"; - return null; - }; - - /** - * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.ListDocumentsResponse} ListDocumentsResponse - */ - ListDocumentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.ListDocumentsResponse) - return object; - var message = new $root.google.cloud.documentai.v1beta3.ListDocumentsResponse(); - if (object.documentMetadata) { - if (!Array.isArray(object.documentMetadata)) - throw TypeError(".google.cloud.documentai.v1beta3.ListDocumentsResponse.documentMetadata: array expected"); - message.documentMetadata = []; - for (var i = 0; i < object.documentMetadata.length; ++i) { - if (typeof object.documentMetadata[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.ListDocumentsResponse.documentMetadata: object expected"); - message.documentMetadata[i] = $root.google.cloud.documentai.v1beta3.DocumentMetadata.fromObject(object.documentMetadata[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.totalSize != null) - message.totalSize = object.totalSize | 0; - return message; - }; - - /** - * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @static - * @param {google.cloud.documentai.v1beta3.ListDocumentsResponse} message ListDocumentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDocumentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documentMetadata = []; - if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.documentMetadata && message.documentMetadata.length) { - object.documentMetadata = []; - for (var j = 0; j < message.documentMetadata.length; ++j) - object.documentMetadata[j] = $root.google.cloud.documentai.v1beta3.DocumentMetadata.toObject(message.documentMetadata[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; - return object; - }; - - /** - * Converts this ListDocumentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListDocumentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDocumentsResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.ListDocumentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.ListDocumentsResponse"; - }; - - return ListDocumentsResponse; - })(); - - v1beta3.BatchDeleteDocumentsRequest = (function() { - - /** - * Properties of a BatchDeleteDocumentsRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IBatchDeleteDocumentsRequest - * @property {string|null} [dataset] BatchDeleteDocumentsRequest dataset - * @property {google.cloud.documentai.v1beta3.IBatchDatasetDocuments|null} [datasetDocuments] BatchDeleteDocumentsRequest datasetDocuments - */ - - /** - * Constructs a new BatchDeleteDocumentsRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a BatchDeleteDocumentsRequest. - * @implements IBatchDeleteDocumentsRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest=} [properties] Properties to set - */ - function BatchDeleteDocumentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDeleteDocumentsRequest dataset. - * @member {string} dataset - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest - * @instance - */ - BatchDeleteDocumentsRequest.prototype.dataset = ""; - - /** - * BatchDeleteDocumentsRequest datasetDocuments. - * @member {google.cloud.documentai.v1beta3.IBatchDatasetDocuments|null|undefined} datasetDocuments - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest - * @instance - */ - BatchDeleteDocumentsRequest.prototype.datasetDocuments = null; - - /** - * Creates a new BatchDeleteDocumentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest} BatchDeleteDocumentsRequest instance - */ - BatchDeleteDocumentsRequest.create = function create(properties) { - return new BatchDeleteDocumentsRequest(properties); - }; - - /** - * Encodes the specified BatchDeleteDocumentsRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest} message BatchDeleteDocumentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteDocumentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); - if (message.datasetDocuments != null && Object.hasOwnProperty.call(message, "datasetDocuments")) - $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.encode(message.datasetDocuments, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BatchDeleteDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest} message BatchDeleteDocumentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchDeleteDocumentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest} BatchDeleteDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteDocumentsRequest.decode = function decode(reader, 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.v1beta3.BatchDeleteDocumentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.dataset = reader.string(); - break; - } - case 3: { - message.datasetDocuments = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchDeleteDocumentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest} BatchDeleteDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchDeleteDocumentsRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDeleteDocumentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataset != null && message.hasOwnProperty("dataset")) - if (!$util.isString(message.dataset)) - return "dataset: string expected"; - if (message.datasetDocuments != null && message.hasOwnProperty("datasetDocuments")) { - var error = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.verify(message.datasetDocuments); - if (error) - return "datasetDocuments." + error; - } - return null; - }; - - /** - * Creates a BatchDeleteDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest} BatchDeleteDocumentsRequest - */ - BatchDeleteDocumentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest(); - if (object.dataset != null) - message.dataset = String(object.dataset); - if (object.datasetDocuments != null) { - if (typeof object.datasetDocuments !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest.datasetDocuments: object expected"); - message.datasetDocuments = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.fromObject(object.datasetDocuments); - } - return message; - }; - - /** - * Creates a plain object from a BatchDeleteDocumentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest - * @static - * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest} message BatchDeleteDocumentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDeleteDocumentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.dataset = ""; - object.datasetDocuments = null; - } - if (message.dataset != null && message.hasOwnProperty("dataset")) - object.dataset = message.dataset; - if (message.datasetDocuments != null && message.hasOwnProperty("datasetDocuments")) - object.datasetDocuments = $root.google.cloud.documentai.v1beta3.BatchDatasetDocuments.toObject(message.datasetDocuments, options); - return object; - }; - - /** - * Converts this BatchDeleteDocumentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest - * @instance - * @returns {Object.} JSON object - */ - BatchDeleteDocumentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchDeleteDocumentsRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchDeleteDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest"; - }; - - return BatchDeleteDocumentsRequest; - })(); - - v1beta3.BatchDeleteDocumentsResponse = (function() { - - /** - * Properties of a BatchDeleteDocumentsResponse. - * @memberof google.cloud.documentai.v1beta3 - * @interface IBatchDeleteDocumentsResponse - */ - - /** - * Constructs a new BatchDeleteDocumentsResponse. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a BatchDeleteDocumentsResponse. - * @implements IBatchDeleteDocumentsResponse - * @constructor - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse=} [properties] Properties to set - */ - function BatchDeleteDocumentsResponse(properties) { - if (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 BatchDeleteDocumentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse} BatchDeleteDocumentsResponse instance - */ - BatchDeleteDocumentsResponse.create = function create(properties) { - return new BatchDeleteDocumentsResponse(properties); - }; - - /** - * Encodes the specified BatchDeleteDocumentsResponse message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse} message BatchDeleteDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteDocumentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified BatchDeleteDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsResponse} message BatchDeleteDocumentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchDeleteDocumentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse} BatchDeleteDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteDocumentsResponse.decode = function decode(reader, 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.v1beta3.BatchDeleteDocumentsResponse(); - 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 BatchDeleteDocumentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse} BatchDeleteDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchDeleteDocumentsResponse message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDeleteDocumentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a BatchDeleteDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse} BatchDeleteDocumentsResponse - */ - BatchDeleteDocumentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse) - return object; - return new $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse(); - }; - - /** - * Creates a plain object from a BatchDeleteDocumentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse - * @static - * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse} message BatchDeleteDocumentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDeleteDocumentsResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this BatchDeleteDocumentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse - * @instance - * @returns {Object.} JSON object - */ - BatchDeleteDocumentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchDeleteDocumentsResponse - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchDeleteDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse"; - }; - - return BatchDeleteDocumentsResponse; - })(); - - v1beta3.BatchDeleteDocumentsMetadata = (function() { - - /** - * Properties of a BatchDeleteDocumentsMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IBatchDeleteDocumentsMetadata - * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] BatchDeleteDocumentsMetadata commonMetadata - * @property {Array.|null} [individualBatchDeleteStatuses] BatchDeleteDocumentsMetadata individualBatchDeleteStatuses - * @property {number|null} [totalDocumentCount] BatchDeleteDocumentsMetadata totalDocumentCount - * @property {number|null} [errorDocumentCount] BatchDeleteDocumentsMetadata errorDocumentCount - */ - - /** - * Constructs a new BatchDeleteDocumentsMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a BatchDeleteDocumentsMetadata. - * @implements IBatchDeleteDocumentsMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata=} [properties] Properties to set - */ - function BatchDeleteDocumentsMetadata(properties) { - this.individualBatchDeleteStatuses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDeleteDocumentsMetadata commonMetadata. - * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @instance - */ - BatchDeleteDocumentsMetadata.prototype.commonMetadata = null; - - /** - * BatchDeleteDocumentsMetadata individualBatchDeleteStatuses. - * @member {Array.} individualBatchDeleteStatuses - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @instance - */ - BatchDeleteDocumentsMetadata.prototype.individualBatchDeleteStatuses = $util.emptyArray; - - /** - * BatchDeleteDocumentsMetadata totalDocumentCount. - * @member {number} totalDocumentCount - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @instance - */ - BatchDeleteDocumentsMetadata.prototype.totalDocumentCount = 0; - - /** - * BatchDeleteDocumentsMetadata errorDocumentCount. - * @member {number} errorDocumentCount - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @instance - */ - BatchDeleteDocumentsMetadata.prototype.errorDocumentCount = 0; - - /** - * Creates a new BatchDeleteDocumentsMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata} BatchDeleteDocumentsMetadata instance - */ - BatchDeleteDocumentsMetadata.create = function create(properties) { - return new BatchDeleteDocumentsMetadata(properties); - }; - - /** - * Encodes the specified BatchDeleteDocumentsMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata} message BatchDeleteDocumentsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteDocumentsMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) - $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.individualBatchDeleteStatuses != null && message.individualBatchDeleteStatuses.length) - for (var i = 0; i < message.individualBatchDeleteStatuses.length; ++i) - $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.encode(message.individualBatchDeleteStatuses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.totalDocumentCount != null && Object.hasOwnProperty.call(message, "totalDocumentCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalDocumentCount); - if (message.errorDocumentCount != null && Object.hasOwnProperty.call(message, "errorDocumentCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.errorDocumentCount); - return writer; - }; - - /** - * Encodes the specified BatchDeleteDocumentsMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IBatchDeleteDocumentsMetadata} message BatchDeleteDocumentsMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteDocumentsMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchDeleteDocumentsMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata} BatchDeleteDocumentsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteDocumentsMetadata.decode = function decode(reader, 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.v1beta3.BatchDeleteDocumentsMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.individualBatchDeleteStatuses && message.individualBatchDeleteStatuses.length)) - message.individualBatchDeleteStatuses = []; - message.individualBatchDeleteStatuses.push($root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.decode(reader, reader.uint32())); - break; - } - case 3: { - message.totalDocumentCount = reader.int32(); - break; - } - case 4: { - message.errorDocumentCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchDeleteDocumentsMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata} BatchDeleteDocumentsMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteDocumentsMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchDeleteDocumentsMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDeleteDocumentsMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { - var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); - if (error) - return "commonMetadata." + error; - } - if (message.individualBatchDeleteStatuses != null && message.hasOwnProperty("individualBatchDeleteStatuses")) { - if (!Array.isArray(message.individualBatchDeleteStatuses)) - return "individualBatchDeleteStatuses: array expected"; - for (var i = 0; i < message.individualBatchDeleteStatuses.length; ++i) { - var error = $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.verify(message.individualBatchDeleteStatuses[i]); - if (error) - return "individualBatchDeleteStatuses." + error; - } - } - if (message.totalDocumentCount != null && message.hasOwnProperty("totalDocumentCount")) - if (!$util.isInteger(message.totalDocumentCount)) - return "totalDocumentCount: integer expected"; - if (message.errorDocumentCount != null && message.hasOwnProperty("errorDocumentCount")) - if (!$util.isInteger(message.errorDocumentCount)) - return "errorDocumentCount: integer expected"; - return null; - }; - - /** - * Creates a BatchDeleteDocumentsMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata} BatchDeleteDocumentsMetadata - */ - BatchDeleteDocumentsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata(); - if (object.commonMetadata != null) { - if (typeof object.commonMetadata !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.commonMetadata: object expected"); - message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); - } - if (object.individualBatchDeleteStatuses) { - if (!Array.isArray(object.individualBatchDeleteStatuses)) - throw TypeError(".google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.individualBatchDeleteStatuses: array expected"); - message.individualBatchDeleteStatuses = []; - for (var i = 0; i < object.individualBatchDeleteStatuses.length; ++i) { - if (typeof object.individualBatchDeleteStatuses[i] !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.individualBatchDeleteStatuses: object expected"); - message.individualBatchDeleteStatuses[i] = $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.fromObject(object.individualBatchDeleteStatuses[i]); - } - } - if (object.totalDocumentCount != null) - message.totalDocumentCount = object.totalDocumentCount | 0; - if (object.errorDocumentCount != null) - message.errorDocumentCount = object.errorDocumentCount | 0; - return message; - }; - - /** - * Creates a plain object from a BatchDeleteDocumentsMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @static - * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata} message BatchDeleteDocumentsMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDeleteDocumentsMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.individualBatchDeleteStatuses = []; - if (options.defaults) { - object.commonMetadata = null; - object.totalDocumentCount = 0; - object.errorDocumentCount = 0; - } - if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) - object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); - if (message.individualBatchDeleteStatuses && message.individualBatchDeleteStatuses.length) { - object.individualBatchDeleteStatuses = []; - for (var j = 0; j < message.individualBatchDeleteStatuses.length; ++j) - object.individualBatchDeleteStatuses[j] = $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.toObject(message.individualBatchDeleteStatuses[j], options); - } - if (message.totalDocumentCount != null && message.hasOwnProperty("totalDocumentCount")) - object.totalDocumentCount = message.totalDocumentCount; - if (message.errorDocumentCount != null && message.hasOwnProperty("errorDocumentCount")) - object.errorDocumentCount = message.errorDocumentCount; - return object; - }; - - /** - * Converts this BatchDeleteDocumentsMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @instance - * @returns {Object.} JSON object - */ - BatchDeleteDocumentsMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchDeleteDocumentsMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchDeleteDocumentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata"; - }; - - BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus = (function() { - - /** - * Properties of an IndividualBatchDeleteStatus. - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @interface IIndividualBatchDeleteStatus - * @property {google.cloud.documentai.v1beta3.IDocumentId|null} [documentId] IndividualBatchDeleteStatus documentId - * @property {google.rpc.IStatus|null} [status] IndividualBatchDeleteStatus status - */ - - /** - * Constructs a new IndividualBatchDeleteStatus. - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata - * @classdesc Represents an IndividualBatchDeleteStatus. - * @implements IIndividualBatchDeleteStatus - * @constructor - * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus=} [properties] Properties to set - */ - function IndividualBatchDeleteStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IndividualBatchDeleteStatus documentId. - * @member {google.cloud.documentai.v1beta3.IDocumentId|null|undefined} documentId - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus - * @instance - */ - IndividualBatchDeleteStatus.prototype.documentId = null; - - /** - * IndividualBatchDeleteStatus status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus - * @instance - */ - IndividualBatchDeleteStatus.prototype.status = null; - - /** - * Creates a new IndividualBatchDeleteStatus instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus - * @static - * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus} IndividualBatchDeleteStatus instance - */ - IndividualBatchDeleteStatus.create = function create(properties) { - return new IndividualBatchDeleteStatus(properties); - }; - - /** - * Encodes the specified IndividualBatchDeleteStatus message. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus - * @static - * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus} message IndividualBatchDeleteStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualBatchDeleteStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) - $root.google.cloud.documentai.v1beta3.DocumentId.encode(message.documentId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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 IndividualBatchDeleteStatus message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus - * @static - * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IIndividualBatchDeleteStatus} message IndividualBatchDeleteStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndividualBatchDeleteStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IndividualBatchDeleteStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus} IndividualBatchDeleteStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualBatchDeleteStatus.decode = function decode(reader, 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.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.decode(reader, reader.uint32()); - break; - } - case 2: { - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IndividualBatchDeleteStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus} IndividualBatchDeleteStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndividualBatchDeleteStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IndividualBatchDeleteStatus message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndividualBatchDeleteStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentId != null && message.hasOwnProperty("documentId")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentId.verify(message.documentId); - if (error) - return "documentId." + error; - } - 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 IndividualBatchDeleteStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus} IndividualBatchDeleteStatus - */ - IndividualBatchDeleteStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus) - return object; - var message = new $root.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus(); - if (object.documentId != null) { - if (typeof object.documentId !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.documentId: object expected"); - message.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.fromObject(object.documentId); - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - return message; - }; - - /** - * Creates a plain object from an IndividualBatchDeleteStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus - * @static - * @param {google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus} message IndividualBatchDeleteStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndividualBatchDeleteStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.documentId = null; - object.status = null; - } - if (message.documentId != null && message.hasOwnProperty("documentId")) - object.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.toObject(message.documentId, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - return object; - }; - - /** - * Converts this IndividualBatchDeleteStatus to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus - * @instance - * @returns {Object.} JSON object - */ - IndividualBatchDeleteStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IndividualBatchDeleteStatus - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndividualBatchDeleteStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata.IndividualBatchDeleteStatus"; - }; - - return IndividualBatchDeleteStatus; - })(); - - return BatchDeleteDocumentsMetadata; - })(); - - v1beta3.GetDatasetSchemaRequest = (function() { - - /** - * Properties of a GetDatasetSchemaRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IGetDatasetSchemaRequest - * @property {string|null} [name] GetDatasetSchemaRequest name - * @property {boolean|null} [visibleFieldsOnly] GetDatasetSchemaRequest visibleFieldsOnly - */ - - /** - * Constructs a new GetDatasetSchemaRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a GetDatasetSchemaRequest. - * @implements IGetDatasetSchemaRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest=} [properties] Properties to set - */ - function GetDatasetSchemaRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDatasetSchemaRequest name. - * @member {string} name - * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest - * @instance - */ - GetDatasetSchemaRequest.prototype.name = ""; - - /** - * GetDatasetSchemaRequest visibleFieldsOnly. - * @member {boolean} visibleFieldsOnly - * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest - * @instance - */ - GetDatasetSchemaRequest.prototype.visibleFieldsOnly = false; - - /** - * Creates a new GetDatasetSchemaRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.GetDatasetSchemaRequest} GetDatasetSchemaRequest instance - */ - GetDatasetSchemaRequest.create = function create(properties) { - return new GetDatasetSchemaRequest(properties); - }; - - /** - * Encodes the specified GetDatasetSchemaRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDatasetSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest} message GetDatasetSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatasetSchemaRequest.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.visibleFieldsOnly != null && Object.hasOwnProperty.call(message, "visibleFieldsOnly")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.visibleFieldsOnly); - return writer; - }; - - /** - * Encodes the specified GetDatasetSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.GetDatasetSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest - * @static - * @param {google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest} message GetDatasetSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDatasetSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDatasetSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.GetDatasetSchemaRequest} GetDatasetSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatasetSchemaRequest.decode = function decode(reader, 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.v1beta3.GetDatasetSchemaRequest(); - 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.visibleFieldsOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetDatasetSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.GetDatasetSchemaRequest} GetDatasetSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDatasetSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDatasetSchemaRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDatasetSchemaRequest.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.visibleFieldsOnly != null && message.hasOwnProperty("visibleFieldsOnly")) - if (typeof message.visibleFieldsOnly !== "boolean") - return "visibleFieldsOnly: boolean expected"; - return null; - }; - - /** - * Creates a GetDatasetSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.GetDatasetSchemaRequest} GetDatasetSchemaRequest - */ - GetDatasetSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.visibleFieldsOnly != null) - message.visibleFieldsOnly = Boolean(object.visibleFieldsOnly); - return message; - }; - - /** - * Creates a plain object from a GetDatasetSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest - * @static - * @param {google.cloud.documentai.v1beta3.GetDatasetSchemaRequest} message GetDatasetSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDatasetSchemaRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.visibleFieldsOnly = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.visibleFieldsOnly != null && message.hasOwnProperty("visibleFieldsOnly")) - object.visibleFieldsOnly = message.visibleFieldsOnly; - return object; - }; - - /** - * Converts this GetDatasetSchemaRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - GetDatasetSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDatasetSchemaRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.GetDatasetSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDatasetSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.GetDatasetSchemaRequest"; - }; - - return GetDatasetSchemaRequest; - })(); - - v1beta3.UpdateDatasetSchemaRequest = (function() { - - /** - * Properties of an UpdateDatasetSchemaRequest. - * @memberof google.cloud.documentai.v1beta3 - * @interface IUpdateDatasetSchemaRequest - * @property {google.cloud.documentai.v1beta3.IDatasetSchema|null} [datasetSchema] UpdateDatasetSchemaRequest datasetSchema - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDatasetSchemaRequest updateMask - */ - - /** - * Constructs a new UpdateDatasetSchemaRequest. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents an UpdateDatasetSchemaRequest. - * @implements IUpdateDatasetSchemaRequest - * @constructor - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest=} [properties] Properties to set - */ - function UpdateDatasetSchemaRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDatasetSchemaRequest datasetSchema. - * @member {google.cloud.documentai.v1beta3.IDatasetSchema|null|undefined} datasetSchema - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest - * @instance - */ - UpdateDatasetSchemaRequest.prototype.datasetSchema = null; - - /** - * UpdateDatasetSchemaRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest - * @instance - */ - UpdateDatasetSchemaRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateDatasetSchemaRequest instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest - * @static - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} UpdateDatasetSchemaRequest instance - */ - UpdateDatasetSchemaRequest.create = function create(properties) { - return new UpdateDatasetSchemaRequest(properties); - }; - - /** - * Encodes the specified UpdateDatasetSchemaRequest message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest - * @static - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest} message UpdateDatasetSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatasetSchemaRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.datasetSchema != null && Object.hasOwnProperty.call(message, "datasetSchema")) - $root.google.cloud.documentai.v1beta3.DatasetSchema.encode(message.datasetSchema, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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(); - return writer; - }; - - /** - * Encodes the specified UpdateDatasetSchemaRequest message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest - * @static - * @param {google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest} message UpdateDatasetSchemaRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDatasetSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDatasetSchemaRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} UpdateDatasetSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatasetSchemaRequest.decode = function decode(reader, 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.v1beta3.UpdateDatasetSchemaRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.datasetSchema = $root.google.cloud.documentai.v1beta3.DatasetSchema.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDatasetSchemaRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} UpdateDatasetSchemaRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDatasetSchemaRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDatasetSchemaRequest message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDatasetSchemaRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.datasetSchema != null && message.hasOwnProperty("datasetSchema")) { - var error = $root.google.cloud.documentai.v1beta3.DatasetSchema.verify(message.datasetSchema); - if (error) - return "datasetSchema." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateDatasetSchemaRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} UpdateDatasetSchemaRequest - */ - UpdateDatasetSchemaRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest) - return object; - var message = new $root.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest(); - if (object.datasetSchema != null) { - if (typeof object.datasetSchema !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.datasetSchema: object expected"); - message.datasetSchema = $root.google.cloud.documentai.v1beta3.DatasetSchema.fromObject(object.datasetSchema); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateDatasetSchemaRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest - * @static - * @param {google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest} message UpdateDatasetSchemaRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDatasetSchemaRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.datasetSchema = null; - object.updateMask = null; - } - if (message.datasetSchema != null && message.hasOwnProperty("datasetSchema")) - object.datasetSchema = $root.google.cloud.documentai.v1beta3.DatasetSchema.toObject(message.datasetSchema, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateDatasetSchemaRequest to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDatasetSchemaRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDatasetSchemaRequest - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDatasetSchemaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest"; - }; - - return UpdateDatasetSchemaRequest; - })(); - - v1beta3.DocumentPageRange = (function() { - - /** - * Properties of a DocumentPageRange. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDocumentPageRange - * @property {number|null} [start] DocumentPageRange start - * @property {number|null} [end] DocumentPageRange end - */ - - /** - * Constructs a new DocumentPageRange. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DocumentPageRange. - * @implements IDocumentPageRange - * @constructor - * @param {google.cloud.documentai.v1beta3.IDocumentPageRange=} [properties] Properties to set - */ - function DocumentPageRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DocumentPageRange start. - * @member {number} start - * @memberof google.cloud.documentai.v1beta3.DocumentPageRange - * @instance - */ - DocumentPageRange.prototype.start = 0; - - /** - * DocumentPageRange end. - * @member {number} end - * @memberof google.cloud.documentai.v1beta3.DocumentPageRange - * @instance - */ - DocumentPageRange.prototype.end = 0; - - /** - * Creates a new DocumentPageRange instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentPageRange - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentPageRange=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentPageRange} DocumentPageRange instance - */ - DocumentPageRange.create = function create(properties) { - return new DocumentPageRange(properties); - }; - - /** - * Encodes the specified DocumentPageRange message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentPageRange.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentPageRange - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentPageRange} message DocumentPageRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentPageRange.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 DocumentPageRange message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentPageRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentPageRange - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentPageRange} message DocumentPageRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentPageRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentPageRange message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentPageRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DocumentPageRange} DocumentPageRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentPageRange.decode = function decode(reader, 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.v1beta3.DocumentPageRange(); - 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 DocumentPageRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentPageRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentPageRange} DocumentPageRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentPageRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentPageRange message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentPageRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentPageRange.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 DocumentPageRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentPageRange - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentPageRange} DocumentPageRange - */ - DocumentPageRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentPageRange) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentPageRange(); - 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 DocumentPageRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentPageRange - * @static - * @param {google.cloud.documentai.v1beta3.DocumentPageRange} message DocumentPageRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentPageRange.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 DocumentPageRange to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentPageRange - * @instance - * @returns {Object.} JSON object - */ - DocumentPageRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentPageRange - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DocumentPageRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentPageRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentPageRange"; - }; - - return DocumentPageRange; - })(); - - v1beta3.DocumentMetadata = (function() { - - /** - * Properties of a DocumentMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @interface IDocumentMetadata - * @property {google.cloud.documentai.v1beta3.IDocumentId|null} [documentId] DocumentMetadata documentId - * @property {number|null} [pageCount] DocumentMetadata pageCount - * @property {google.cloud.documentai.v1beta3.DatasetSplitType|null} [datasetType] DocumentMetadata datasetType - * @property {google.cloud.documentai.v1beta3.DocumentLabelingState|null} [labelingState] DocumentMetadata labelingState - * @property {string|null} [displayName] DocumentMetadata displayName - */ - - /** - * Constructs a new DocumentMetadata. - * @memberof google.cloud.documentai.v1beta3 - * @classdesc Represents a DocumentMetadata. - * @implements IDocumentMetadata - * @constructor - * @param {google.cloud.documentai.v1beta3.IDocumentMetadata=} [properties] Properties to set - */ - function DocumentMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DocumentMetadata documentId. - * @member {google.cloud.documentai.v1beta3.IDocumentId|null|undefined} documentId - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @instance - */ - DocumentMetadata.prototype.documentId = null; - - /** - * DocumentMetadata pageCount. - * @member {number} pageCount - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @instance - */ - DocumentMetadata.prototype.pageCount = 0; - - /** - * DocumentMetadata datasetType. - * @member {google.cloud.documentai.v1beta3.DatasetSplitType} datasetType - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @instance - */ - DocumentMetadata.prototype.datasetType = 0; - - /** - * DocumentMetadata labelingState. - * @member {google.cloud.documentai.v1beta3.DocumentLabelingState} labelingState - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @instance - */ - DocumentMetadata.prototype.labelingState = 0; - - /** - * DocumentMetadata displayName. - * @member {string} displayName - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @instance - */ - DocumentMetadata.prototype.displayName = ""; - - /** - * Creates a new DocumentMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentMetadata=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.DocumentMetadata} DocumentMetadata instance - */ - DocumentMetadata.create = function create(properties) { - return new DocumentMetadata(properties); - }; - - /** - * Encodes the specified DocumentMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentMetadata} message DocumentMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.documentId != null && Object.hasOwnProperty.call(message, "documentId")) - $root.google.cloud.documentai.v1beta3.DocumentId.encode(message.documentId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pageCount != null && Object.hasOwnProperty.call(message, "pageCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageCount); - if (message.datasetType != null && Object.hasOwnProperty.call(message, "datasetType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.datasetType); - if (message.labelingState != null && Object.hasOwnProperty.call(message, "labelingState")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.labelingState); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified DocumentMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.DocumentMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @static - * @param {google.cloud.documentai.v1beta3.IDocumentMetadata} message DocumentMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DocumentMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DocumentMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.DocumentMetadata} DocumentMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentMetadata.decode = function decode(reader, 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.v1beta3.DocumentMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.decode(reader, reader.uint32()); - break; - } - case 2: { - message.pageCount = reader.int32(); - break; - } - case 3: { - message.datasetType = reader.int32(); - break; - } - case 5: { - message.labelingState = reader.int32(); - break; - } - case 6: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DocumentMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.DocumentMetadata} DocumentMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DocumentMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DocumentMetadata message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DocumentMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.documentId != null && message.hasOwnProperty("documentId")) { - var error = $root.google.cloud.documentai.v1beta3.DocumentId.verify(message.documentId); - if (error) - return "documentId." + error; - } - if (message.pageCount != null && message.hasOwnProperty("pageCount")) - if (!$util.isInteger(message.pageCount)) - return "pageCount: integer expected"; - if (message.datasetType != null && message.hasOwnProperty("datasetType")) - switch (message.datasetType) { - default: - return "datasetType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.labelingState != null && message.hasOwnProperty("labelingState")) - switch (message.labelingState) { - default: - return "labelingState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates a DocumentMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.DocumentMetadata} DocumentMetadata - */ - DocumentMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.DocumentMetadata) - return object; - var message = new $root.google.cloud.documentai.v1beta3.DocumentMetadata(); - if (object.documentId != null) { - if (typeof object.documentId !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.DocumentMetadata.documentId: object expected"); - message.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.fromObject(object.documentId); - } - if (object.pageCount != null) - message.pageCount = object.pageCount | 0; - switch (object.datasetType) { - default: - if (typeof object.datasetType === "number") { - message.datasetType = object.datasetType; - break; - } - break; - case "DATASET_SPLIT_TYPE_UNSPECIFIED": - case 0: - message.datasetType = 0; - break; - case "DATASET_SPLIT_TRAIN": - case 1: - message.datasetType = 1; - break; - case "DATASET_SPLIT_TEST": - case 2: - message.datasetType = 2; - break; - case "DATASET_SPLIT_UNASSIGNED": - case 3: - message.datasetType = 3; - break; - } - switch (object.labelingState) { - default: - if (typeof object.labelingState === "number") { - message.labelingState = object.labelingState; - break; - } - break; - case "DOCUMENT_LABELING_STATE_UNSPECIFIED": - case 0: - message.labelingState = 0; - break; - case "DOCUMENT_LABELED": - case 1: - message.labelingState = 1; - break; - case "DOCUMENT_UNLABELED": - case 2: - message.labelingState = 2; - break; - case "DOCUMENT_AUTO_LABELED": - case 3: - message.labelingState = 3; - break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from a DocumentMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @static - * @param {google.cloud.documentai.v1beta3.DocumentMetadata} message DocumentMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DocumentMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.documentId = null; - object.pageCount = 0; - object.datasetType = options.enums === String ? "DATASET_SPLIT_TYPE_UNSPECIFIED" : 0; - object.labelingState = options.enums === String ? "DOCUMENT_LABELING_STATE_UNSPECIFIED" : 0; - object.displayName = ""; - } - if (message.documentId != null && message.hasOwnProperty("documentId")) - object.documentId = $root.google.cloud.documentai.v1beta3.DocumentId.toObject(message.documentId, options); - if (message.pageCount != null && message.hasOwnProperty("pageCount")) - object.pageCount = message.pageCount; - if (message.datasetType != null && message.hasOwnProperty("datasetType")) - object.datasetType = options.enums === String ? $root.google.cloud.documentai.v1beta3.DatasetSplitType[message.datasetType] === undefined ? message.datasetType : $root.google.cloud.documentai.v1beta3.DatasetSplitType[message.datasetType] : message.datasetType; - if (message.labelingState != null && message.hasOwnProperty("labelingState")) - object.labelingState = options.enums === String ? $root.google.cloud.documentai.v1beta3.DocumentLabelingState[message.labelingState] === undefined ? message.labelingState : $root.google.cloud.documentai.v1beta3.DocumentLabelingState[message.labelingState] : message.labelingState; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this DocumentMetadata to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @instance - * @returns {Object.} JSON object - */ - DocumentMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DocumentMetadata - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.DocumentMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DocumentMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.DocumentMetadata"; - }; - - return DocumentMetadata; - })(); - - return v1beta3; - })(); - - 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.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; - })(); - - 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; - })(); - - 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.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.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.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; - })(); - - return type; - })(); - - 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-documentai/protos/protos.json b/owl-bot-staging/google-cloud-documentai/protos/protos.json deleted file mode 100644 index 439c727fdc6..00000000000 --- a/owl-bot-staging/google-cloud-documentai/protos/protos.json +++ /dev/null @@ -1,11380 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "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": "DocumentAiProcessorType", - "java_package": "com.google.cloud.documentai.v1", - "php_namespace": "Google\\Cloud\\DocumentAI\\V1", - "ruby_package": "Google::Cloud::DocumentAI::V1", - "(google.api.resource_definition).type": "documentai.googleapis.com/Location", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}" - }, - "nested": { - "Barcode": { - "fields": { - "format": { - "type": "string", - "id": 1 - }, - "valueFormat": { - "type": "string", - "id": 2 - }, - "rawValue": { - "type": "string", - "id": 3 - } - } - }, - "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 - } - } - } - } - }, - "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 - } - } - }, - "RawDocument": { - "fields": { - "content": { - "type": "bytes", - "id": 1 - }, - "mimeType": { - "type": "string", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3 - } - } - }, - "GcsDocument": { - "fields": { - "gcsUri": { - "type": "string", - "id": 1 - }, - "mimeType": { - "type": "string", - "id": 2 - } - } - }, - "GcsDocuments": { - "fields": { - "documents": { - "rule": "repeated", - "type": "GcsDocument", - "id": 1 - } - } - }, - "GcsPrefix": { - "fields": { - "gcsUriPrefix": { - "type": "string", - "id": 1 - } - } - }, - "BatchDocumentsInputConfig": { - "oneofs": { - "source": { - "oneof": [ - "gcsPrefix", - "gcsDocuments" - ] - } - }, - "fields": { - "gcsPrefix": { - "type": "GcsPrefix", - "id": 1 - }, - "gcsDocuments": { - "type": "GcsDocuments", - "id": 2 - } - } - }, - "DocumentOutputConfig": { - "oneofs": { - "destination": { - "oneof": [ - "gcsOutputConfig" - ] - } - }, - "fields": { - "gcsOutputConfig": { - "type": "GcsOutputConfig", - "id": 1 - } - }, - "nested": { - "GcsOutputConfig": { - "fields": { - "gcsUri": { - "type": "string", - "id": 1 - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - }, - "shardingConfig": { - "type": "ShardingConfig", - "id": 3 - } - }, - "nested": { - "ShardingConfig": { - "fields": { - "pagesPerShard": { - "type": "int32", - "id": 1 - }, - "pagesOverlap": { - "type": "int32", - "id": 2 - } - } - } - } - } - } - }, - "OcrConfig": { - "fields": { - "hints": { - "type": "Hints", - "id": 2 - }, - "enableNativePdfParsing": { - "type": "bool", - "id": 3 - }, - "enableImageQualityScores": { - "type": "bool", - "id": 4 - }, - "advancedOcrOptions": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "enableSymbol": { - "type": "bool", - "id": 6 - }, - "computeStyleInfo": { - "type": "bool", - "id": 8, - "options": { - "deprecated": true - } - }, - "disableCharacterBoxesDetection": { - "type": "bool", - "id": 10 - }, - "premiumFeatures": { - "type": "PremiumFeatures", - "id": 11 - } - }, - "nested": { - "Hints": { - "fields": { - "languageHints": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "PremiumFeatures": { - "fields": { - "enableSelectionMarkDetection": { - "type": "bool", - "id": 3 - }, - "computeStyleInfo": { - "type": "bool", - "id": 4 - }, - "enableMathOcr": { - "type": "bool", - "id": 5 - } - } - } - } - }, - "DocumentProcessorService": { - "options": { - "(google.api.default_host)": "documentai.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ProcessDocument": { - "requestType": "ProcessRequest", - "responseType": "ProcessResponse", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/processors/*}:process", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/processors/*}:process", - "body": "*", - "additional_bindings": { - "post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:process", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "BatchProcessDocuments": { - "requestType": "BatchProcessRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/processors/*}:batchProcess", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "BatchProcessResponse", - "(google.longrunning.operation_info).metadata_type": "BatchProcessMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/processors/*}:batchProcess", - "body": "*", - "additional_bindings": { - "post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BatchProcessResponse", - "metadata_type": "BatchProcessMetadata" - } - } - ] - }, - "FetchProcessorTypes": { - "requestType": "FetchProcessorTypesRequest", - "responseType": "FetchProcessorTypesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}:fetchProcessorTypes", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}:fetchProcessorTypes" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListProcessorTypes": { - "requestType": "ListProcessorTypesRequest", - "responseType": "ListProcessorTypesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/processorTypes", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/processorTypes" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetProcessorType": { - "requestType": "GetProcessorTypeRequest", - "responseType": "ProcessorType", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/processorTypes/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/processorTypes/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListProcessors": { - "requestType": "ListProcessorsRequest", - "responseType": "ListProcessorsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/processors", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/processors" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetProcessor": { - "requestType": "GetProcessorRequest", - "responseType": "Processor", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/processors/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/processors/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "TrainProcessorVersion": { - "requestType": "TrainProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions:train", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,processor_version", - "(google.longrunning.operation_info).response_type": "TrainProcessorVersionResponse", - "(google.longrunning.operation_info).metadata_type": "TrainProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions:train", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,processor_version" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "TrainProcessorVersionResponse", - "metadata_type": "TrainProcessorVersionMetadata" - } - } - ] - }, - "GetProcessorVersion": { - "requestType": "GetProcessorVersionRequest", - "responseType": "ProcessorVersion", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListProcessorVersions": { - "requestType": "ListProcessorVersionsRequest", - "responseType": "ListProcessorVersionsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/processors/*}/processorVersions" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteProcessorVersion": { - "requestType": "DeleteProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "DeleteProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "DeleteProcessorVersionMetadata" - } - } - ] - }, - "DeployProcessorVersion": { - "requestType": "DeployProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "DeployProcessorVersionResponse", - "(google.longrunning.operation_info).metadata_type": "DeployProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "DeployProcessorVersionResponse", - "metadata_type": "DeployProcessorVersionMetadata" - } - } - ] - }, - "UndeployProcessorVersion": { - "requestType": "UndeployProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "UndeployProcessorVersionResponse", - "(google.longrunning.operation_info).metadata_type": "UndeployProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "UndeployProcessorVersionResponse", - "metadata_type": "UndeployProcessorVersionMetadata" - } - } - ] - }, - "CreateProcessor": { - "requestType": "CreateProcessorRequest", - "responseType": "Processor", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/processors", - "(google.api.http).body": "processor", - "(google.api.method_signature)": "parent,processor" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/processors", - "body": "processor" - } - }, - { - "(google.api.method_signature)": "parent,processor" - } - ] - }, - "DeleteProcessor": { - "requestType": "DeleteProcessorRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/processors/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "DeleteProcessorMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/processors/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "DeleteProcessorMetadata" - } - } - ] - }, - "EnableProcessor": { - "requestType": "EnableProcessorRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/processors/*}:enable", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "EnableProcessorResponse", - "(google.longrunning.operation_info).metadata_type": "EnableProcessorMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/processors/*}:enable", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "EnableProcessorResponse", - "metadata_type": "EnableProcessorMetadata" - } - } - ] - }, - "DisableProcessor": { - "requestType": "DisableProcessorRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/processors/*}:disable", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "DisableProcessorResponse", - "(google.longrunning.operation_info).metadata_type": "DisableProcessorMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/processors/*}:disable", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "DisableProcessorResponse", - "metadata_type": "DisableProcessorMetadata" - } - } - ] - }, - "SetDefaultProcessorVersion": { - "requestType": "SetDefaultProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "SetDefaultProcessorVersionResponse", - "(google.longrunning.operation_info).metadata_type": "SetDefaultProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "SetDefaultProcessorVersionResponse", - "metadata_type": "SetDefaultProcessorVersionMetadata" - } - } - ] - }, - "ReviewDocument": { - "requestType": "ReviewDocumentRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument", - "(google.api.http).body": "*", - "(google.api.method_signature)": "human_review_config", - "(google.longrunning.operation_info).response_type": "ReviewDocumentResponse", - "(google.longrunning.operation_info).metadata_type": "ReviewDocumentOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument", - "body": "*" - } - }, - { - "(google.api.method_signature)": "human_review_config" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ReviewDocumentResponse", - "metadata_type": "ReviewDocumentOperationMetadata" - } - } - ] - }, - "EvaluateProcessorVersion": { - "requestType": "EvaluateProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion", - "(google.api.http).body": "*", - "(google.api.method_signature)": "processor_version", - "(google.longrunning.operation_info).response_type": "EvaluateProcessorVersionResponse", - "(google.longrunning.operation_info).metadata_type": "EvaluateProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion", - "body": "*" - } - }, - { - "(google.api.method_signature)": "processor_version" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "EvaluateProcessorVersionResponse", - "metadata_type": "EvaluateProcessorVersionMetadata" - } - } - ] - }, - "GetEvaluation": { - "requestType": "GetEvaluationRequest", - "responseType": "Evaluation", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListEvaluations": { - "requestType": "ListEvaluationsRequest", - "responseType": "ListEvaluationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "ProcessOptions": { - "oneofs": { - "pageRange": { - "oneof": [ - "individualPageSelector", - "fromStart", - "fromEnd" - ] - } - }, - "fields": { - "individualPageSelector": { - "type": "IndividualPageSelector", - "id": 5 - }, - "fromStart": { - "type": "int32", - "id": 6 - }, - "fromEnd": { - "type": "int32", - "id": 7 - }, - "ocrConfig": { - "type": "OcrConfig", - "id": 1 - }, - "layoutConfig": { - "type": "LayoutConfig", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "schemaOverride": { - "type": "DocumentSchema", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "LayoutConfig": { - "fields": { - "chunkingConfig": { - "type": "ChunkingConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "returnImages": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "returnBoundingBoxes": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ChunkingConfig": { - "fields": { - "chunkSize": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "includeAncestorHeadings": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "IndividualPageSelector": { - "fields": { - "pages": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "ProcessRequest": { - "oneofs": { - "source": { - "oneof": [ - "inlineDocument", - "rawDocument", - "gcsDocument" - ] - } - }, - "fields": { - "inlineDocument": { - "type": "Document", - "id": 4 - }, - "rawDocument": { - "type": "RawDocument", - "id": 5 - }, - "gcsDocument": { - "type": "GcsDocument", - "id": 8 - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "skipHumanReview": { - "type": "bool", - "id": 3 - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 6 - }, - "processOptions": { - "type": "ProcessOptions", - "id": 7 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "imagelessMode": { - "type": "bool", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "HumanReviewStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "stateMessage": { - "type": "string", - "id": 2 - }, - "humanReviewOperation": { - "type": "string", - "id": 3 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "SKIPPED": 1, - "VALIDATION_PASSED": 2, - "IN_PROGRESS": 3, - "ERROR": 4 - } - } - } - }, - "ProcessResponse": { - "fields": { - "document": { - "type": "Document", - "id": 1 - }, - "humanReviewStatus": { - "type": "HumanReviewStatus", - "id": 3 - } - } - }, - "BatchProcessRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "inputDocuments": { - "type": "BatchDocumentsInputConfig", - "id": 5 - }, - "documentOutputConfig": { - "type": "DocumentOutputConfig", - "id": 6 - }, - "skipHumanReview": { - "type": "bool", - "id": 4 - }, - "processOptions": { - "type": "ProcessOptions", - "id": 7 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BatchProcessResponse": { - "fields": {} - }, - "BatchProcessMetadata": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "stateMessage": { - "type": "string", - "id": 2 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "individualProcessStatuses": { - "rule": "repeated", - "type": "IndividualProcessStatus", - "id": 5 - } - }, - "nested": { - "IndividualProcessStatus": { - "fields": { - "inputGcsSource": { - "type": "string", - "id": 1 - }, - "status": { - "type": "google.rpc.Status", - "id": 2 - }, - "outputGcsDestination": { - "type": "string", - "id": 3 - }, - "humanReviewStatus": { - "type": "HumanReviewStatus", - "id": 5 - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "WAITING": 1, - "RUNNING": 2, - "SUCCEEDED": 3, - "CANCELLING": 4, - "CANCELLED": 5, - "FAILED": 6 - } - } - } - }, - "FetchProcessorTypesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorType" - } - } - } - }, - "FetchProcessorTypesResponse": { - "fields": { - "processorTypes": { - "rule": "repeated", - "type": "ProcessorType", - "id": 1 - } - } - }, - "ListProcessorTypesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorType" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListProcessorTypesResponse": { - "fields": { - "processorTypes": { - "rule": "repeated", - "type": "ProcessorType", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListProcessorsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "documentai.googleapis.com/Processor" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListProcessorsResponse": { - "fields": { - "processors": { - "rule": "repeated", - "type": "Processor", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetProcessorTypeRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorType" - } - } - } - }, - "GetProcessorRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" - } - } - } - }, - "GetProcessorVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "ListProcessorVersionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorVersion" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListProcessorVersionsResponse": { - "fields": { - "processorVersions": { - "rule": "repeated", - "type": "ProcessorVersion", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteProcessorVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "DeleteProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "DeployProcessorVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "DeployProcessorVersionResponse": { - "fields": {} - }, - "DeployProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "UndeployProcessorVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "UndeployProcessorVersionResponse": { - "fields": {} - }, - "UndeployProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "CreateProcessorRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "documentai.googleapis.com/Processor" - } - }, - "processor": { - "type": "Processor", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteProcessorRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" - } - } - } - }, - "DeleteProcessorMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 5 - } - } - }, - "EnableProcessorRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" - } - } - } - }, - "EnableProcessorResponse": { - "fields": {} - }, - "EnableProcessorMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 5 - } - } - }, - "DisableProcessorRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" - } - } - } - }, - "DisableProcessorResponse": { - "fields": {} - }, - "DisableProcessorMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 5 - } - } - }, - "SetDefaultProcessorVersionRequest": { - "fields": { - "processor": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" - } - }, - "defaultProcessorVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "SetDefaultProcessorVersionResponse": { - "fields": {} - }, - "SetDefaultProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "TrainProcessorVersionRequest": { - "oneofs": { - "processorFlags": { - "oneof": [ - "customDocumentExtractionOptions", - "foundationModelTuningOptions" - ] - } - }, - "fields": { - "customDocumentExtractionOptions": { - "type": "CustomDocumentExtractionOptions", - "id": 5 - }, - "foundationModelTuningOptions": { - "type": "FoundationModelTuningOptions", - "id": 12 - }, - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" - } - }, - "processorVersion": { - "type": "ProcessorVersion", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "documentSchema": { - "type": "DocumentSchema", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "inputData": { - "type": "InputData", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "baseProcessorVersion": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "InputData": { - "fields": { - "trainingDocuments": { - "type": "BatchDocumentsInputConfig", - "id": 3 - }, - "testDocuments": { - "type": "BatchDocumentsInputConfig", - "id": 4 - } - } - }, - "CustomDocumentExtractionOptions": { - "fields": { - "trainingMethod": { - "type": "TrainingMethod", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "TrainingMethod": { - "values": { - "TRAINING_METHOD_UNSPECIFIED": 0, - "MODEL_BASED": 1, - "TEMPLATE_BASED": 2 - } - } - } - }, - "FoundationModelTuningOptions": { - "fields": { - "trainSteps": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "learningRateMultiplier": { - "type": "float", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "TrainProcessorVersionResponse": { - "fields": { - "processorVersion": { - "type": "string", - "id": 1 - } - } - }, - "TrainProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - }, - "trainingDatasetValidation": { - "type": "DatasetValidation", - "id": 2 - }, - "testDatasetValidation": { - "type": "DatasetValidation", - "id": 3 - } - }, - "nested": { - "DatasetValidation": { - "fields": { - "documentErrorCount": { - "type": "int32", - "id": 3 - }, - "datasetErrorCount": { - "type": "int32", - "id": 4 - }, - "documentErrors": { - "rule": "repeated", - "type": "google.rpc.Status", - "id": 1 - }, - "datasetErrors": { - "rule": "repeated", - "type": "google.rpc.Status", - "id": 2 - } - } - } - } - }, - "ReviewDocumentRequest": { - "oneofs": { - "source": { - "oneof": [ - "inlineDocument" - ] - } - }, - "fields": { - "inlineDocument": { - "type": "Document", - "id": 4 - }, - "humanReviewConfig": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/HumanReviewConfig" - } - }, - "enableSchemaValidation": { - "type": "bool", - "id": 3 - }, - "priority": { - "type": "Priority", - "id": 5 - }, - "documentSchema": { - "type": "DocumentSchema", - "id": 6 - } - }, - "nested": { - "Priority": { - "values": { - "DEFAULT": 0, - "URGENT": 1 - } - } - } - }, - "ReviewDocumentResponse": { - "fields": { - "gcsDestination": { - "type": "string", - "id": 1 - }, - "state": { - "type": "State", - "id": 2 - }, - "rejectionReason": { - "type": "string", - "id": 3 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "REJECTED": 1, - "SUCCEEDED": 2 - } - } - } - }, - "ReviewDocumentOperationMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 5 - }, - "questionId": { - "type": "string", - "id": 6 - } - } - }, - "EvaluateProcessorVersionRequest": { - "fields": { - "processorVersion": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - }, - "evaluationDocuments": { - "type": "BatchDocumentsInputConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EvaluateProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "EvaluateProcessorVersionResponse": { - "fields": { - "evaluation": { - "type": "string", - "id": 2 - } - } - }, - "GetEvaluationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Evaluation" - } - } - } - }, - "ListEvaluationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListEvaluationsResponse": { - "fields": { - "evaluations": { - "rule": "repeated", - "type": "Evaluation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DocumentSchema": { - "fields": { - "displayName": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 2 - }, - "entityTypes": { - "rule": "repeated", - "type": "EntityType", - "id": 3 - }, - "metadata": { - "type": "Metadata", - "id": 4 - } - }, - "nested": { - "EntityType": { - "oneofs": { - "valueSource": { - "oneof": [ - "enumValues" - ] - } - }, - "fields": { - "enumValues": { - "type": "EnumValues", - "id": 14 - }, - "displayName": { - "type": "string", - "id": 13 - }, - "name": { - "type": "string", - "id": 1 - }, - "baseTypes": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "properties": { - "rule": "repeated", - "type": "Property", - "id": 6 - } - }, - "nested": { - "EnumValues": { - "fields": { - "values": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Property": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 6 - }, - "valueType": { - "type": "string", - "id": 2 - }, - "occurrenceType": { - "type": "OccurrenceType", - "id": 3 - }, - "method": { - "type": "Method", - "id": 8 - } - }, - "nested": { - "OccurrenceType": { - "values": { - "OCCURRENCE_TYPE_UNSPECIFIED": 0, - "OPTIONAL_ONCE": 1, - "OPTIONAL_MULTIPLE": 2, - "REQUIRED_ONCE": 3, - "REQUIRED_MULTIPLE": 4 - } - }, - "Method": { - "values": { - "METHOD_UNSPECIFIED": 0, - "EXTRACT": 1, - "DERIVE": 2 - } - } - } - } - } - }, - "Metadata": { - "fields": { - "documentSplitter": { - "type": "bool", - "id": 1 - }, - "documentAllowMultipleLabels": { - "type": "bool", - "id": 2 - }, - "prefixedNamingOnProperties": { - "type": "bool", - "id": 6 - }, - "skipNamingValidation": { - "type": "bool", - "id": 7 - } - } - } - } - }, - "EvaluationReference": { - "fields": { - "operation": { - "type": "string", - "id": 1 - }, - "evaluation": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "documentai.googleapis.com/Evaluation" - } - }, - "aggregateMetrics": { - "type": "Evaluation.Metrics", - "id": 4 - }, - "aggregateMetricsExact": { - "type": "Evaluation.Metrics", - "id": 5 - } - } - }, - "Evaluation": { - "options": { - "(google.api.resource).type": "documentai.googleapis.com/Evaluation", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "documentCounters": { - "type": "Counters", - "id": 5 - }, - "allEntitiesMetrics": { - "type": "MultiConfidenceMetrics", - "id": 3 - }, - "entityMetrics": { - "keyType": "string", - "type": "MultiConfidenceMetrics", - "id": 4 - }, - "kmsKeyName": { - "type": "string", - "id": 6 - }, - "kmsKeyVersionName": { - "type": "string", - "id": 7 - } - }, - "nested": { - "Counters": { - "fields": { - "inputDocumentsCount": { - "type": "int32", - "id": 1 - }, - "invalidDocumentsCount": { - "type": "int32", - "id": 2 - }, - "failedDocumentsCount": { - "type": "int32", - "id": 3 - }, - "evaluatedDocumentsCount": { - "type": "int32", - "id": 4 - } - } - }, - "Metrics": { - "fields": { - "precision": { - "type": "float", - "id": 1 - }, - "recall": { - "type": "float", - "id": 2 - }, - "f1Score": { - "type": "float", - "id": 3 - }, - "predictedOccurrencesCount": { - "type": "int32", - "id": 4 - }, - "groundTruthOccurrencesCount": { - "type": "int32", - "id": 5 - }, - "predictedDocumentCount": { - "type": "int32", - "id": 10 - }, - "groundTruthDocumentCount": { - "type": "int32", - "id": 11 - }, - "truePositivesCount": { - "type": "int32", - "id": 6 - }, - "falsePositivesCount": { - "type": "int32", - "id": 7 - }, - "falseNegativesCount": { - "type": "int32", - "id": 8 - }, - "totalDocumentsCount": { - "type": "int32", - "id": 9 - } - } - }, - "ConfidenceLevelMetrics": { - "fields": { - "confidenceLevel": { - "type": "float", - "id": 1 - }, - "metrics": { - "type": "Metrics", - "id": 2 - } - } - }, - "MultiConfidenceMetrics": { - "fields": { - "confidenceLevelMetrics": { - "rule": "repeated", - "type": "ConfidenceLevelMetrics", - "id": 1 - }, - "confidenceLevelMetricsExact": { - "rule": "repeated", - "type": "ConfidenceLevelMetrics", - "id": 4 - }, - "auprc": { - "type": "float", - "id": 2 - }, - "estimatedCalibrationError": { - "type": "float", - "id": 3 - }, - "auprcExact": { - "type": "float", - "id": 5 - }, - "estimatedCalibrationErrorExact": { - "type": "float", - "id": 6 - }, - "metricsType": { - "type": "MetricsType", - "id": 7 - } - }, - "nested": { - "MetricsType": { - "values": { - "METRICS_TYPE_UNSPECIFIED": 0, - "AGGREGATE": 1 - } - } - } - } - } - }, - "CommonOperationMetadata": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "stateMessage": { - "type": "string", - "id": 2 - }, - "resource": { - "type": "string", - "id": 5 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "RUNNING": 1, - "CANCELLING": 2, - "SUCCEEDED": 3, - "FAILED": 4, - "CANCELLED": 5 - } - } - } - }, - "ProcessorVersion": { - "options": { - "(google.api.resource).type": "documentai.googleapis.com/ProcessorVersion", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "documentSchema": { - "type": "DocumentSchema", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latestEvaluation": { - "type": "EvaluationReference", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kmsKeyName": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kmsKeyVersionName": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "googleManaged": { - "type": "bool", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deprecationInfo": { - "type": "DeprecationInfo", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "modelType": { - "type": "ModelType", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzi": { - "type": "bool", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "genAiModelInfo": { - "type": "GenAiModelInfo", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "DeprecationInfo": { - "fields": { - "deprecationTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "replacementProcessorVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "GenAiModelInfo": { - "oneofs": { - "modelInfo": { - "oneof": [ - "foundationGenAiModelInfo", - "customGenAiModelInfo" - ] - } - }, - "fields": { - "foundationGenAiModelInfo": { - "type": "FoundationGenAiModelInfo", - "id": 1 - }, - "customGenAiModelInfo": { - "type": "CustomGenAiModelInfo", - "id": 2 - } - }, - "nested": { - "FoundationGenAiModelInfo": { - "fields": { - "finetuningAllowed": { - "type": "bool", - "id": 1 - }, - "minTrainLabeledDocuments": { - "type": "int32", - "id": 2 - } - } - }, - "CustomGenAiModelInfo": { - "fields": { - "customModelType": { - "type": "CustomModelType", - "id": 1 - }, - "baseProcessorVersionId": { - "type": "string", - "id": 2 - } - }, - "nested": { - "CustomModelType": { - "values": { - "CUSTOM_MODEL_TYPE_UNSPECIFIED": 0, - "VERSIONED_FOUNDATION": 1, - "FINE_TUNED": 2 - } - } - } - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "DEPLOYED": 1, - "DEPLOYING": 2, - "UNDEPLOYED": 3, - "UNDEPLOYING": 4, - "CREATING": 5, - "DELETING": 6, - "FAILED": 7, - "IMPORTING": 8 - } - }, - "ModelType": { - "values": { - "MODEL_TYPE_UNSPECIFIED": 0, - "MODEL_TYPE_GENERATIVE": 1, - "MODEL_TYPE_CUSTOM": 2 - } - } - } - }, - "ProcessorVersionAlias": { - "fields": { - "alias": { - "type": "string", - "id": 1 - }, - "processorVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "Processor": { - "options": { - "(google.api.resource).type": "documentai.googleapis.com/Processor", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "type": { - "type": "string", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3 - }, - "state": { - "type": "State", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "defaultProcessorVersion": { - "type": "string", - "id": 9, - "options": { - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - }, - "processorVersionAliases": { - "rule": "repeated", - "type": "ProcessorVersionAlias", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "processEndpoint": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kmsKeyName": { - "type": "string", - "id": 8 - }, - "satisfiesPzs": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzi": { - "type": "bool", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ENABLED": 1, - "DISABLED": 2, - "ENABLING": 3, - "DISABLING": 4, - "CREATING": 5, - "FAILED": 6, - "DELETING": 7 - } - } - } - }, - "ProcessorType": { - "options": { - "(google.api.resource).type": "documentai.googleapis.com/ProcessorType", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/processorTypes/{processor_type}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - }, - "category": { - "type": "string", - "id": 3 - }, - "availableLocations": { - "rule": "repeated", - "type": "LocationInfo", - "id": 4 - }, - "allowCreation": { - "type": "bool", - "id": 6 - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 8 - }, - "sampleDocumentUris": { - "rule": "repeated", - "type": "string", - "id": 9 - } - }, - "nested": { - "LocationInfo": { - "fields": { - "locationId": { - "type": "string", - "id": 1 - } - } - } - } - } - } - }, - "v1beta3": { - "options": { - "csharp_namespace": "Google.Cloud.DocumentAI.V1Beta3", - "go_package": "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb", - "java_multiple_files": true, - "java_outer_classname": "DocumentAiDocumentService", - "java_package": "com.google.cloud.documentai.v1beta3", - "php_namespace": "Google\\Cloud\\DocumentAI\\V1beta3", - "ruby_package": "Google::Cloud::DocumentAI::V1beta3", - "(google.api.resource_definition).type": "documentai.googleapis.com/Location", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}" - }, - "nested": { - "Barcode": { - "fields": { - "format": { - "type": "string", - "id": 1 - }, - "valueFormat": { - "type": "string", - "id": 2 - }, - "rawValue": { - "type": "string", - "id": 3 - } - } - }, - "Dataset": { - "options": { - "(google.api.resource).type": "documentai.googleapis.com/Dataset", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/dataset" - }, - "oneofs": { - "storageSource": { - "oneof": [ - "gcsManagedConfig", - "documentWarehouseConfig", - "unmanagedDatasetConfig" - ] - } - }, - "fields": { - "gcsManagedConfig": { - "type": "GCSManagedConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "documentWarehouseConfig": { - "type": "DocumentWarehouseConfig", - "id": 5, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "unmanagedDatasetConfig": { - "type": "UnmanagedDatasetConfig", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "name": { - "type": "string", - "id": 1 - }, - "state": { - "type": "State", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzi": { - "type": "bool", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "GCSManagedConfig": { - "fields": { - "gcsPrefix": { - "type": "GcsPrefix", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DocumentWarehouseConfig": { - "fields": { - "collection": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "schema": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "contentwarehouse.googleapis.com/Schema" - } - } - } - }, - "UnmanagedDatasetConfig": { - "fields": {} - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "UNINITIALIZED": 1, - "INITIALIZING": 2, - "INITIALIZED": 3 - } - } - } - }, - "DocumentId": { - "oneofs": { - "type": { - "oneof": [ - "gcsManagedDocId", - "unmanagedDocId" - ] - } - }, - "fields": { - "gcsManagedDocId": { - "type": "GCSManagedDocumentId", - "id": 1 - }, - "unmanagedDocId": { - "type": "UnmanagedDocumentId", - "id": 4 - }, - "revisionRef": { - "type": "RevisionRef", - "id": 3 - } - }, - "nested": { - "GCSManagedDocumentId": { - "fields": { - "gcsUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cwDocId": { - "type": "string", - "id": 2, - "options": { - "deprecated": true - } - } - } - }, - "UnmanagedDocumentId": { - "fields": { - "docId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "DatasetSchema": { - "options": { - "(google.api.resource).type": "documentai.googleapis.com/DatasetSchema", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "documentSchema": { - "type": "DocumentSchema", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzi": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "BatchDatasetDocuments": { - "oneofs": { - "criteria": { - "oneof": [ - "individualDocumentIds", - "filter" - ] - } - }, - "fields": { - "individualDocumentIds": { - "type": "IndividualDocumentIds", - "id": 1 - }, - "filter": { - "type": "string", - "id": 2 - } - }, - "nested": { - "IndividualDocumentIds": { - "fields": { - "documentIds": { - "rule": "repeated", - "type": "DocumentId", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - } - } - }, - "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 - }, - "blobAssets": { - "rule": "repeated", - "type": "BlobAsset", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "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 - } - } - } - }, - "Annotations": { - "fields": { - "description": { - "type": "string", - "id": 1 - } - } - }, - "DocumentLayout": { - "fields": { - "blocks": { - "rule": "repeated", - "type": "DocumentLayoutBlock", - "id": 1 - } - }, - "nested": { - "DocumentLayoutBlock": { - "oneofs": { - "block": { - "oneof": [ - "textBlock", - "tableBlock", - "listBlock", - "imageBlock" - ] - } - }, - "fields": { - "textBlock": { - "type": "LayoutTextBlock", - "id": 2 - }, - "tableBlock": { - "type": "LayoutTableBlock", - "id": 3 - }, - "listBlock": { - "type": "LayoutListBlock", - "id": 4 - }, - "imageBlock": { - "type": "LayoutImageBlock", - "id": 7 - }, - "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 - }, - "annotations": { - "type": "Annotations", - "id": 4 - } - } - }, - "LayoutTableBlock": { - "fields": { - "headerRows": { - "rule": "repeated", - "type": "LayoutTableRow", - "id": 1 - }, - "bodyRows": { - "rule": "repeated", - "type": "LayoutTableRow", - "id": 2 - }, - "caption": { - "type": "string", - "id": 3 - }, - "annotations": { - "type": "Annotations", - "id": 4 - } - } - }, - "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 - } - } - }, - "LayoutImageBlock": { - "oneofs": { - "imageSource": { - "oneof": [ - "blobAssetId", - "gcsUri", - "dataUri" - ] - } - }, - "fields": { - "blobAssetId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gcsUri": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dataUri": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mimeType": { - "type": "string", - "id": 1 - }, - "imageText": { - "type": "string", - "id": 2 - }, - "annotations": { - "type": "Annotations", - "id": 3 - } - } - } - } - } - } - }, - "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 - }, - "chunkFields": { - "rule": "repeated", - "type": "ChunkField", - "id": 7 - } - }, - "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 - } - } - }, - "ImageChunkField": { - "oneofs": { - "imageSource": { - "oneof": [ - "blobAssetId", - "gcsUri", - "dataUri" - ] - } - }, - "fields": { - "blobAssetId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gcsUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dataUri": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "annotations": { - "type": "Annotations", - "id": 4 - } - } - }, - "TableChunkField": { - "fields": { - "annotations": { - "type": "Annotations", - "id": 1 - } - } - }, - "ChunkField": { - "oneofs": { - "fieldType": { - "oneof": [ - "imageChunkField", - "tableChunkField" - ] - } - }, - "fields": { - "imageChunkField": { - "type": "ImageChunkField", - "id": 1 - }, - "tableChunkField": { - "type": "TableChunkField", - "id": 2 - } - } - } - } - } - } - }, - "BlobAsset": { - "fields": { - "assetId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "content": { - "type": "bytes", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mimeType": { - "type": "string", - "id": 3 - } - } - }, - "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 - }, - "provenance": { - "type": "Provenance", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "RevisionRef": { - "oneofs": { - "source": { - "oneof": [ - "revisionCase", - "revisionId", - "latestProcessorVersion" - ] - } - }, - "fields": { - "revisionCase": { - "type": "RevisionCase", - "id": 1 - }, - "revisionId": { - "type": "string", - "id": 2 - }, - "latestProcessorVersion": { - "type": "string", - "id": 3 - } - }, - "nested": { - "RevisionCase": { - "values": { - "REVISION_CASE_UNSPECIFIED": 0, - "LATEST_HUMAN_REVIEW": 1, - "LATEST_TIMESTAMP": 2, - "BASE_OCR_REVISION": 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 - } - } - }, - "Documents": { - "fields": { - "documents": { - "rule": "repeated", - "type": "Document", - "id": 1 - } - } - }, - "RawDocument": { - "fields": { - "content": { - "type": "bytes", - "id": 1 - }, - "mimeType": { - "type": "string", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3 - } - } - }, - "GcsDocument": { - "fields": { - "gcsUri": { - "type": "string", - "id": 1 - }, - "mimeType": { - "type": "string", - "id": 2 - } - } - }, - "GcsDocuments": { - "fields": { - "documents": { - "rule": "repeated", - "type": "GcsDocument", - "id": 1 - } - } - }, - "GcsPrefix": { - "fields": { - "gcsUriPrefix": { - "type": "string", - "id": 1 - } - } - }, - "RawDocuments": { - "fields": { - "documents": { - "rule": "repeated", - "type": "RawDocument", - "id": 1 - } - } - }, - "BatchDocumentsInputConfig": { - "oneofs": { - "source": { - "oneof": [ - "gcsPrefix", - "gcsDocuments" - ] - } - }, - "fields": { - "gcsPrefix": { - "type": "GcsPrefix", - "id": 1 - }, - "gcsDocuments": { - "type": "GcsDocuments", - "id": 2 - } - } - }, - "DocumentOutputConfig": { - "oneofs": { - "destination": { - "oneof": [ - "gcsOutputConfig" - ] - } - }, - "fields": { - "gcsOutputConfig": { - "type": "GcsOutputConfig", - "id": 1 - } - }, - "nested": { - "GcsOutputConfig": { - "fields": { - "gcsUri": { - "type": "string", - "id": 1 - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - }, - "shardingConfig": { - "type": "ShardingConfig", - "id": 3 - } - }, - "nested": { - "ShardingConfig": { - "fields": { - "pagesPerShard": { - "type": "int32", - "id": 1 - }, - "pagesOverlap": { - "type": "int32", - "id": 2 - } - } - } - } - } - } - }, - "OcrConfig": { - "fields": { - "hints": { - "type": "Hints", - "id": 2 - }, - "enableNativePdfParsing": { - "type": "bool", - "id": 3 - }, - "enableImageQualityScores": { - "type": "bool", - "id": 4 - }, - "advancedOcrOptions": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "enableSymbol": { - "type": "bool", - "id": 6 - }, - "computeStyleInfo": { - "type": "bool", - "id": 8, - "options": { - "deprecated": true - } - }, - "disableCharacterBoxesDetection": { - "type": "bool", - "id": 10 - }, - "premiumFeatures": { - "type": "PremiumFeatures", - "id": 11 - } - }, - "nested": { - "Hints": { - "fields": { - "languageHints": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "PremiumFeatures": { - "fields": { - "enableSelectionMarkDetection": { - "type": "bool", - "id": 3 - }, - "computeStyleInfo": { - "type": "bool", - "id": 4 - }, - "enableMathOcr": { - "type": "bool", - "id": 5 - } - } - } - } - }, - "SummaryOptions": { - "fields": { - "length": { - "type": "Length", - "id": 1 - }, - "format": { - "type": "Format", - "id": 2 - } - }, - "nested": { - "Length": { - "values": { - "LENGTH_UNSPECIFIED": 0, - "BRIEF": 1, - "MODERATE": 2, - "COMPREHENSIVE": 3 - } - }, - "Format": { - "values": { - "FORMAT_UNSPECIFIED": 0, - "PARAGRAPH": 1, - "BULLETS": 2 - } - } - } - }, - "FieldExtractionMetadata": { - "fields": { - "summaryOptions": { - "type": "SummaryOptions", - "id": 2 - } - } - }, - "PropertyMetadata": { - "fields": { - "inactive": { - "type": "bool", - "id": 3 - }, - "fieldExtractionMetadata": { - "type": "FieldExtractionMetadata", - "id": 9 - } - } - }, - "EntityTypeMetadata": { - "fields": { - "inactive": { - "type": "bool", - "id": 5 - } - } - }, - "DocumentSchema": { - "fields": { - "displayName": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 2 - }, - "entityTypes": { - "rule": "repeated", - "type": "EntityType", - "id": 3 - }, - "metadata": { - "type": "Metadata", - "id": 4 - }, - "documentPrompt": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "EntityType": { - "oneofs": { - "valueSource": { - "oneof": [ - "enumValues" - ] - } - }, - "fields": { - "enumValues": { - "type": "EnumValues", - "id": 14 - }, - "displayName": { - "type": "string", - "id": 13 - }, - "name": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 15 - }, - "baseTypes": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "properties": { - "rule": "repeated", - "type": "Property", - "id": 6 - }, - "entityTypeMetadata": { - "type": "EntityTypeMetadata", - "id": 11 - } - }, - "nested": { - "EnumValues": { - "fields": { - "values": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Property": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 7 - }, - "displayName": { - "type": "string", - "id": 6 - }, - "valueType": { - "type": "string", - "id": 2 - }, - "occurrenceType": { - "type": "OccurrenceType", - "id": 3 - }, - "method": { - "type": "Method", - "id": 8 - }, - "propertyMetadata": { - "type": "PropertyMetadata", - "id": 5 - } - }, - "nested": { - "OccurrenceType": { - "values": { - "OCCURRENCE_TYPE_UNSPECIFIED": 0, - "OPTIONAL_ONCE": 1, - "OPTIONAL_MULTIPLE": 2, - "REQUIRED_ONCE": 3, - "REQUIRED_MULTIPLE": 4 - } - }, - "Method": { - "values": { - "METHOD_UNSPECIFIED": 0, - "EXTRACT": 1, - "DERIVE": 2 - } - } - } - } - } - }, - "Metadata": { - "fields": { - "documentSplitter": { - "type": "bool", - "id": 1 - }, - "documentAllowMultipleLabels": { - "type": "bool", - "id": 2 - }, - "prefixedNamingOnProperties": { - "type": "bool", - "id": 6 - }, - "skipNamingValidation": { - "type": "bool", - "id": 7 - } - } - } - } - }, - "DocumentProcessorService": { - "options": { - "(google.api.default_host)": "documentai.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ProcessDocument": { - "requestType": "ProcessRequest", - "responseType": "ProcessResponse", - "options": { - "(google.api.http).post": "/v1beta3/{name=projects/*/locations/*/processors/*}:process", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{name=projects/*/locations/*/processors/*}:process", - "body": "*", - "additional_bindings": { - "post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "BatchProcessDocuments": { - "requestType": "BatchProcessRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "BatchProcessResponse", - "(google.longrunning.operation_info).metadata_type": "BatchProcessMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess", - "body": "*", - "additional_bindings": { - "post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BatchProcessResponse", - "metadata_type": "BatchProcessMetadata" - } - } - ] - }, - "FetchProcessorTypes": { - "requestType": "FetchProcessorTypesRequest", - "responseType": "FetchProcessorTypesResponse", - "options": { - "(google.api.http).get": "/v1beta3/{parent=projects/*/locations/*}:fetchProcessorTypes", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta3/{parent=projects/*/locations/*}:fetchProcessorTypes" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ListProcessorTypes": { - "requestType": "ListProcessorTypesRequest", - "responseType": "ListProcessorTypesResponse", - "options": { - "(google.api.http).get": "/v1beta3/{parent=projects/*/locations/*}/processorTypes", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta3/{parent=projects/*/locations/*}/processorTypes" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetProcessorType": { - "requestType": "GetProcessorTypeRequest", - "responseType": "ProcessorType", - "options": { - "(google.api.http).get": "/v1beta3/{name=projects/*/locations/*/processorTypes/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta3/{name=projects/*/locations/*/processorTypes/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListProcessors": { - "requestType": "ListProcessorsRequest", - "responseType": "ListProcessorsResponse", - "options": { - "(google.api.http).get": "/v1beta3/{parent=projects/*/locations/*}/processors", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta3/{parent=projects/*/locations/*}/processors" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetProcessor": { - "requestType": "GetProcessorRequest", - "responseType": "Processor", - "options": { - "(google.api.http).get": "/v1beta3/{name=projects/*/locations/*/processors/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta3/{name=projects/*/locations/*/processors/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "TrainProcessorVersion": { - "requestType": "TrainProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:train", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,processor_version", - "(google.longrunning.operation_info).response_type": "TrainProcessorVersionResponse", - "(google.longrunning.operation_info).metadata_type": "TrainProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:train", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,processor_version" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "TrainProcessorVersionResponse", - "metadata_type": "TrainProcessorVersionMetadata" - } - } - ] - }, - "GetProcessorVersion": { - "requestType": "GetProcessorVersionRequest", - "responseType": "ProcessorVersion", - "options": { - "(google.api.http).get": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListProcessorVersions": { - "requestType": "ListProcessorVersionsRequest", - "responseType": "ListProcessorVersionsResponse", - "options": { - "(google.api.http).get": "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteProcessorVersion": { - "requestType": "DeleteProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "DeleteProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "DeleteProcessorVersionMetadata" - } - } - ] - }, - "DeployProcessorVersion": { - "requestType": "DeployProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "DeployProcessorVersionResponse", - "(google.longrunning.operation_info).metadata_type": "DeployProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "DeployProcessorVersionResponse", - "metadata_type": "DeployProcessorVersionMetadata" - } - } - ] - }, - "UndeployProcessorVersion": { - "requestType": "UndeployProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "UndeployProcessorVersionResponse", - "(google.longrunning.operation_info).metadata_type": "UndeployProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "UndeployProcessorVersionResponse", - "metadata_type": "UndeployProcessorVersionMetadata" - } - } - ] - }, - "CreateProcessor": { - "requestType": "CreateProcessorRequest", - "responseType": "Processor", - "options": { - "(google.api.http).post": "/v1beta3/{parent=projects/*/locations/*}/processors", - "(google.api.http).body": "processor", - "(google.api.method_signature)": "parent,processor" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{parent=projects/*/locations/*}/processors", - "body": "processor" - } - }, - { - "(google.api.method_signature)": "parent,processor" - } - ] - }, - "DeleteProcessor": { - "requestType": "DeleteProcessorRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1beta3/{name=projects/*/locations/*/processors/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "DeleteProcessorMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta3/{name=projects/*/locations/*/processors/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "DeleteProcessorMetadata" - } - } - ] - }, - "EnableProcessor": { - "requestType": "EnableProcessorRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta3/{name=projects/*/locations/*/processors/*}:enable", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "EnableProcessorResponse", - "(google.longrunning.operation_info).metadata_type": "EnableProcessorMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{name=projects/*/locations/*/processors/*}:enable", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "EnableProcessorResponse", - "metadata_type": "EnableProcessorMetadata" - } - } - ] - }, - "DisableProcessor": { - "requestType": "DisableProcessorRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta3/{name=projects/*/locations/*/processors/*}:disable", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "DisableProcessorResponse", - "(google.longrunning.operation_info).metadata_type": "DisableProcessorMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{name=projects/*/locations/*/processors/*}:disable", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "DisableProcessorResponse", - "metadata_type": "DisableProcessorMetadata" - } - } - ] - }, - "SetDefaultProcessorVersion": { - "requestType": "SetDefaultProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "SetDefaultProcessorVersionResponse", - "(google.longrunning.operation_info).metadata_type": "SetDefaultProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "SetDefaultProcessorVersionResponse", - "metadata_type": "SetDefaultProcessorVersionMetadata" - } - } - ] - }, - "ReviewDocument": { - "requestType": "ReviewDocumentRequest", - "responseType": "google.longrunning.Operation", - "options": { - "deprecated": true, - "(google.api.http).post": "/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument", - "(google.api.http).body": "*", - "(google.api.method_signature)": "human_review_config", - "(google.longrunning.operation_info).response_type": "ReviewDocumentResponse", - "(google.longrunning.operation_info).metadata_type": "ReviewDocumentOperationMetadata" - }, - "parsedOptions": [ - { - "deprecated": true - }, - { - "(google.api.http)": { - "post": "/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument", - "body": "*" - } - }, - { - "(google.api.method_signature)": "human_review_config" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ReviewDocumentResponse", - "metadata_type": "ReviewDocumentOperationMetadata" - } - } - ] - }, - "EvaluateProcessorVersion": { - "requestType": "EvaluateProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta3/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion", - "(google.api.http).body": "*", - "(google.api.method_signature)": "processor_version", - "(google.longrunning.operation_info).response_type": "EvaluateProcessorVersionResponse", - "(google.longrunning.operation_info).metadata_type": "EvaluateProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion", - "body": "*" - } - }, - { - "(google.api.method_signature)": "processor_version" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "EvaluateProcessorVersionResponse", - "metadata_type": "EvaluateProcessorVersionMetadata" - } - } - ] - }, - "GetEvaluation": { - "requestType": "GetEvaluationRequest", - "responseType": "Evaluation", - "options": { - "(google.api.http).get": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListEvaluations": { - "requestType": "ListEvaluationsRequest", - "responseType": "ListEvaluationsResponse", - "options": { - "(google.api.http).get": "/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "ImportProcessorVersion": { - "requestType": "ImportProcessorVersionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:importProcessorVersion", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent", - "(google.longrunning.operation_info).response_type": "ImportProcessorVersionResponse", - "(google.longrunning.operation_info).metadata_type": "ImportProcessorVersionMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:importProcessorVersion", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ImportProcessorVersionResponse", - "metadata_type": "ImportProcessorVersionMetadata" - } - } - ] - } - } - }, - "ProcessOptions": { - "oneofs": { - "pageRange": { - "oneof": [ - "individualPageSelector", - "fromStart", - "fromEnd" - ] - } - }, - "fields": { - "individualPageSelector": { - "type": "IndividualPageSelector", - "id": 5 - }, - "fromStart": { - "type": "int32", - "id": 6 - }, - "fromEnd": { - "type": "int32", - "id": 7 - }, - "ocrConfig": { - "type": "OcrConfig", - "id": 1 - }, - "layoutConfig": { - "type": "LayoutConfig", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "schemaOverride": { - "type": "DocumentSchema", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "LayoutConfig": { - "fields": { - "chunkingConfig": { - "type": "ChunkingConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "returnImages": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "returnBoundingBoxes": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableImageAnnotation": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableImageExtraction": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableLlmLayoutParsing": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableTableAnnotation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableTableSplit": { - "type": "bool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ChunkingConfig": { - "fields": { - "chunkSize": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "includeAncestorHeadings": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "semanticChunkingGroupSize": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "breakpointPercentileThreshold": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "IndividualPageSelector": { - "fields": { - "pages": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "ProcessRequest": { - "oneofs": { - "source": { - "oneof": [ - "inlineDocument", - "rawDocument", - "gcsDocument" - ] - } - }, - "fields": { - "inlineDocument": { - "type": "Document", - "id": 4 - }, - "rawDocument": { - "type": "RawDocument", - "id": 5 - }, - "gcsDocument": { - "type": "GcsDocument", - "id": 8 - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "document": { - "type": "Document", - "id": 2, - "options": { - "deprecated": true - } - }, - "skipHumanReview": { - "type": "bool", - "id": 3, - "options": { - "deprecated": true - } - }, - "fieldMask": { - "type": "google.protobuf.FieldMask", - "id": 6 - }, - "processOptions": { - "type": "ProcessOptions", - "id": 7 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "imagelessMode": { - "type": "bool", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "HumanReviewStatus": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "stateMessage": { - "type": "string", - "id": 2 - }, - "humanReviewOperation": { - "type": "string", - "id": 3 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "SKIPPED": 1, - "VALIDATION_PASSED": 2, - "IN_PROGRESS": 3, - "ERROR": 4 - } - } - } - }, - "ProcessResponse": { - "fields": { - "document": { - "type": "Document", - "id": 1 - }, - "humanReviewOperation": { - "type": "string", - "id": 2, - "options": { - "deprecated": true - } - }, - "humanReviewStatus": { - "type": "HumanReviewStatus", - "id": 3 - } - } - }, - "BatchProcessRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "inputConfigs": { - "rule": "repeated", - "type": "BatchInputConfig", - "id": 2, - "options": { - "deprecated": true - } - }, - "outputConfig": { - "type": "BatchOutputConfig", - "id": 3, - "options": { - "deprecated": true - } - }, - "inputDocuments": { - "type": "BatchDocumentsInputConfig", - "id": 5 - }, - "documentOutputConfig": { - "type": "DocumentOutputConfig", - "id": 6 - }, - "skipHumanReview": { - "type": "bool", - "id": 4, - "options": { - "deprecated": true - } - }, - "processOptions": { - "type": "ProcessOptions", - "id": 7 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "BatchInputConfig": { - "options": { - "deprecated": true - }, - "fields": { - "gcsSource": { - "type": "string", - "id": 1 - }, - "mimeType": { - "type": "string", - "id": 2 - } - } - }, - "BatchOutputConfig": { - "options": { - "deprecated": true - }, - "fields": { - "gcsDestination": { - "type": "string", - "id": 1 - } - } - } - } - }, - "BatchProcessResponse": { - "fields": {} - }, - "BatchProcessMetadata": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "stateMessage": { - "type": "string", - "id": 2 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "individualProcessStatuses": { - "rule": "repeated", - "type": "IndividualProcessStatus", - "id": 5 - } - }, - "nested": { - "IndividualProcessStatus": { - "fields": { - "inputGcsSource": { - "type": "string", - "id": 1 - }, - "status": { - "type": "google.rpc.Status", - "id": 2 - }, - "outputGcsDestination": { - "type": "string", - "id": 3 - }, - "humanReviewOperation": { - "type": "string", - "id": 4, - "options": { - "deprecated": true - } - }, - "humanReviewStatus": { - "type": "HumanReviewStatus", - "id": 5 - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "WAITING": 1, - "RUNNING": 2, - "SUCCEEDED": 3, - "CANCELLING": 4, - "CANCELLED": 5, - "FAILED": 6 - } - } - } - }, - "FetchProcessorTypesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorType" - } - } - } - }, - "FetchProcessorTypesResponse": { - "fields": { - "processorTypes": { - "rule": "repeated", - "type": "ProcessorType", - "id": 1 - } - } - }, - "ListProcessorTypesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorType" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListProcessorTypesResponse": { - "fields": { - "processorTypes": { - "rule": "repeated", - "type": "ProcessorType", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ListProcessorsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "documentai.googleapis.com/Processor" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListProcessorsResponse": { - "fields": { - "processors": { - "rule": "repeated", - "type": "Processor", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetProcessorTypeRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorType" - } - } - } - }, - "GetProcessorRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" - } - } - } - }, - "GetProcessorVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "ListProcessorVersionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorVersion" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListProcessorVersionsResponse": { - "fields": { - "processorVersions": { - "rule": "repeated", - "type": "ProcessorVersion", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteProcessorVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "DeleteProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "DeployProcessorVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "DeployProcessorVersionResponse": { - "fields": {} - }, - "DeployProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "UndeployProcessorVersionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "UndeployProcessorVersionResponse": { - "fields": {} - }, - "UndeployProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "CreateProcessorRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "documentai.googleapis.com/Processor" - } - }, - "processor": { - "type": "Processor", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteProcessorRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" - } - } - } - }, - "DeleteProcessorMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 5 - } - } - }, - "EnableProcessorRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" - } - } - } - }, - "EnableProcessorResponse": { - "fields": {} - }, - "EnableProcessorMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 5 - } - } - }, - "DisableProcessorRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" - } - } - } - }, - "DisableProcessorResponse": { - "fields": {} - }, - "DisableProcessorMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 5 - } - } - }, - "SetDefaultProcessorVersionRequest": { - "fields": { - "processor": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" - } - }, - "defaultProcessorVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "SetDefaultProcessorVersionResponse": { - "fields": {} - }, - "SetDefaultProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "TrainProcessorVersionRequest": { - "oneofs": { - "processorFlags": { - "oneof": [ - "customDocumentExtractionOptions", - "foundationModelTuningOptions" - ] - } - }, - "fields": { - "customDocumentExtractionOptions": { - "type": "CustomDocumentExtractionOptions", - "id": 5 - }, - "foundationModelTuningOptions": { - "type": "FoundationModelTuningOptions", - "id": 12 - }, - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Processor" - } - }, - "processorVersion": { - "type": "ProcessorVersion", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "documentSchema": { - "type": "DocumentSchema", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "inputData": { - "type": "InputData", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "baseProcessorVersion": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "InputData": { - "fields": { - "trainingDocuments": { - "type": "BatchDocumentsInputConfig", - "id": 3 - }, - "testDocuments": { - "type": "BatchDocumentsInputConfig", - "id": 4 - } - } - }, - "CustomDocumentExtractionOptions": { - "fields": { - "trainingMethod": { - "type": "TrainingMethod", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "TrainingMethod": { - "values": { - "TRAINING_METHOD_UNSPECIFIED": 0, - "MODEL_BASED": 1, - "TEMPLATE_BASED": 2 - } - } - } - }, - "FoundationModelTuningOptions": { - "fields": { - "trainSteps": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "learningRateMultiplier": { - "type": "float", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "TrainProcessorVersionResponse": { - "fields": { - "processorVersion": { - "type": "string", - "id": 1 - } - } - }, - "TrainProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - }, - "trainingDatasetValidation": { - "type": "DatasetValidation", - "id": 2 - }, - "testDatasetValidation": { - "type": "DatasetValidation", - "id": 3 - } - }, - "nested": { - "DatasetValidation": { - "fields": { - "documentErrorCount": { - "type": "int32", - "id": 3 - }, - "datasetErrorCount": { - "type": "int32", - "id": 4 - }, - "documentErrors": { - "rule": "repeated", - "type": "google.rpc.Status", - "id": 1 - }, - "datasetErrors": { - "rule": "repeated", - "type": "google.rpc.Status", - "id": 2 - } - } - } - } - }, - "ReviewDocumentRequest": { - "oneofs": { - "source": { - "oneof": [ - "inlineDocument" - ] - } - }, - "fields": { - "inlineDocument": { - "type": "Document", - "id": 4 - }, - "humanReviewConfig": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/HumanReviewConfig" - } - }, - "document": { - "type": "Document", - "id": 2, - "options": { - "deprecated": true - } - }, - "enableSchemaValidation": { - "type": "bool", - "id": 3 - }, - "priority": { - "type": "Priority", - "id": 5 - }, - "documentSchema": { - "type": "DocumentSchema", - "id": 6 - } - }, - "nested": { - "Priority": { - "values": { - "DEFAULT": 0, - "URGENT": 1 - } - } - } - }, - "ReviewDocumentResponse": { - "fields": { - "gcsDestination": { - "type": "string", - "id": 1 - }, - "state": { - "type": "State", - "id": 2 - }, - "rejectionReason": { - "type": "string", - "id": 3 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "REJECTED": 1, - "SUCCEEDED": 2 - } - } - } - }, - "ReviewDocumentOperationMetadata": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "stateMessage": { - "type": "string", - "id": 2 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 5 - }, - "questionId": { - "type": "string", - "id": 6 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "RUNNING": 1, - "CANCELLING": 2, - "SUCCEEDED": 3, - "FAILED": 4, - "CANCELLED": 5 - } - } - } - }, - "EvaluateProcessorVersionRequest": { - "fields": { - "processorVersion": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - }, - "evaluationDocuments": { - "type": "BatchDocumentsInputConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EvaluateProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "EvaluateProcessorVersionResponse": { - "fields": { - "evaluation": { - "type": "string", - "id": 2 - } - } - }, - "GetEvaluationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Evaluation" - } - } - } - }, - "ListEvaluationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListEvaluationsResponse": { - "fields": { - "evaluations": { - "rule": "repeated", - "type": "Evaluation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ImportProcessorVersionRequest": { - "oneofs": { - "source": { - "oneof": [ - "processorVersionSource", - "externalProcessorVersionSource" - ] - } - }, - "fields": { - "processorVersionSource": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - }, - "externalProcessorVersionSource": { - "type": "ExternalProcessorVersionSource", - "id": 3 - }, - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "documentai.googleapis.com/ProcessorVersion" - } - } - }, - "nested": { - "ExternalProcessorVersionSource": { - "fields": { - "processorVersion": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "serviceEndpoint": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "ImportProcessorVersionResponse": { - "fields": { - "processorVersion": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "ImportProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "UpdateProcessorVersionMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "EvaluationReference": { - "fields": { - "operation": { - "type": "string", - "id": 1 - }, - "evaluation": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "documentai.googleapis.com/Evaluation" - } - }, - "aggregateMetrics": { - "type": "Evaluation.Metrics", - "id": 4 - }, - "aggregateMetricsExact": { - "type": "Evaluation.Metrics", - "id": 5 - } - } - }, - "Evaluation": { - "options": { - "(google.api.resource).type": "documentai.googleapis.com/Evaluation", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "documentCounters": { - "type": "Counters", - "id": 5 - }, - "allEntitiesMetrics": { - "type": "MultiConfidenceMetrics", - "id": 3 - }, - "entityMetrics": { - "keyType": "string", - "type": "MultiConfidenceMetrics", - "id": 4 - }, - "kmsKeyName": { - "type": "string", - "id": 6 - }, - "kmsKeyVersionName": { - "type": "string", - "id": 7 - }, - "revisions": { - "rule": "repeated", - "type": "EvaluationRevision", - "id": 9 - } - }, - "nested": { - "Counters": { - "fields": { - "inputDocumentsCount": { - "type": "int32", - "id": 1 - }, - "invalidDocumentsCount": { - "type": "int32", - "id": 2 - }, - "failedDocumentsCount": { - "type": "int32", - "id": 3 - }, - "evaluatedDocumentsCount": { - "type": "int32", - "id": 4 - } - } - }, - "Metrics": { - "fields": { - "precision": { - "type": "float", - "id": 1 - }, - "recall": { - "type": "float", - "id": 2 - }, - "f1Score": { - "type": "float", - "id": 3 - }, - "predictedOccurrencesCount": { - "type": "int32", - "id": 4 - }, - "groundTruthOccurrencesCount": { - "type": "int32", - "id": 5 - }, - "predictedDocumentCount": { - "type": "int32", - "id": 10 - }, - "groundTruthDocumentCount": { - "type": "int32", - "id": 11 - }, - "truePositivesCount": { - "type": "int32", - "id": 6 - }, - "falsePositivesCount": { - "type": "int32", - "id": 7 - }, - "falseNegativesCount": { - "type": "int32", - "id": 8 - }, - "totalDocumentsCount": { - "type": "int32", - "id": 9 - } - } - }, - "ConfidenceLevelMetrics": { - "fields": { - "confidenceLevel": { - "type": "float", - "id": 1 - }, - "metrics": { - "type": "Metrics", - "id": 2 - } - } - }, - "MultiConfidenceMetrics": { - "fields": { - "confidenceLevelMetrics": { - "rule": "repeated", - "type": "ConfidenceLevelMetrics", - "id": 1 - }, - "confidenceLevelMetricsExact": { - "rule": "repeated", - "type": "ConfidenceLevelMetrics", - "id": 4 - }, - "auprc": { - "type": "float", - "id": 2 - }, - "estimatedCalibrationError": { - "type": "float", - "id": 3 - }, - "auprcExact": { - "type": "float", - "id": 5 - }, - "estimatedCalibrationErrorExact": { - "type": "float", - "id": 6 - }, - "metricsType": { - "type": "MetricsType", - "id": 7 - } - }, - "nested": { - "MetricsType": { - "values": { - "METRICS_TYPE_UNSPECIFIED": 0, - "AGGREGATE": 1 - } - } - } - }, - "EvaluationRevision": { - "fields": { - "revisionId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "documentCounters": { - "type": "Counters", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "allEntitiesMetrics": { - "type": "MultiConfidenceMetrics", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "entityMetrics": { - "keyType": "string", - "type": "MultiConfidenceMetrics", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "CommonOperationMetadata": { - "fields": { - "state": { - "type": "State", - "id": 1 - }, - "stateMessage": { - "type": "string", - "id": 2 - }, - "resource": { - "type": "string", - "id": 5 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "RUNNING": 1, - "CANCELLING": 2, - "SUCCEEDED": 3, - "FAILED": 4, - "CANCELLED": 5 - } - } - } - }, - "ProcessorVersion": { - "options": { - "(google.api.resource).type": "documentai.googleapis.com/ProcessorVersion", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "documentSchema": { - "type": "DocumentSchema", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latestEvaluation": { - "type": "EvaluationReference", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kmsKeyName": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kmsKeyVersionName": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "googleManaged": { - "type": "bool", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deprecationInfo": { - "type": "DeprecationInfo", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "modelType": { - "type": "ModelType", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzi": { - "type": "bool", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "genAiModelInfo": { - "type": "GenAiModelInfo", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "DeprecationInfo": { - "fields": { - "deprecationTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "replacementProcessorVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "GenAiModelInfo": { - "oneofs": { - "modelInfo": { - "oneof": [ - "foundationGenAiModelInfo", - "customGenAiModelInfo" - ] - } - }, - "fields": { - "foundationGenAiModelInfo": { - "type": "FoundationGenAiModelInfo", - "id": 1 - }, - "customGenAiModelInfo": { - "type": "CustomGenAiModelInfo", - "id": 2 - } - }, - "nested": { - "FoundationGenAiModelInfo": { - "fields": { - "finetuningAllowed": { - "type": "bool", - "id": 1 - }, - "minTrainLabeledDocuments": { - "type": "int32", - "id": 2 - } - } - }, - "CustomGenAiModelInfo": { - "fields": { - "customModelType": { - "type": "CustomModelType", - "id": 1 - }, - "baseProcessorVersionId": { - "type": "string", - "id": 2 - } - }, - "nested": { - "CustomModelType": { - "values": { - "CUSTOM_MODEL_TYPE_UNSPECIFIED": 0, - "VERSIONED_FOUNDATION": 1, - "FINE_TUNED": 2 - } - } - } - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "DEPLOYED": 1, - "DEPLOYING": 2, - "UNDEPLOYED": 3, - "UNDEPLOYING": 4, - "CREATING": 5, - "DELETING": 6, - "FAILED": 7, - "IMPORTING": 8 - } - }, - "ModelType": { - "values": { - "MODEL_TYPE_UNSPECIFIED": 0, - "MODEL_TYPE_GENERATIVE": 1, - "MODEL_TYPE_CUSTOM": 2 - } - } - } - }, - "ProcessorVersionAlias": { - "fields": { - "alias": { - "type": "string", - "id": 1 - }, - "processorVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - } - } - }, - "Processor": { - "options": { - "(google.api.resource).type": "documentai.googleapis.com/Processor", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/processors/{processor}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "type": { - "type": "string", - "id": 2 - }, - "displayName": { - "type": "string", - "id": 3 - }, - "state": { - "type": "State", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "defaultProcessorVersion": { - "type": "string", - "id": 9, - "options": { - "(google.api.resource_reference).type": "documentai.googleapis.com/ProcessorVersion" - } - }, - "processorVersionAliases": { - "rule": "repeated", - "type": "ProcessorVersionAlias", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "processEndpoint": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kmsKeyName": { - "type": "string", - "id": 8 - }, - "satisfiesPzs": { - "type": "bool", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzi": { - "type": "bool", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ENABLED": 1, - "DISABLED": 2, - "ENABLING": 3, - "DISABLING": 4, - "CREATING": 5, - "FAILED": 6, - "DELETING": 7 - } - } - } - }, - "ProcessorType": { - "options": { - "(google.api.resource).type": "documentai.googleapis.com/ProcessorType", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/processorTypes/{processor_type}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "string", - "id": 2 - }, - "category": { - "type": "string", - "id": 3 - }, - "availableLocations": { - "rule": "repeated", - "type": "LocationInfo", - "id": 4 - }, - "allowCreation": { - "type": "bool", - "id": 6 - }, - "launchStage": { - "type": "google.api.LaunchStage", - "id": 8 - }, - "sampleDocumentUris": { - "rule": "repeated", - "type": "string", - "id": 9 - } - }, - "nested": { - "LocationInfo": { - "fields": { - "locationId": { - "type": "string", - "id": 1 - } - } - } - } - }, - "DocumentService": { - "options": { - "(google.api.default_host)": "documentai.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "UpdateDataset": { - "requestType": "UpdateDatasetRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1beta3/{dataset.name=projects/*/locations/*/processors/*/dataset}", - "(google.api.http).body": "dataset", - "(google.api.method_signature)": "dataset,update_mask", - "(google.longrunning.operation_info).response_type": "Dataset", - "(google.longrunning.operation_info).metadata_type": "UpdateDatasetOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta3/{dataset.name=projects/*/locations/*/processors/*/dataset}", - "body": "dataset" - } - }, - { - "(google.api.method_signature)": "dataset,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Dataset", - "metadata_type": "UpdateDatasetOperationMetadata" - } - } - ] - }, - "ImportDocuments": { - "requestType": "ImportDocumentsRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:importDocuments", - "(google.api.http).body": "*", - "(google.api.method_signature)": "dataset", - "(google.longrunning.operation_info).response_type": "ImportDocumentsResponse", - "(google.longrunning.operation_info).metadata_type": "ImportDocumentsMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:importDocuments", - "body": "*" - } - }, - { - "(google.api.method_signature)": "dataset" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ImportDocumentsResponse", - "metadata_type": "ImportDocumentsMetadata" - } - } - ] - }, - "GetDocument": { - "requestType": "GetDocumentRequest", - "responseType": "GetDocumentResponse", - "options": { - "(google.api.http).get": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:getDocument", - "(google.api.method_signature)": "dataset" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:getDocument" - } - }, - { - "(google.api.method_signature)": "dataset" - } - ] - }, - "ListDocuments": { - "requestType": "ListDocumentsRequest", - "responseType": "ListDocumentsResponse", - "options": { - "(google.api.http).post": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:listDocuments", - "(google.api.http).body": "*", - "(google.api.method_signature)": "dataset" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:listDocuments", - "body": "*" - } - }, - { - "(google.api.method_signature)": "dataset" - } - ] - }, - "BatchDeleteDocuments": { - "requestType": "BatchDeleteDocumentsRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:batchDeleteDocuments", - "(google.api.http).body": "*", - "(google.api.method_signature)": "dataset", - "(google.longrunning.operation_info).response_type": "BatchDeleteDocumentsResponse", - "(google.longrunning.operation_info).metadata_type": "BatchDeleteDocumentsMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta3/{dataset=projects/*/locations/*/processors/*/dataset}:batchDeleteDocuments", - "body": "*" - } - }, - { - "(google.api.method_signature)": "dataset" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BatchDeleteDocumentsResponse", - "metadata_type": "BatchDeleteDocumentsMetadata" - } - } - ] - }, - "GetDatasetSchema": { - "requestType": "GetDatasetSchemaRequest", - "responseType": "DatasetSchema", - "options": { - "(google.api.http).get": "/v1beta3/{name=projects/*/locations/*/processors/*/dataset/datasetSchema}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta3/{name=projects/*/locations/*/processors/*/dataset/datasetSchema}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateDatasetSchema": { - "requestType": "UpdateDatasetSchemaRequest", - "responseType": "DatasetSchema", - "options": { - "(google.api.http).patch": "/v1beta3/{dataset_schema.name=projects/*/locations/*/processors/*/dataset/datasetSchema}", - "(google.api.http).body": "dataset_schema", - "(google.api.method_signature)": "dataset_schema,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta3/{dataset_schema.name=projects/*/locations/*/processors/*/dataset/datasetSchema}", - "body": "dataset_schema" - } - }, - { - "(google.api.method_signature)": "dataset_schema,update_mask" - } - ] - } - } - }, - "DatasetSplitType": { - "values": { - "DATASET_SPLIT_TYPE_UNSPECIFIED": 0, - "DATASET_SPLIT_TRAIN": 1, - "DATASET_SPLIT_TEST": 2, - "DATASET_SPLIT_UNASSIGNED": 3 - } - }, - "DocumentLabelingState": { - "values": { - "DOCUMENT_LABELING_STATE_UNSPECIFIED": 0, - "DOCUMENT_LABELED": 1, - "DOCUMENT_UNLABELED": 2, - "DOCUMENT_AUTO_LABELED": 3 - } - }, - "UpdateDatasetRequest": { - "fields": { - "dataset": { - "type": "Dataset", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "UpdateDatasetOperationMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - } - } - }, - "ImportDocumentsRequest": { - "fields": { - "dataset": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Dataset" - } - }, - "batchDocumentsImportConfigs": { - "rule": "repeated", - "type": "BatchDocumentsImportConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "BatchDocumentsImportConfig": { - "oneofs": { - "splitTypeConfig": { - "oneof": [ - "datasetSplit", - "autoSplitConfig" - ] - } - }, - "fields": { - "datasetSplit": { - "type": "DatasetSplitType", - "id": 2 - }, - "autoSplitConfig": { - "type": "AutoSplitConfig", - "id": 3 - }, - "batchInputConfig": { - "type": "BatchDocumentsInputConfig", - "id": 1 - }, - "documentType": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AutoSplitConfig": { - "fields": { - "trainingSplitRatio": { - "type": "float", - "id": 1 - } - } - } - } - } - } - }, - "ImportDocumentsResponse": { - "fields": {} - }, - "ImportDocumentsMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - }, - "individualImportStatuses": { - "rule": "repeated", - "type": "IndividualImportStatus", - "id": 2 - }, - "importConfigValidationResults": { - "rule": "repeated", - "type": "ImportConfigValidationResult", - "id": 4 - }, - "totalDocumentCount": { - "type": "int32", - "id": 3 - } - }, - "nested": { - "IndividualImportStatus": { - "fields": { - "inputGcsSource": { - "type": "string", - "id": 1 - }, - "status": { - "type": "google.rpc.Status", - "id": 2 - }, - "outputDocumentId": { - "type": "DocumentId", - "id": 4 - } - } - }, - "ImportConfigValidationResult": { - "fields": { - "inputGcsSource": { - "type": "string", - "id": 1 - }, - "status": { - "type": "google.rpc.Status", - "id": 2 - } - } - } - } - }, - "GetDocumentRequest": { - "fields": { - "dataset": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Dataset" - } - }, - "documentId": { - "type": "DocumentId", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "readMask": { - "type": "google.protobuf.FieldMask", - "id": 3 - }, - "pageRange": { - "type": "DocumentPageRange", - "id": 4 - } - } - }, - "GetDocumentResponse": { - "fields": { - "document": { - "type": "Document", - "id": 1 - } - } - }, - "ListDocumentsRequest": { - "fields": { - "dataset": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/Dataset" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "returnTotalSize": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "skip": { - "type": "int32", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDocumentsResponse": { - "fields": { - "documentMetadata": { - "rule": "repeated", - "type": "DocumentMetadata", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "totalSize": { - "type": "int32", - "id": 3 - } - } - }, - "BatchDeleteDocumentsRequest": { - "fields": { - "dataset": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "datasetDocuments": { - "type": "BatchDatasetDocuments", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "BatchDeleteDocumentsResponse": { - "fields": {} - }, - "BatchDeleteDocumentsMetadata": { - "fields": { - "commonMetadata": { - "type": "CommonOperationMetadata", - "id": 1 - }, - "individualBatchDeleteStatuses": { - "rule": "repeated", - "type": "IndividualBatchDeleteStatus", - "id": 2 - }, - "totalDocumentCount": { - "type": "int32", - "id": 3 - }, - "errorDocumentCount": { - "type": "int32", - "id": 4 - } - }, - "nested": { - "IndividualBatchDeleteStatus": { - "fields": { - "documentId": { - "type": "DocumentId", - "id": 1 - }, - "status": { - "type": "google.rpc.Status", - "id": 2 - } - } - } - } - }, - "GetDatasetSchemaRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "documentai.googleapis.com/DatasetSchema" - } - }, - "visibleFieldsOnly": { - "type": "bool", - "id": 2 - } - } - }, - "UpdateDatasetSchemaRequest": { - "fields": { - "datasetSchema": { - "type": "DatasetSchema", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "DocumentPageRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - }, - "DocumentMetadata": { - "fields": { - "documentId": { - "type": "DocumentId", - "id": 1 - }, - "pageCount": { - "type": "int32", - "id": 2 - }, - "datasetType": { - "type": "DatasetSplitType", - "id": 3 - }, - "labelingState": { - "type": "DocumentLabelingState", - "id": 5 - }, - "displayName": { - "type": "string", - "id": 6 - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "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 - } - }, - "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 - } - }, - "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 - } - } - } - } - }, - "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 - } - } - } - } - } - }, - "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 - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "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/postaladdress;postaladdress", - "java_multiple_files": true, - "java_outer_classname": "PostalAddressProto", - "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 - } - } - } - } - }, - "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-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js deleted file mode 100644 index 3a6cbaf23ed..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.batch_process_documents.js +++ /dev/null @@ -1,96 +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 documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_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 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}` - */ - // const name = 'abc123' - /** - * The input documents for the - * BatchProcessDocuments google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments - * method. - */ - // const inputDocuments = {} - /** - * The output configuration for the - * BatchProcessDocuments google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments - * method. - */ - // const documentOutputConfig = {} - /** - * Whether human review should be skipped for this request. Default to - * `false`. - */ - // const skipHumanReview = true - /** - * Inference-time options for the process API - */ - // const processOptions = {} - /** - * 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. - */ - // const labels = [1,2,3,4] - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callBatchProcessDocuments() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.batchProcessDocuments(request); - const [response] = await operation.promise(); - console.log(response); - } - - callBatchProcessDocuments(); - // [END documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_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-documentai/samples/generated/v1/document_processor_service.create_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js deleted file mode 100644 index d03d0764f5a..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.create_processor.js +++ /dev/null @@ -1,72 +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, processor) { - // [START documentai_v1_generated_DocumentProcessorService_CreateProcessor_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 (project and location) under which to create the - * processor. Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * 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. - */ - // const processor = {} - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callCreateProcessor() { - // Construct request - const request = { - parent, - processor, - }; - - // Run request - const response = await documentaiClient.createProcessor(request); - console.log(response); - } - - callCreateProcessor(); - // [END documentai_v1_generated_DocumentProcessorService_CreateProcessor_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-documentai/samples/generated/v1/document_processor_service.delete_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor.js deleted file mode 100644 index 788331ca312..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor.js +++ /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. ** - - - -'use strict'; - -function main(name) { - // [START documentai_v1_generated_DocumentProcessorService_DeleteProcessor_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 processor resource name to be deleted. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callDeleteProcessor() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.deleteProcessor(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteProcessor(); - // [END documentai_v1_generated_DocumentProcessorService_DeleteProcessor_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-documentai/samples/generated/v1/document_processor_service.delete_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor_version.js deleted file mode 100644 index 8ab461185ff..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.delete_processor_version.js +++ /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. ** - - - -'use strict'; - -function main(name) { - // [START documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_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 processor version resource name to be deleted. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callDeleteProcessorVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.deleteProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteProcessorVersion(); - // [END documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_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-documentai/samples/generated/v1/document_processor_service.deploy_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.deploy_processor_version.js deleted file mode 100644 index b9e10868edf..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.deploy_processor_version.js +++ /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. ** - - - -'use strict'; - -function main(name) { - // [START documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_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 processor version resource name to be deployed. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callDeployProcessorVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.deployProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeployProcessorVersion(); - // [END documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_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-documentai/samples/generated/v1/document_processor_service.disable_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.disable_processor.js deleted file mode 100644 index d4983e9d3a5..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.disable_processor.js +++ /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. ** - - - -'use strict'; - -function main(name) { - // [START documentai_v1_generated_DocumentProcessorService_DisableProcessor_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 processor resource name to be disabled. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callDisableProcessor() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.disableProcessor(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDisableProcessor(); - // [END documentai_v1_generated_DocumentProcessorService_DisableProcessor_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-documentai/samples/generated/v1/document_processor_service.enable_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.enable_processor.js deleted file mode 100644 index f73979b4813..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.enable_processor.js +++ /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. ** - - - -'use strict'; - -function main(name) { - // [START documentai_v1_generated_DocumentProcessorService_EnableProcessor_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 processor resource name to be enabled. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callEnableProcessor() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.enableProcessor(request); - const [response] = await operation.promise(); - console.log(response); - } - - callEnableProcessor(); - // [END documentai_v1_generated_DocumentProcessorService_EnableProcessor_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-documentai/samples/generated/v1/document_processor_service.evaluate_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.evaluate_processor_version.js deleted file mode 100644 index cd86267491a..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.evaluate_processor_version.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(processorVersion) { - // [START documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_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 of the - * ProcessorVersion google.cloud.documentai.v1.ProcessorVersion to - * evaluate. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - */ - // const processorVersion = 'abc123' - /** - * Optional. The documents used in the evaluation. If unspecified, use the - * processor's dataset as evaluation input. - */ - // const evaluationDocuments = {} - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callEvaluateProcessorVersion() { - // Construct request - const request = { - processorVersion, - }; - - // Run request - const [operation] = await documentaiClient.evaluateProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callEvaluateProcessorVersion(); - // [END documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_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-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js deleted file mode 100644 index bd9d2930a14..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.fetch_processor_types.js +++ /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. ** - - - -'use strict'; - -function main(parent) { - // [START documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_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 location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - */ - // const parent = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callFetchProcessorTypes() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await documentaiClient.fetchProcessorTypes(request); - console.log(response); - } - - callFetchProcessorTypes(); - // [END documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_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-documentai/samples/generated/v1/document_processor_service.get_evaluation.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_evaluation.js deleted file mode 100644 index 09352fe7b45..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_evaluation.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 documentai_v1_generated_DocumentProcessorService_GetEvaluation_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 of the - * Evaluation google.cloud.documentai.v1.Evaluation to get. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callGetEvaluation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await documentaiClient.getEvaluation(request); - console.log(response); - } - - callGetEvaluation(); - // [END documentai_v1_generated_DocumentProcessorService_GetEvaluation_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-documentai/samples/generated/v1/document_processor_service.get_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor.js deleted file mode 100644 index 8f1273f2526..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor.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 documentai_v1_generated_DocumentProcessorService_GetProcessor_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 processor resource name. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callGetProcessor() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await documentaiClient.getProcessor(request); - console.log(response); - } - - callGetProcessor(); - // [END documentai_v1_generated_DocumentProcessorService_GetProcessor_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-documentai/samples/generated/v1/document_processor_service.get_processor_type.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_type.js deleted file mode 100644 index 7a2c66adbb0..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_type.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 documentai_v1_generated_DocumentProcessorService_GetProcessorType_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 processor type resource name. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callGetProcessorType() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await documentaiClient.getProcessorType(request); - console.log(response); - } - - callGetProcessorType(); - // [END documentai_v1_generated_DocumentProcessorService_GetProcessorType_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-documentai/samples/generated/v1/document_processor_service.get_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_version.js deleted file mode 100644 index edab00102ff..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.get_processor_version.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 documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_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 processor resource name. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callGetProcessorVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await documentaiClient.getProcessorVersion(request); - console.log(response); - } - - callGetProcessorVersion(); - // [END documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_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-documentai/samples/generated/v1/document_processor_service.list_evaluations.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js deleted file mode 100644 index 895b8790063..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_evaluations.js +++ /dev/null @@ -1,77 +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 documentai_v1_generated_DocumentProcessorService_ListEvaluations_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 of the - * ProcessorVersion google.cloud.documentai.v1.ProcessorVersion to list - * evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - */ - // const parent = 'abc123' - /** - * 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`. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListEvaluations` call. - * Provide this to retrieve the subsequent page. - */ - // const pageToken = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callListEvaluations() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = documentaiClient.listEvaluationsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListEvaluations(); - // [END documentai_v1_generated_DocumentProcessorService_ListEvaluations_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-documentai/samples/generated/v1/document_processor_service.list_processor_types.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js deleted file mode 100644 index b4d334afb90..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_types.js +++ /dev/null @@ -1,74 +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 documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_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 location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - */ - // const parent = 'abc123' - /** - * 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`. - */ - // const pageSize = 1234 - /** - * Used to retrieve the next page of results, empty if at the end of the list. - */ - // const pageToken = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callListProcessorTypes() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = documentaiClient.listProcessorTypesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListProcessorTypes(); - // [END documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_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-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.js deleted file mode 100644 index 119fc6fadbe..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processor_versions.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(parent) { - // [START documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_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 (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - */ - // const parent = 'abc123' - /** - * 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`. - */ - // const pageSize = 1234 - /** - * We will return the processor versions sorted by creation time. The page - * token will point to the next processor version. - */ - // const pageToken = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callListProcessorVersions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = documentaiClient.listProcessorVersionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListProcessorVersions(); - // [END documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_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-documentai/samples/generated/v1/document_processor_service.list_processors.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.js deleted file mode 100644 index 240f213c8a4..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.list_processors.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) { - // [START documentai_v1_generated_DocumentProcessorService_ListProcessors_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 (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * 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`. - */ - // const pageSize = 1234 - /** - * We will return the processors sorted by creation time. The page token - * will point to the next processor. - */ - // const pageToken = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callListProcessors() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = documentaiClient.listProcessorsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListProcessors(); - // [END documentai_v1_generated_DocumentProcessorService_ListProcessors_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-documentai/samples/generated/v1/document_processor_service.process_document.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js deleted file mode 100644 index abe63e6d050..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.process_document.js +++ /dev/null @@ -1,110 +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 documentai_v1_generated_DocumentProcessorService_ProcessDocument_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. - */ - /** - * An inline document proto. - */ - // const inlineDocument = {} - /** - * A raw document content (bytes). - */ - // const rawDocument = {} - /** - * A raw document on Google Cloud Storage. - */ - // const gcsDocument = {} - /** - * 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}` - */ - // const name = 'abc123' - /** - * Whether human review should be skipped for this request. Default to - * `false`. - */ - // const skipHumanReview = true - /** - * 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}`. - */ - // const fieldMask = {} - /** - * Inference-time options for the process API - */ - // const processOptions = {} - /** - * 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. - */ - // const labels = [1,2,3,4] - /** - * Optional. Option to remove images from the document. - */ - // const imagelessMode = true - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callProcessDocument() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await documentaiClient.processDocument(request); - console.log(response); - } - - callProcessDocument(); - // [END documentai_v1_generated_DocumentProcessorService_ProcessDocument_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-documentai/samples/generated/v1/document_processor_service.review_document.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js deleted file mode 100644 index 12f5c3634c3..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.review_document.js +++ /dev/null @@ -1,80 +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(humanReviewConfig) { - // [START documentai_v1_generated_DocumentProcessorService_ReviewDocument_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. - */ - /** - * An inline document proto. - */ - // const inlineDocument = {} - /** - * Required. The resource name of the - * HumanReviewConfig google.cloud.documentai.v1.HumanReviewConfig that the - * document will be reviewed with. - */ - // const humanReviewConfig = 'abc123' - /** - * Whether the validation should be performed on the ad-hoc review request. - */ - // const enableSchemaValidation = true - /** - * The priority of the human review task. - */ - // const priority = {} - /** - * The document schema of the human review task. - */ - // const documentSchema = {} - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callReviewDocument() { - // Construct request - const request = { - humanReviewConfig, - }; - - // Run request - const [operation] = await documentaiClient.reviewDocument(request); - const [response] = await operation.promise(); - console.log(response); - } - - callReviewDocument(); - // [END documentai_v1_generated_DocumentProcessorService_ReviewDocument_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-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js deleted file mode 100644 index 7e92c0f3a83..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.set_default_processor_version.js +++ /dev/null @@ -1,72 +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(processor, defaultProcessorVersion) { - // [START documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_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 of the - * Processor google.cloud.documentai.v1.Processor to change default - * version. - */ - // const processor = 'abc123' - /** - * 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}` - */ - // const defaultProcessorVersion = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callSetDefaultProcessorVersion() { - // Construct request - const request = { - processor, - defaultProcessorVersion, - }; - - // Run request - const [operation] = await documentaiClient.setDefaultProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callSetDefaultProcessorVersion(); - // [END documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_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-documentai/samples/generated/v1/document_processor_service.train_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js deleted file mode 100644 index 594e2ee2ccc..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.train_processor_version.js +++ /dev/null @@ -1,92 +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, processorVersion) { - // [START documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_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. - */ - /** - * Options to control Custom Document Extraction (CDE) Processor. - */ - // const customDocumentExtractionOptions = {} - /** - * Options to control foundation model tuning of a processor. - */ - // const foundationModelTuningOptions = {} - /** - * Required. The parent (project, location and processor) to create the new - * version for. Format: - * `projects/{project}/locations/{location}/processors/{processor}`. - */ - // const parent = 'abc123' - /** - * Required. The processor version to be created. - */ - // const processorVersion = {} - /** - * Optional. The schema the processor version will be trained with. - */ - // const documentSchema = {} - /** - * Optional. The input data used to train the - * ProcessorVersion google.cloud.documentai.v1.ProcessorVersion. - */ - // const inputData = {} - /** - * 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}`. - */ - // const baseProcessorVersion = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callTrainProcessorVersion() { - // Construct request - const request = { - parent, - processorVersion, - }; - - // Run request - const [operation] = await documentaiClient.trainProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callTrainProcessorVersion(); - // [END documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_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-documentai/samples/generated/v1/document_processor_service.undeploy_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.undeploy_processor_version.js deleted file mode 100644 index 8b9ce3c6a60..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/document_processor_service.undeploy_processor_version.js +++ /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. ** - - - -'use strict'; - -function main(name) { - // [START documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_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 processor version resource name to be undeployed. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callUndeployProcessorVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.undeployProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUndeployProcessorVersion(); - // [END documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_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-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json b/owl-bot-staging/google-cloud-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json deleted file mode 100644 index e88b12f1f5d..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1/snippet_metadata_google.cloud.documentai.v1.json +++ /dev/null @@ -1,1031 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-documentai", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.documentai.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_ProcessDocument_async", - "title": "DocumentProcessorService processDocument Sample", - "origin": "API_DEFINITION", - "description": " Processes a single document.", - "canonical": true, - "file": "document_processor_service.process_document.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 102, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ProcessDocument", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument", - "async": true, - "parameters": [ - { - "name": "inline_document", - "type": ".google.cloud.documentai.v1.Document" - }, - { - "name": "raw_document", - "type": ".google.cloud.documentai.v1.RawDocument" - }, - { - "name": "gcs_document", - "type": ".google.cloud.documentai.v1.GcsDocument" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "skip_human_review", - "type": "TYPE_BOOL" - }, - { - "name": "field_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "process_options", - "type": ".google.cloud.documentai.v1.ProcessOptions" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "imageless_mode", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.documentai.v1.ProcessResponse", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ProcessDocument", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_async", - "title": "DocumentProcessorService batchProcessDocuments Sample", - "origin": "API_DEFINITION", - "description": " LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.", - "canonical": true, - "file": "document_processor_service.batch_process_documents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 88, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchProcessDocuments", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "input_documents", - "type": ".google.cloud.documentai.v1.BatchDocumentsInputConfig" - }, - { - "name": "document_output_config", - "type": ".google.cloud.documentai.v1.DocumentOutputConfig" - }, - { - "name": "skip_human_review", - "type": "TYPE_BOOL" - }, - { - "name": "process_options", - "type": ".google.cloud.documentai.v1.ProcessOptions" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "BatchProcessDocuments", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_async", - "title": "DocumentProcessorService fetchProcessorTypes Sample", - "origin": "API_DEFINITION", - "description": " Fetches processor types. Note that we don't use [ListProcessorTypes][google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes] here, because it isn't paginated.", - "canonical": true, - "file": "document_processor_service.fetch_processor_types.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchProcessorTypes", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1.FetchProcessorTypesResponse", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "FetchProcessorTypes", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.FetchProcessorTypes", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_async", - "title": "DocumentProcessorService listProcessorTypes Sample", - "origin": "API_DEFINITION", - "description": " Lists the processor types that exist.", - "canonical": true, - "file": "document_processor_service.list_processor_types.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListProcessorTypes", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1.ListProcessorTypesResponse", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ListProcessorTypes", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_GetProcessorType_async", - "title": "DocumentProcessorService getProcessorType Sample", - "origin": "API_DEFINITION", - "description": " Gets a processor type detail.", - "canonical": true, - "file": "document_processor_service.get_processor_type.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetProcessorType", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1.ProcessorType", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "GetProcessorType", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessorType", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_ListProcessors_async", - "title": "DocumentProcessorService listProcessors Sample", - "origin": "API_DEFINITION", - "description": " Lists all processors which belong to this project.", - "canonical": true, - "file": "document_processor_service.list_processors.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListProcessors", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessors", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1.ListProcessorsResponse", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ListProcessors", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessors", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_GetProcessor_async", - "title": "DocumentProcessorService getProcessor Sample", - "origin": "API_DEFINITION", - "description": " Gets a processor detail.", - "canonical": true, - "file": "document_processor_service.get_processor.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetProcessor", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessor", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1.Processor", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "GetProcessor", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessor", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_async", - "title": "DocumentProcessorService trainProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Trains a new processor version. Operation metadata is returned as [TrainProcessorVersionMetadata][google.cloud.documentai.v1.TrainProcessorVersionMetadata].", - "canonical": true, - "file": "document_processor_service.train_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TrainProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion", - "async": true, - "parameters": [ - { - "name": "custom_document_extraction_options", - "type": ".google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions" - }, - { - "name": "foundation_model_tuning_options", - "type": ".google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "processor_version", - "type": ".google.cloud.documentai.v1.ProcessorVersion" - }, - { - "name": "document_schema", - "type": ".google.cloud.documentai.v1.DocumentSchema" - }, - { - "name": "input_data", - "type": ".google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData" - }, - { - "name": "base_processor_version", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "TrainProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_async", - "title": "DocumentProcessorService getProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Gets a processor version detail.", - "canonical": true, - "file": "document_processor_service.get_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1.ProcessorVersion", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "GetProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_async", - "title": "DocumentProcessorService listProcessorVersions Sample", - "origin": "API_DEFINITION", - "description": " Lists all versions of a processor.", - "canonical": true, - "file": "document_processor_service.list_processor_versions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListProcessorVersions", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1.ListProcessorVersionsResponse", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ListProcessorVersions", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListProcessorVersions", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_async", - "title": "DocumentProcessorService deleteProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Deletes the processor version, all artifacts under the processor version will be deleted.", - "canonical": true, - "file": "document_processor_service.delete_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "DeleteProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_async", - "title": "DocumentProcessorService deployProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Deploys the processor version.", - "canonical": true, - "file": "document_processor_service.deploy_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeployProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "DeployProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DeployProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_async", - "title": "DocumentProcessorService undeployProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Undeploys the processor version.", - "canonical": true, - "file": "document_processor_service.undeploy_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UndeployProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "UndeployProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.UndeployProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_CreateProcessor_async", - "title": "DocumentProcessorService createProcessor Sample", - "origin": "API_DEFINITION", - "description": " 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.", - "canonical": true, - "file": "document_processor_service.create_processor.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateProcessor", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "processor", - "type": ".google.cloud.documentai.v1.Processor" - } - ], - "resultType": ".google.cloud.documentai.v1.Processor", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "CreateProcessor", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.CreateProcessor", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_DeleteProcessor_async", - "title": "DocumentProcessorService deleteProcessor Sample", - "origin": "API_DEFINITION", - "description": " Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.", - "canonical": true, - "file": "document_processor_service.delete_processor.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteProcessor", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "DeleteProcessor", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DeleteProcessor", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_EnableProcessor_async", - "title": "DocumentProcessorService enableProcessor Sample", - "origin": "API_DEFINITION", - "description": " Enables a processor", - "canonical": true, - "file": "document_processor_service.enable_processor.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "EnableProcessor", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "EnableProcessor", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.EnableProcessor", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_DisableProcessor_async", - "title": "DocumentProcessorService disableProcessor Sample", - "origin": "API_DEFINITION", - "description": " Disables a processor", - "canonical": true, - "file": "document_processor_service.disable_processor.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DisableProcessor", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "DisableProcessor", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.DisableProcessor", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_async", - "title": "DocumentProcessorService setDefaultProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " 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].", - "canonical": true, - "file": "document_processor_service.set_default_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetDefaultProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion", - "async": true, - "parameters": [ - { - "name": "processor", - "type": "TYPE_STRING" - }, - { - "name": "default_processor_version", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "SetDefaultProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.SetDefaultProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_ReviewDocument_async", - "title": "DocumentProcessorService reviewDocument Sample", - "origin": "API_DEFINITION", - "description": " Send a document for Human Review. The input document should be processed by the specified processor.", - "canonical": true, - "file": "document_processor_service.review_document.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ReviewDocument", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument", - "async": true, - "parameters": [ - { - "name": "inline_document", - "type": ".google.cloud.documentai.v1.Document" - }, - { - "name": "human_review_config", - "type": "TYPE_STRING" - }, - { - "name": "enable_schema_validation", - "type": "TYPE_BOOL" - }, - { - "name": "priority", - "type": ".google.cloud.documentai.v1.ReviewDocumentRequest.Priority" - }, - { - "name": "document_schema", - "type": ".google.cloud.documentai.v1.DocumentSchema" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ReviewDocument", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ReviewDocument", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_async", - "title": "DocumentProcessorService evaluateProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.", - "canonical": true, - "file": "document_processor_service.evaluate_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "EvaluateProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion", - "async": true, - "parameters": [ - { - "name": "processor_version", - "type": "TYPE_STRING" - }, - { - "name": "evaluation_documents", - "type": ".google.cloud.documentai.v1.BatchDocumentsInputConfig" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "EvaluateProcessorVersion", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.EvaluateProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_GetEvaluation_async", - "title": "DocumentProcessorService getEvaluation Sample", - "origin": "API_DEFINITION", - "description": " Retrieves a specific evaluation.", - "canonical": true, - "file": "document_processor_service.get_evaluation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetEvaluation", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetEvaluation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1.Evaluation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "GetEvaluation", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.GetEvaluation", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1_generated_DocumentProcessorService_ListEvaluations_async", - "title": "DocumentProcessorService listEvaluations Sample", - "origin": "API_DEFINITION", - "description": " Retrieves a set of evaluations for a given processor version.", - "canonical": true, - "file": "document_processor_service.list_evaluations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListEvaluations", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListEvaluations", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1.ListEvaluationsResponse", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ListEvaluations", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService.ListEvaluations", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1.DocumentProcessorService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js deleted file mode 100644 index 1735575df6c..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.batch_process_documents.js +++ /dev/null @@ -1,104 +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 documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_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 of - * Processor google.cloud.documentai.v1beta3.Processor or - * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - */ - // const name = 'abc123' - /** - * The input config for each single document in the batch process. - */ - // const inputConfigs = [1,2,3,4] - /** - * The overall output config for batch process. - */ - // const outputConfig = {} - /** - * The input documents for the - * BatchProcessDocuments google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments - * method. - */ - // const inputDocuments = {} - /** - * The output configuration for the - * BatchProcessDocuments google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments - * method. - */ - // const documentOutputConfig = {} - /** - * Whether human review should be skipped for this request. Default to - * `false`. - */ - // const skipHumanReview = true - /** - * Inference-time options for the process API - */ - // const processOptions = {} - /** - * 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. - */ - // const labels = [1,2,3,4] - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callBatchProcessDocuments() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.batchProcessDocuments(request); - const [response] = await operation.promise(); - console.log(response); - } - - callBatchProcessDocuments(); - // [END documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_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-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js deleted file mode 100644 index 171df6a14c6..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.create_processor.js +++ /dev/null @@ -1,72 +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, processor) { - // [START documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_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 (project and location) under which to create the - * processor. Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Required. The processor to be created, requires - * Processor.type google.cloud.documentai.v1beta3.Processor.type and - * Processor.display_name google.cloud.documentai.v1beta3.Processor.display_name - * to be set. Also, the - * Processor.kms_key_name google.cloud.documentai.v1beta3.Processor.kms_key_name - * field must be set if the processor is under CMEK. - */ - // const processor = {} - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callCreateProcessor() { - // Construct request - const request = { - parent, - processor, - }; - - // Run request - const response = await documentaiClient.createProcessor(request); - console.log(response); - } - - callCreateProcessor(); - // [END documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_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-documentai/samples/generated/v1beta3/document_processor_service.delete_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor.js deleted file mode 100644 index 629a060ceea..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor.js +++ /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. ** - - - -'use strict'; - -function main(name) { - // [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_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 processor resource name to be deleted. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callDeleteProcessor() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.deleteProcessor(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteProcessor(); - // [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_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-documentai/samples/generated/v1beta3/document_processor_service.delete_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor_version.js deleted file mode 100644 index be29d0046bc..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.delete_processor_version.js +++ /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. ** - - - -'use strict'; - -function main(name) { - // [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_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 processor version resource name to be deleted. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callDeleteProcessorVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.deleteProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteProcessorVersion(); - // [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js deleted file mode 100644 index da24f431eeb..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js +++ /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. ** - - - -'use strict'; - -function main(name) { - // [START documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_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 processor version resource name to be deployed. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callDeployProcessorVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.deployProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeployProcessorVersion(); - // [END documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js deleted file mode 100644 index 4e72fb33c72..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js +++ /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. ** - - - -'use strict'; - -function main(name) { - // [START documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_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 processor resource name to be disabled. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callDisableProcessor() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.disableProcessor(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDisableProcessor(); - // [END documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_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-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js deleted file mode 100644 index 4dac9fe7942..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js +++ /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. ** - - - -'use strict'; - -function main(name) { - // [START documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_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 processor resource name to be enabled. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callEnableProcessor() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.enableProcessor(request); - const [response] = await operation.promise(); - console.log(response); - } - - callEnableProcessor(); - // [END documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_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-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js deleted file mode 100644 index 2b78653accd..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.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(processorVersion) { - // [START documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_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 of the - * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to - * evaluate. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - */ - // const processorVersion = 'abc123' - /** - * Optional. The documents used in the evaluation. If unspecified, use the - * processor's dataset as evaluation input. - */ - // const evaluationDocuments = {} - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callEvaluateProcessorVersion() { - // Construct request - const request = { - processorVersion, - }; - - // Run request - const [operation] = await documentaiClient.evaluateProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callEvaluateProcessorVersion(); - // [END documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js deleted file mode 100644 index c7751cec395..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js +++ /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. ** - - - -'use strict'; - -function main(parent) { - // [START documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_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 location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - */ - // const parent = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callFetchProcessorTypes() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await documentaiClient.fetchProcessorTypes(request); - console.log(response); - } - - callFetchProcessorTypes(); - // [END documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_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-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js deleted file mode 100644 index 88e6c5625dd..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.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 documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_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 of the - * Evaluation google.cloud.documentai.v1beta3.Evaluation to get. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callGetEvaluation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await documentaiClient.getEvaluation(request); - console.log(response); - } - - callGetEvaluation(); - // [END documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_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-documentai/samples/generated/v1beta3/document_processor_service.get_processor.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor.js deleted file mode 100644 index 5eedad854c0..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor.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 documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_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 processor resource name. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callGetProcessor() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await documentaiClient.getProcessor(request); - console.log(response); - } - - callGetProcessor(); - // [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_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-documentai/samples/generated/v1beta3/document_processor_service.get_processor_type.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_type.js deleted file mode 100644 index 25960debe86..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_type.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 documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_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 processor type resource name. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callGetProcessorType() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await documentaiClient.getProcessorType(request); - console.log(response); - } - - callGetProcessorType(); - // [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_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-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.js deleted file mode 100644 index 8768ac89a5c..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.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 documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_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 processor resource name. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callGetProcessorVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await documentaiClient.getProcessorVersion(request); - console.log(response); - } - - callGetProcessorVersion(); - // [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js deleted file mode 100644 index 931fdec6cef..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.import_processor_version.js +++ /dev/null @@ -1,74 +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 documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_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. - */ - /** - * The source processor version to import from. The source processor version - * and destination processor need to be in the same environment and region. - */ - // const processorVersionSource = 'abc123' - /** - * The source processor version to import from. It can be from a different - * environment and region than the destination processor. - */ - // const externalProcessorVersionSource = {} - /** - * Required. The destination processor name to create the processor version - * in. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - */ - // const parent = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callImportProcessorVersion() { - // Construct request - const request = { - parent, - }; - - // Run request - const [operation] = await documentaiClient.importProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callImportProcessorVersion(); - // [END documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js deleted file mode 100644 index 0a0681fb3c5..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js +++ /dev/null @@ -1,77 +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 documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_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 of the - * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to - * list evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - */ - // const parent = 'abc123' - /** - * 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`. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListEvaluations` call. - * Provide this to retrieve the subsequent page. - */ - // const pageToken = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callListEvaluations() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = documentaiClient.listEvaluationsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListEvaluations(); - // [END documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_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-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js deleted file mode 100644 index 73397c4e9c3..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js +++ /dev/null @@ -1,74 +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 documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_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 location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - */ - // const parent = 'abc123' - /** - * 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`. - */ - // const pageSize = 1234 - /** - * Used to retrieve the next page of results, empty if at the end of the list. - */ - // const pageToken = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callListProcessorTypes() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = documentaiClient.listProcessorTypesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListProcessorTypes(); - // [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_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-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js deleted file mode 100644 index 98c37e1f2ef..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.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(parent) { - // [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_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 (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - */ - // const parent = 'abc123' - /** - * 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`. - */ - // const pageSize = 1234 - /** - * We will return the processor versions sorted by creation time. The page - * token will point to the next processor version. - */ - // const pageToken = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callListProcessorVersions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = documentaiClient.listProcessorVersionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListProcessorVersions(); - // [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_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-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js deleted file mode 100644 index c04b2b3bc67..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.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) { - // [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_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 (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - */ - // const parent = 'abc123' - /** - * 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`. - */ - // const pageSize = 1234 - /** - * We will return the processors sorted by creation time. The page token - * will point to the next processor. - */ - // const pageToken = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callListProcessors() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = documentaiClient.listProcessorsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListProcessors(); - // [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_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-documentai/samples/generated/v1beta3/document_processor_service.process_document.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js deleted file mode 100644 index b1342802bd0..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js +++ /dev/null @@ -1,117 +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 documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_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. - */ - /** - * An inline document proto. - */ - // const inlineDocument = {} - /** - * A raw document content (bytes). - */ - // const rawDocument = {} - /** - * A raw document on Google Cloud Storage. - */ - // const gcsDocument = {} - /** - * Required. The resource name of the - * Processor google.cloud.documentai.v1beta3.Processor or - * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion - * to use for processing. If a - * Processor google.cloud.documentai.v1beta3.Processor is specified, the - * server will use its default - * version google.cloud.documentai.v1beta3.Processor.default_processor_version. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - */ - // const name = 'abc123' - /** - * The document payload, the - * content google.cloud.documentai.v1beta3.Document.content and - * mime_type google.cloud.documentai.v1beta3.Document.mime_type fields must - * be set. - */ - // const document = {} - /** - * Whether human review should be skipped for this request. Default to - * `false`. - */ - // const skipHumanReview = true - /** - * Specifies which fields to include in the - * ProcessResponse.document google.cloud.documentai.v1beta3.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}`. - */ - // const fieldMask = {} - /** - * Inference-time options for the process API - */ - // const processOptions = {} - /** - * 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. - */ - // const labels = [1,2,3,4] - /** - * Optional. Option to remove images from the document. - */ - // const imagelessMode = true - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callProcessDocument() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await documentaiClient.processDocument(request); - console.log(response); - } - - callProcessDocument(); - // [END documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_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-documentai/samples/generated/v1beta3/document_processor_service.review_document.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js deleted file mode 100644 index 82e99686494..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.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(humanReviewConfig) { - // [START documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_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. - */ - /** - * An inline document proto. - */ - // const inlineDocument = {} - /** - * Required. The resource name of the - * HumanReviewConfig google.cloud.documentai.v1beta3.HumanReviewConfig that - * the document will be reviewed with. - */ - // const humanReviewConfig = 'abc123' - /** - * The document that needs human review. - */ - // const document = {} - /** - * Whether the validation should be performed on the ad-hoc review request. - */ - // const enableSchemaValidation = true - /** - * The priority of the human review task. - */ - // const priority = {} - /** - * The document schema of the human review task. - */ - // const documentSchema = {} - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callReviewDocument() { - // Construct request - const request = { - humanReviewConfig, - }; - - // Run request - const [operation] = await documentaiClient.reviewDocument(request); - const [response] = await operation.promise(); - console.log(response); - } - - callReviewDocument(); - // [END documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_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-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js deleted file mode 100644 index 7fad5cfe78f..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js +++ /dev/null @@ -1,72 +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(processor, defaultProcessorVersion) { - // [START documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_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 of the - * Processor google.cloud.documentai.v1beta3.Processor to change default - * version. - */ - // const processor = 'abc123' - /** - * Required. The resource name of child - * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion to use - * as default. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - */ - // const defaultProcessorVersion = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callSetDefaultProcessorVersion() { - // Construct request - const request = { - processor, - defaultProcessorVersion, - }; - - // Run request - const [operation] = await documentaiClient.setDefaultProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callSetDefaultProcessorVersion(); - // [END documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js deleted file mode 100644 index f8bce065e10..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js +++ /dev/null @@ -1,92 +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, processorVersion) { - // [START documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_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. - */ - /** - * Options to control Custom Document Extraction (CDE) Processor. - */ - // const customDocumentExtractionOptions = {} - /** - * Options to control foundation model tuning of a processor. - */ - // const foundationModelTuningOptions = {} - /** - * Required. The parent (project, location and processor) to create the new - * version for. Format: - * `projects/{project}/locations/{location}/processors/{processor}`. - */ - // const parent = 'abc123' - /** - * Required. The processor version to be created. - */ - // const processorVersion = {} - /** - * Optional. The schema the processor version will be trained with. - */ - // const documentSchema = {} - /** - * Optional. The input data used to train the - * ProcessorVersion google.cloud.documentai.v1beta3.ProcessorVersion. - */ - // const inputData = {} - /** - * 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}`. - */ - // const baseProcessorVersion = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callTrainProcessorVersion() { - // Construct request - const request = { - parent, - processorVersion, - }; - - // Run request - const [operation] = await documentaiClient.trainProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callTrainProcessorVersion(); - // [END documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_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-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js deleted file mode 100644 index b1adc638b86..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js +++ /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. ** - - - -'use strict'; - -function main(name) { - // [START documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_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 processor version resource name to be undeployed. - */ - // const name = 'abc123' - - // Imports the Documentai library - const {DocumentProcessorServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentProcessorServiceClient(); - - async function callUndeployProcessorVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await documentaiClient.undeployProcessorVersion(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUndeployProcessorVersion(); - // [END documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_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-documentai/samples/generated/v1beta3/document_service.batch_delete_documents.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.batch_delete_documents.js deleted file mode 100644 index 041eb3823ab..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.batch_delete_documents.js +++ /dev/null @@ -1,72 +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(dataset, datasetDocuments) { - // [START documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_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 dataset resource name. - * Format: - * projects/{project}/locations/{location}/processors/{processor}/dataset - */ - // const dataset = 'abc123' - /** - * Required. Dataset documents input. If given `filter`, all documents - * satisfying the filter will be deleted. If given documentIds, a maximum of - * 50 documents can be deleted in a batch. The request will be rejected if - * more than 50 document_ids are provided. - */ - // const datasetDocuments = {} - - // Imports the Documentai library - const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentServiceClient(); - - async function callBatchDeleteDocuments() { - // Construct request - const request = { - dataset, - datasetDocuments, - }; - - // Run request - const [operation] = await documentaiClient.batchDeleteDocuments(request); - const [response] = await operation.promise(); - console.log(response); - } - - callBatchDeleteDocuments(); - // [END documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_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-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.js deleted file mode 100644 index 99fdaf534d3..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.get_dataset_schema.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(name) { - // [START documentai_v1beta3_generated_DocumentService_GetDatasetSchema_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 dataset schema resource name. - * Format: - * projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema - */ - // const name = 'abc123' - /** - * If set, only returns the visible fields of the schema. - */ - // const visibleFieldsOnly = true - - // Imports the Documentai library - const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentServiceClient(); - - async function callGetDatasetSchema() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await documentaiClient.getDatasetSchema(request); - console.log(response); - } - - callGetDatasetSchema(); - // [END documentai_v1beta3_generated_DocumentService_GetDatasetSchema_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-documentai/samples/generated/v1beta3/document_service.get_document.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.get_document.js deleted file mode 100644 index 70a64d24e75..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.get_document.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(dataset, documentId) { - // [START documentai_v1beta3_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 resource name of the dataset that the document belongs to . - * Format: - * projects/{project}/locations/{location}/processors/{processor}/dataset - */ - // const dataset = 'abc123' - /** - * Required. Document identifier. - */ - // const documentId = {} - /** - * If set, only fields listed here will be returned. Otherwise, all fields - * will be returned by default. - */ - // const readMask = {} - /** - * List of pages for which the fields specified in the `read_mask` must - * be served. - */ - // const pageRange = {} - - // Imports the Documentai library - const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentServiceClient(); - - async function callGetDocument() { - // Construct request - const request = { - dataset, - documentId, - }; - - // Run request - const response = await documentaiClient.getDocument(request); - console.log(response); - } - - callGetDocument(); - // [END documentai_v1beta3_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-documentai/samples/generated/v1beta3/document_service.import_documents.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.import_documents.js deleted file mode 100644 index 12876659f21..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.import_documents.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(dataset, batchDocumentsImportConfigs) { - // [START documentai_v1beta3_generated_DocumentService_ImportDocuments_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 dataset resource name. - * Format: - * projects/{project}/locations/{location}/processors/{processor}/dataset - */ - // const dataset = 'abc123' - /** - * Required. The Cloud Storage uri containing raw documents that must be - * imported. - */ - // const batchDocumentsImportConfigs = [1,2,3,4] - - // Imports the Documentai library - const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentServiceClient(); - - async function callImportDocuments() { - // Construct request - const request = { - dataset, - batchDocumentsImportConfigs, - }; - - // Run request - const [operation] = await documentaiClient.importDocuments(request); - const [response] = await operation.promise(); - console.log(response); - } - - callImportDocuments(); - // [END documentai_v1beta3_generated_DocumentService_ImportDocuments_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-documentai/samples/generated/v1beta3/document_service.list_documents.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.list_documents.js deleted file mode 100644 index 1f3da765e59..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.list_documents.js +++ /dev/null @@ -1,117 +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(dataset) { - // [START documentai_v1beta3_generated_DocumentService_ListDocuments_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 of the dataset to be listed. - * Format: - * projects/{project}/locations/{location}/processors/{processor}/dataset - */ - // const dataset = 'abc123' - /** - * The maximum number of documents to return. The service may return - * fewer than this value. - * If unspecified, at most 20 documents will be returned. - * The maximum value is 100; values above 100 will be coerced to 100. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListDocuments` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListDocuments` - * must match the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * Optional. Query to filter the documents based on - * https://google.aip.dev/160. - * ## Currently support query strings are: - * `SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED` - * - `LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED` - * - `DisplayName=\"file_name.pdf\"` - * - `EntityType=abc/def` - * - `TagName=\"auto-labeling-running\"|\"sampled\"` - * Note: - * - Only `AND`, `=` and `!=` are supported. - * e.g. `DisplayName=file_name AND EntityType!=abc` IS supported. - * - Wildcard `*` is supported only in `DisplayName` filter - * - No duplicate filter keys are allowed, - * e.g. `EntityType=a AND EntityType=b` is NOT supported. - * - String match is case sensitive (for filter `DisplayName` & `EntityType`). - */ - // const filter = 'abc123' - /** - * Optional. Controls if the request requires a total size of matched - * documents. See - * ListDocumentsResponse.total_size google.cloud.documentai.v1beta3.ListDocumentsResponse.total_size. - * Enabling this flag may adversely impact performance. - * Defaults to false. - */ - // const returnTotalSize = true - /** - * Optional. Number of results to skip beginning from the `page_token` if - * provided. https://google.aip.dev/158#skipping-results. It must be a - * non-negative integer. Negative values will be rejected. Note that this is - * not the number of pages to skip. If this value causes the cursor to move - * past the end of results, - * ListDocumentsResponse.document_metadata google.cloud.documentai.v1beta3.ListDocumentsResponse.document_metadata - * and - * ListDocumentsResponse.next_page_token google.cloud.documentai.v1beta3.ListDocumentsResponse.next_page_token - * will be empty. - */ - // const skip = 1234 - - // Imports the Documentai library - const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentServiceClient(); - - async function callListDocuments() { - // Construct request - const request = { - dataset, - }; - - // Run request - const iterable = documentaiClient.listDocumentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDocuments(); - // [END documentai_v1beta3_generated_DocumentService_ListDocuments_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-documentai/samples/generated/v1beta3/document_service.update_dataset.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.js deleted file mode 100644 index a6fc0aaccca..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset.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(dataset) { - // [START documentai_v1beta3_generated_DocumentService_UpdateDataset_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` field of the `Dataset` is used to identify the - * resource to be updated. - */ - // const dataset = {} - /** - * The update mask applies to the resource. - */ - // const updateMask = {} - - // Imports the Documentai library - const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentServiceClient(); - - async function callUpdateDataset() { - // Construct request - const request = { - dataset, - }; - - // Run request - const [operation] = await documentaiClient.updateDataset(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateDataset(); - // [END documentai_v1beta3_generated_DocumentService_UpdateDataset_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-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_schema.js deleted file mode 100644 index 29209b24024..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/document_service.update_dataset_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(datasetSchema) { - // [START documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_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 field of the `DatasetSchema` is used to identify the - * resource to be updated. - */ - // const datasetSchema = {} - /** - * The update mask applies to the resource. - */ - // const updateMask = {} - - // Imports the Documentai library - const {DocumentServiceClient} = require('@google-cloud/documentai').v1beta3; - - // Instantiates a client - const documentaiClient = new DocumentServiceClient(); - - async function callUpdateDatasetSchema() { - // Construct request - const request = { - datasetSchema, - }; - - // Run request - const response = await documentaiClient.updateDatasetSchema(request); - console.log(response); - } - - callUpdateDatasetSchema(); - // [END documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_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-documentai/samples/generated/v1beta3/snippet_metadata_google.cloud.documentai.v1beta3.json b/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata_google.cloud.documentai.v1beta3.json deleted file mode 100644 index 89d95bd05b0..00000000000 --- a/owl-bot-staging/google-cloud-documentai/samples/generated/v1beta3/snippet_metadata_google.cloud.documentai.v1beta3.json +++ /dev/null @@ -1,1427 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-documentai", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.documentai.v1beta3", - "version": "v1beta3" - } - ] - }, - "snippets": [ - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_async", - "title": "DocumentProcessorService processDocument Sample", - "origin": "API_DEFINITION", - "description": " Processes a single document.", - "canonical": true, - "file": "document_processor_service.process_document.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 109, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ProcessDocument", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument", - "async": true, - "parameters": [ - { - "name": "inline_document", - "type": ".google.cloud.documentai.v1beta3.Document" - }, - { - "name": "raw_document", - "type": ".google.cloud.documentai.v1beta3.RawDocument" - }, - { - "name": "gcs_document", - "type": ".google.cloud.documentai.v1beta3.GcsDocument" - }, - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "document", - "type": ".google.cloud.documentai.v1beta3.Document" - }, - { - "name": "skip_human_review", - "type": "TYPE_BOOL" - }, - { - "name": "field_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "process_options", - "type": ".google.cloud.documentai.v1beta3.ProcessOptions" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "imageless_mode", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.ProcessResponse", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ProcessDocument", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_async", - "title": "DocumentProcessorService batchProcessDocuments Sample", - "origin": "API_DEFINITION", - "description": " LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.", - "canonical": true, - "file": "document_processor_service.batch_process_documents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 96, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchProcessDocuments", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "input_configs", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "output_config", - "type": ".google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig" - }, - { - "name": "input_documents", - "type": ".google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" - }, - { - "name": "document_output_config", - "type": ".google.cloud.documentai.v1beta3.DocumentOutputConfig" - }, - { - "name": "skip_human_review", - "type": "TYPE_BOOL" - }, - { - "name": "process_options", - "type": ".google.cloud.documentai.v1beta3.ProcessOptions" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "BatchProcessDocuments", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_async", - "title": "DocumentProcessorService fetchProcessorTypes Sample", - "origin": "API_DEFINITION", - "description": " Fetches processor types. Note that we don't use [ListProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes] here, because it isn't paginated.", - "canonical": true, - "file": "document_processor_service.fetch_processor_types.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchProcessorTypes", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.FetchProcessorTypesResponse", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "FetchProcessorTypes", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_async", - "title": "DocumentProcessorService listProcessorTypes Sample", - "origin": "API_DEFINITION", - "description": " Lists the processor types that exist.", - "canonical": true, - "file": "document_processor_service.list_processor_types.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListProcessorTypes", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.ListProcessorTypesResponse", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ListProcessorTypes", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_async", - "title": "DocumentProcessorService getProcessorType Sample", - "origin": "API_DEFINITION", - "description": " Gets a processor type detail.", - "canonical": true, - "file": "document_processor_service.get_processor_type.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetProcessorType", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorType", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.ProcessorType", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "GetProcessorType", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorType", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_async", - "title": "DocumentProcessorService listProcessors Sample", - "origin": "API_DEFINITION", - "description": " Lists all processors which belong to this project.", - "canonical": true, - "file": "document_processor_service.list_processors.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListProcessors", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessors", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.ListProcessorsResponse", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ListProcessors", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessors", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_async", - "title": "DocumentProcessorService getProcessor Sample", - "origin": "API_DEFINITION", - "description": " Gets a processor detail.", - "canonical": true, - "file": "document_processor_service.get_processor.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetProcessor", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessor", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.Processor", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "GetProcessor", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessor", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_async", - "title": "DocumentProcessorService trainProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Trains a new processor version. Operation metadata is returned as [TrainProcessorVersionMetadata][google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata].", - "canonical": true, - "file": "document_processor_service.train_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TrainProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion", - "async": true, - "parameters": [ - { - "name": "custom_document_extraction_options", - "type": ".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions" - }, - { - "name": "foundation_model_tuning_options", - "type": ".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions" - }, - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "processor_version", - "type": ".google.cloud.documentai.v1beta3.ProcessorVersion" - }, - { - "name": "document_schema", - "type": ".google.cloud.documentai.v1beta3.DocumentSchema" - }, - { - "name": "input_data", - "type": ".google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData" - }, - { - "name": "base_processor_version", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "TrainProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_async", - "title": "DocumentProcessorService getProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Gets a processor version detail.", - "canonical": true, - "file": "document_processor_service.get_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.ProcessorVersion", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "GetProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_async", - "title": "DocumentProcessorService listProcessorVersions Sample", - "origin": "API_DEFINITION", - "description": " Lists all versions of a processor.", - "canonical": true, - "file": "document_processor_service.list_processor_versions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListProcessorVersions", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.ListProcessorVersionsResponse", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ListProcessorVersions", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersions", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_async", - "title": "DocumentProcessorService deleteProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Deletes the processor version, all artifacts under the processor version will be deleted.", - "canonical": true, - "file": "document_processor_service.delete_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "DeleteProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_async", - "title": "DocumentProcessorService deployProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Deploys the processor version.", - "canonical": true, - "file": "document_processor_service.deploy_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeployProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "DeployProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_async", - "title": "DocumentProcessorService undeployProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Undeploys the processor version.", - "canonical": true, - "file": "document_processor_service.undeploy_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UndeployProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "UndeployProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_async", - "title": "DocumentProcessorService createProcessor Sample", - "origin": "API_DEFINITION", - "description": " Creates a processor from the [ProcessorType][google.cloud.documentai.v1beta3.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.", - "canonical": true, - "file": "document_processor_service.create_processor.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateProcessor", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessor", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "processor", - "type": ".google.cloud.documentai.v1beta3.Processor" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.Processor", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "CreateProcessor", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessor", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_async", - "title": "DocumentProcessorService deleteProcessor Sample", - "origin": "API_DEFINITION", - "description": " Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.", - "canonical": true, - "file": "document_processor_service.delete_processor.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteProcessor", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "DeleteProcessor", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_async", - "title": "DocumentProcessorService enableProcessor Sample", - "origin": "API_DEFINITION", - "description": " Enables a processor", - "canonical": true, - "file": "document_processor_service.enable_processor.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "EnableProcessor", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "EnableProcessor", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_async", - "title": "DocumentProcessorService disableProcessor Sample", - "origin": "API_DEFINITION", - "description": " Disables a processor", - "canonical": true, - "file": "document_processor_service.disable_processor.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DisableProcessor", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "DisableProcessor", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_async", - "title": "DocumentProcessorService setDefaultProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Set the default (active) version of a [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] and [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].", - "canonical": true, - "file": "document_processor_service.set_default_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetDefaultProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion", - "async": true, - "parameters": [ - { - "name": "processor", - "type": "TYPE_STRING" - }, - { - "name": "default_processor_version", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "SetDefaultProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_async", - "title": "DocumentProcessorService reviewDocument Sample", - "origin": "API_DEFINITION", - "description": " Send a document for Human Review. The input document should be processed by the specified processor.", - "canonical": true, - "file": "document_processor_service.review_document.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ReviewDocument", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument", - "async": true, - "parameters": [ - { - "name": "inline_document", - "type": ".google.cloud.documentai.v1beta3.Document" - }, - { - "name": "human_review_config", - "type": "TYPE_STRING" - }, - { - "name": "document", - "type": ".google.cloud.documentai.v1beta3.Document" - }, - { - "name": "enable_schema_validation", - "type": "TYPE_BOOL" - }, - { - "name": "priority", - "type": ".google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority" - }, - { - "name": "document_schema", - "type": ".google.cloud.documentai.v1beta3.DocumentSchema" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ReviewDocument", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_async", - "title": "DocumentProcessorService evaluateProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Evaluates a ProcessorVersion against annotated documents, producing an Evaluation.", - "canonical": true, - "file": "document_processor_service.evaluate_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "EvaluateProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion", - "async": true, - "parameters": [ - { - "name": "processor_version", - "type": "TYPE_STRING" - }, - { - "name": "evaluation_documents", - "type": ".google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "EvaluateProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_async", - "title": "DocumentProcessorService getEvaluation Sample", - "origin": "API_DEFINITION", - "description": " Retrieves a specific evaluation.", - "canonical": true, - "file": "document_processor_service.get_evaluation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetEvaluation", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.Evaluation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "GetEvaluation", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluation", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_async", - "title": "DocumentProcessorService listEvaluations Sample", - "origin": "API_DEFINITION", - "description": " Retrieves a set of evaluations for a given processor version.", - "canonical": true, - "file": "document_processor_service.list_evaluations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListEvaluations", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluations", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.ListEvaluationsResponse", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ListEvaluations", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluations", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_async", - "title": "DocumentProcessorService importProcessorVersion Sample", - "origin": "API_DEFINITION", - "description": " Imports a processor version from source processor version.", - "canonical": true, - "file": "document_processor_service.import_processor_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ImportProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion", - "async": true, - "parameters": [ - { - "name": "processor_version_source", - "type": "TYPE_STRING" - }, - { - "name": "external_processor_version_source", - "type": ".google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource" - }, - { - "name": "parent", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentProcessorServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorServiceClient" - }, - "method": { - "shortName": "ImportProcessorVersion", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion", - "service": { - "shortName": "DocumentProcessorService", - "fullName": "google.cloud.documentai.v1beta3.DocumentProcessorService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentService_UpdateDataset_async", - "title": "DocumentProcessorService updateDataset Sample", - "origin": "API_DEFINITION", - "description": " Updates metadata associated with a dataset. Note that this method requires the `documentai.googleapis.com/datasets.update` 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.", - "canonical": true, - "file": "document_service.update_dataset.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDataset", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.UpdateDataset", - "async": true, - "parameters": [ - { - "name": "dataset", - "type": ".google.cloud.documentai.v1beta3.Dataset" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" - }, - "method": { - "shortName": "UpdateDataset", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.UpdateDataset", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.documentai.v1beta3.DocumentService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentService_ImportDocuments_async", - "title": "DocumentProcessorService importDocuments Sample", - "origin": "API_DEFINITION", - "description": " Import documents into a dataset.", - "canonical": true, - "file": "document_service.import_documents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ImportDocuments", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.ImportDocuments", - "async": true, - "parameters": [ - { - "name": "dataset", - "type": "TYPE_STRING" - }, - { - "name": "batch_documents_import_configs", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" - }, - "method": { - "shortName": "ImportDocuments", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.ImportDocuments", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.documentai.v1beta3.DocumentService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentService_GetDocument_async", - "title": "DocumentProcessorService getDocument Sample", - "origin": "API_DEFINITION", - "description": " Returns relevant fields present in the requested document.", - "canonical": true, - "file": "document_service.get_document.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 70, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDocument", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.GetDocument", - "async": true, - "parameters": [ - { - "name": "dataset", - "type": "TYPE_STRING" - }, - { - "name": "document_id", - "type": ".google.cloud.documentai.v1beta3.DocumentId" - }, - { - "name": "read_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "page_range", - "type": ".google.cloud.documentai.v1beta3.DocumentPageRange" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.GetDocumentResponse", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" - }, - "method": { - "shortName": "GetDocument", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.GetDocument", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.documentai.v1beta3.DocumentService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentService_ListDocuments_async", - "title": "DocumentProcessorService listDocuments Sample", - "origin": "API_DEFINITION", - "description": " Returns a list of documents present in the dataset.", - "canonical": true, - "file": "document_service.list_documents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 109, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDocuments", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.ListDocuments", - "async": true, - "parameters": [ - { - "name": "dataset", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "return_total_size", - "type": "TYPE_BOOL" - }, - { - "name": "skip", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.ListDocumentsResponse", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" - }, - "method": { - "shortName": "ListDocuments", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.ListDocuments", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.documentai.v1beta3.DocumentService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_async", - "title": "DocumentProcessorService batchDeleteDocuments Sample", - "origin": "API_DEFINITION", - "description": " Deletes a set of documents.", - "canonical": true, - "file": "document_service.batch_delete_documents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BatchDeleteDocuments", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.BatchDeleteDocuments", - "async": true, - "parameters": [ - { - "name": "dataset", - "type": "TYPE_STRING" - }, - { - "name": "dataset_documents", - "type": ".google.cloud.documentai.v1beta3.BatchDatasetDocuments" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" - }, - "method": { - "shortName": "BatchDeleteDocuments", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.BatchDeleteDocuments", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.documentai.v1beta3.DocumentService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentService_GetDatasetSchema_async", - "title": "DocumentProcessorService getDatasetSchema Sample", - "origin": "API_DEFINITION", - "description": " Gets the `DatasetSchema` of a `Dataset`.", - "canonical": true, - "file": "document_service.get_dataset_schema.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDatasetSchema", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.GetDatasetSchema", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "visible_fields_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.DatasetSchema", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" - }, - "method": { - "shortName": "GetDatasetSchema", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.GetDatasetSchema", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.documentai.v1beta3.DocumentService" - } - } - } - }, - { - "regionTag": "documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_async", - "title": "DocumentProcessorService updateDatasetSchema Sample", - "origin": "API_DEFINITION", - "description": " Updates a `DatasetSchema`.", - "canonical": true, - "file": "document_service.update_dataset_schema.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDatasetSchema", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetSchema", - "async": true, - "parameters": [ - { - "name": "dataset_schema", - "type": ".google.cloud.documentai.v1beta3.DatasetSchema" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.documentai.v1beta3.DatasetSchema", - "client": { - "shortName": "DocumentServiceClient", - "fullName": "google.cloud.documentai.v1beta3.DocumentServiceClient" - }, - "method": { - "shortName": "UpdateDatasetSchema", - "fullName": "google.cloud.documentai.v1beta3.DocumentService.UpdateDatasetSchema", - "service": { - "shortName": "DocumentService", - "fullName": "google.cloud.documentai.v1beta3.DocumentService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-documentai/src/index.ts b/owl-bot-staging/google-cloud-documentai/src/index.ts deleted file mode 100644 index 07b6a79e6c1..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/index.ts +++ /dev/null @@ -1,28 +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'; -import * as v1beta3 from './v1beta3'; - -const DocumentProcessorServiceClient = v1.DocumentProcessorServiceClient; -type DocumentProcessorServiceClient = v1.DocumentProcessorServiceClient; - -export {v1, v1beta3, DocumentProcessorServiceClient}; -export default {v1, v1beta3, DocumentProcessorServiceClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client.ts b/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client.ts deleted file mode 100644 index 192ecf79e44..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client.ts +++ /dev/null @@ -1,3934 +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, PaginationCallback, GaxCall, LocationsClient, LocationProtos} 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_processor_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './document_processor_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * 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. - * @class - * @memberof v1 - */ -export class DocumentProcessorServiceClient { - 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('documentai'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - documentProcessorServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DocumentProcessorServiceClient. - * - * @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 DocumentProcessorServiceClient({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 DocumentProcessorServiceClient; - 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 = 'documentai.' + 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; - } - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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 = { - evaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}' - ), - humanReviewConfigPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - processorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}' - ), - processorTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processorTypes/{processor_type}' - ), - processorVersionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - }; - - // 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 = { - listProcessorTypes: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'processorTypes'), - listProcessors: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'processors'), - listProcessorVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'processorVersions'), - listEvaluations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'evaluations') - }; - - 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.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',additional_bindings: [{get: '/uiv1beta3/{name=projects/*}/locations',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/uiv1beta3/{name=projects/*/locations/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/uiv1beta3/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*/operations}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*/operations}',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const batchProcessDocumentsResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.BatchProcessResponse') as gax.protobuf.Type; - const batchProcessDocumentsMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.BatchProcessMetadata') as gax.protobuf.Type; - const trainProcessorVersionResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.TrainProcessorVersionResponse') as gax.protobuf.Type; - const trainProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.TrainProcessorVersionMetadata') as gax.protobuf.Type; - const deleteProcessorVersionResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.DeleteProcessorVersionMetadata') as gax.protobuf.Type; - const deployProcessorVersionResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.DeployProcessorVersionResponse') as gax.protobuf.Type; - const deployProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.DeployProcessorVersionMetadata') as gax.protobuf.Type; - const undeployProcessorVersionResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.UndeployProcessorVersionResponse') as gax.protobuf.Type; - const undeployProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.UndeployProcessorVersionMetadata') as gax.protobuf.Type; - const deleteProcessorResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteProcessorMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.DeleteProcessorMetadata') as gax.protobuf.Type; - const enableProcessorResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.EnableProcessorResponse') as gax.protobuf.Type; - const enableProcessorMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.EnableProcessorMetadata') as gax.protobuf.Type; - const disableProcessorResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.DisableProcessorResponse') as gax.protobuf.Type; - const disableProcessorMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.DisableProcessorMetadata') as gax.protobuf.Type; - const setDefaultProcessorVersionResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.SetDefaultProcessorVersionResponse') as gax.protobuf.Type; - const setDefaultProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata') as gax.protobuf.Type; - const reviewDocumentResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.ReviewDocumentResponse') as gax.protobuf.Type; - const reviewDocumentMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.ReviewDocumentOperationMetadata') as gax.protobuf.Type; - const evaluateProcessorVersionResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.EvaluateProcessorVersionResponse') as gax.protobuf.Type; - const evaluateProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1.EvaluateProcessorVersionMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - batchProcessDocuments: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchProcessDocumentsResponse.decode.bind(batchProcessDocumentsResponse), - batchProcessDocumentsMetadata.decode.bind(batchProcessDocumentsMetadata)), - trainProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - trainProcessorVersionResponse.decode.bind(trainProcessorVersionResponse), - trainProcessorVersionMetadata.decode.bind(trainProcessorVersionMetadata)), - deleteProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteProcessorVersionResponse.decode.bind(deleteProcessorVersionResponse), - deleteProcessorVersionMetadata.decode.bind(deleteProcessorVersionMetadata)), - deployProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deployProcessorVersionResponse.decode.bind(deployProcessorVersionResponse), - deployProcessorVersionMetadata.decode.bind(deployProcessorVersionMetadata)), - undeployProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - undeployProcessorVersionResponse.decode.bind(undeployProcessorVersionResponse), - undeployProcessorVersionMetadata.decode.bind(undeployProcessorVersionMetadata)), - deleteProcessor: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteProcessorResponse.decode.bind(deleteProcessorResponse), - deleteProcessorMetadata.decode.bind(deleteProcessorMetadata)), - enableProcessor: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - enableProcessorResponse.decode.bind(enableProcessorResponse), - enableProcessorMetadata.decode.bind(enableProcessorMetadata)), - disableProcessor: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - disableProcessorResponse.decode.bind(disableProcessorResponse), - disableProcessorMetadata.decode.bind(disableProcessorMetadata)), - setDefaultProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - setDefaultProcessorVersionResponse.decode.bind(setDefaultProcessorVersionResponse), - setDefaultProcessorVersionMetadata.decode.bind(setDefaultProcessorVersionMetadata)), - reviewDocument: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - reviewDocumentResponse.decode.bind(reviewDocumentResponse), - reviewDocumentMetadata.decode.bind(reviewDocumentMetadata)), - evaluateProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - evaluateProcessorVersionResponse.decode.bind(evaluateProcessorVersionResponse), - evaluateProcessorVersionMetadata.decode.bind(evaluateProcessorVersionMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.documentai.v1.DocumentProcessorService', 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.documentProcessorServiceStub) { - return this.documentProcessorServiceStub; - } - - // Put together the "service stub" for - // google.cloud.documentai.v1.DocumentProcessorService. - this.documentProcessorServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.documentai.v1.DocumentProcessorService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.documentai.v1.DocumentProcessorService, - 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 documentProcessorServiceStubMethods = - ['processDocument', 'batchProcessDocuments', 'fetchProcessorTypes', 'listProcessorTypes', 'getProcessorType', 'listProcessors', 'getProcessor', 'trainProcessorVersion', 'getProcessorVersion', 'listProcessorVersions', 'deleteProcessorVersion', 'deployProcessorVersion', 'undeployProcessorVersion', 'createProcessor', 'deleteProcessor', 'enableProcessor', 'disableProcessor', 'setDefaultProcessorVersion', 'reviewDocument', 'evaluateProcessorVersion', 'getEvaluation', 'listEvaluations']; - for (const methodName of documentProcessorServiceStubMethods) { - const callPromise = this.documentProcessorServiceStub.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] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.documentProcessorServiceStub; - } - - /** - * 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 'documentai.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 'documentai.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 -- - // ------------------- -/** - * Processes a single document. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.documentai.v1.Document} request.inlineDocument - * An inline document proto. - * @param {google.cloud.documentai.v1.RawDocument} request.rawDocument - * A raw document content (bytes). - * @param {google.cloud.documentai.v1.GcsDocument} request.gcsDocument - * A raw document on Google Cloud Storage. - * @param {string} request.name - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1.Processor|Processor} or - * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} - * to use for processing. If a - * {@link protos.google.cloud.documentai.v1.Processor|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}` - * @param {boolean} request.skipHumanReview - * Whether human review should be skipped for this request. Default to - * `false`. - * @param {google.protobuf.FieldMask} request.fieldMask - * Specifies which fields to include in the - * {@link protos.google.cloud.documentai.v1.ProcessResponse.document|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}`. - * @param {google.cloud.documentai.v1.ProcessOptions} request.processOptions - * Inference-time options for the process API - * @param {number[]} [request.labels] - * 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. - * @param {boolean} [request.imagelessMode] - * Optional. Option to remove images from 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.documentai.v1.ProcessResponse|ProcessResponse}. - * 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_processor_service.process_document.js - * region_tag:documentai_v1_generated_DocumentProcessorService_ProcessDocument_async - */ - processDocument( - request?: protos.google.cloud.documentai.v1.IProcessRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1.IProcessResponse, - protos.google.cloud.documentai.v1.IProcessRequest|undefined, {}|undefined - ]>; - processDocument( - request: protos.google.cloud.documentai.v1.IProcessRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1.IProcessResponse, - protos.google.cloud.documentai.v1.IProcessRequest|null|undefined, - {}|null|undefined>): void; - processDocument( - request: protos.google.cloud.documentai.v1.IProcessRequest, - callback: Callback< - protos.google.cloud.documentai.v1.IProcessResponse, - protos.google.cloud.documentai.v1.IProcessRequest|null|undefined, - {}|null|undefined>): void; - processDocument( - request?: protos.google.cloud.documentai.v1.IProcessRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1.IProcessResponse, - protos.google.cloud.documentai.v1.IProcessRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1.IProcessResponse, - protos.google.cloud.documentai.v1.IProcessRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1.IProcessResponse, - protos.google.cloud.documentai.v1.IProcessRequest|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('processDocument request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1.IProcessResponse, - protos.google.cloud.documentai.v1.IProcessRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('processDocument response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.processDocument(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1.IProcessResponse, - protos.google.cloud.documentai.v1.IProcessRequest|undefined, - {}|undefined - ]) => { - this._log.info('processDocument 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; - }); - } -/** - * Fetches processor types. Note that we don't use - * {@link protos.google.cloud.documentai.v1.DocumentProcessorService.ListProcessorTypes|ListProcessorTypes} - * here, because it isn't paginated. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * @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.documentai.v1.FetchProcessorTypesResponse|FetchProcessorTypesResponse}. - * 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_processor_service.fetch_processor_types.js - * region_tag:documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_async - */ - fetchProcessorTypes( - request?: protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|undefined, {}|undefined - ]>; - fetchProcessorTypes( - request: protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|null|undefined, - {}|null|undefined>): void; - fetchProcessorTypes( - request: protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest, - callback: Callback< - protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|null|undefined, - {}|null|undefined>): void; - fetchProcessorTypes( - request?: protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|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('fetchProcessorTypes request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('fetchProcessorTypes response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.fetchProcessorTypes(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1.IFetchProcessorTypesRequest|undefined, - {}|undefined - ]) => { - this._log.info('fetchProcessorTypes 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 processor type detail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor type resource name. - * @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.documentai.v1.ProcessorType|ProcessorType}. - * 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_processor_service.get_processor_type.js - * region_tag:documentai_v1_generated_DocumentProcessorService_GetProcessorType_async - */ - getProcessorType( - request?: protos.google.cloud.documentai.v1.IGetProcessorTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1.IProcessorType, - protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|undefined, {}|undefined - ]>; - getProcessorType( - request: protos.google.cloud.documentai.v1.IGetProcessorTypeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1.IProcessorType, - protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|null|undefined, - {}|null|undefined>): void; - getProcessorType( - request: protos.google.cloud.documentai.v1.IGetProcessorTypeRequest, - callback: Callback< - protos.google.cloud.documentai.v1.IProcessorType, - protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|null|undefined, - {}|null|undefined>): void; - getProcessorType( - request?: protos.google.cloud.documentai.v1.IGetProcessorTypeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1.IProcessorType, - protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1.IProcessorType, - protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1.IProcessorType, - protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|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('getProcessorType request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1.IProcessorType, - protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getProcessorType response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getProcessorType(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1.IProcessorType, - protos.google.cloud.documentai.v1.IGetProcessorTypeRequest|undefined, - {}|undefined - ]) => { - this._log.info('getProcessorType 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 processor detail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor resource name. - * @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.documentai.v1.Processor|Processor}. - * 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_processor_service.get_processor.js - * region_tag:documentai_v1_generated_DocumentProcessorService_GetProcessor_async - */ - getProcessor( - request?: protos.google.cloud.documentai.v1.IGetProcessorRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.IGetProcessorRequest|undefined, {}|undefined - ]>; - getProcessor( - request: protos.google.cloud.documentai.v1.IGetProcessorRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.IGetProcessorRequest|null|undefined, - {}|null|undefined>): void; - getProcessor( - request: protos.google.cloud.documentai.v1.IGetProcessorRequest, - callback: Callback< - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.IGetProcessorRequest|null|undefined, - {}|null|undefined>): void; - getProcessor( - request?: protos.google.cloud.documentai.v1.IGetProcessorRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.IGetProcessorRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.IGetProcessorRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.IGetProcessorRequest|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('getProcessor request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.IGetProcessorRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getProcessor response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getProcessor(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.IGetProcessorRequest|undefined, - {}|undefined - ]) => { - this._log.info('getProcessor 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 processor version detail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor resource name. - * @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.documentai.v1.ProcessorVersion|ProcessorVersion}. - * 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_processor_service.get_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_async - */ - getProcessorVersion( - request?: protos.google.cloud.documentai.v1.IGetProcessorVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1.IProcessorVersion, - protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|undefined, {}|undefined - ]>; - getProcessorVersion( - request: protos.google.cloud.documentai.v1.IGetProcessorVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1.IProcessorVersion, - protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|null|undefined, - {}|null|undefined>): void; - getProcessorVersion( - request: protos.google.cloud.documentai.v1.IGetProcessorVersionRequest, - callback: Callback< - protos.google.cloud.documentai.v1.IProcessorVersion, - protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|null|undefined, - {}|null|undefined>): void; - getProcessorVersion( - request?: protos.google.cloud.documentai.v1.IGetProcessorVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1.IProcessorVersion, - protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1.IProcessorVersion, - protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1.IProcessorVersion, - protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|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('getProcessorVersion request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1.IProcessorVersion, - protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getProcessorVersion response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getProcessorVersion(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1.IProcessorVersion, - protos.google.cloud.documentai.v1.IGetProcessorVersionRequest|undefined, - {}|undefined - ]) => { - this._log.info('getProcessorVersion 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; - }); - } -/** - * Creates a processor from the - * {@link protos.google.cloud.documentai.v1.ProcessorType|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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent (project and location) under which to create the - * processor. Format: `projects/{project}/locations/{location}` - * @param {google.cloud.documentai.v1.Processor} request.processor - * Required. The processor to be created, requires - * {@link protos.google.cloud.documentai.v1.Processor.type|Processor.type} and - * {@link protos.google.cloud.documentai.v1.Processor.display_name|Processor.display_name} - * to be set. Also, the - * {@link protos.google.cloud.documentai.v1.Processor.kms_key_name|Processor.kms_key_name} - * field must be set if the processor is under CMEK. - * @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.documentai.v1.Processor|Processor}. - * 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_processor_service.create_processor.js - * region_tag:documentai_v1_generated_DocumentProcessorService_CreateProcessor_async - */ - createProcessor( - request?: protos.google.cloud.documentai.v1.ICreateProcessorRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.ICreateProcessorRequest|undefined, {}|undefined - ]>; - createProcessor( - request: protos.google.cloud.documentai.v1.ICreateProcessorRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.ICreateProcessorRequest|null|undefined, - {}|null|undefined>): void; - createProcessor( - request: protos.google.cloud.documentai.v1.ICreateProcessorRequest, - callback: Callback< - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.ICreateProcessorRequest|null|undefined, - {}|null|undefined>): void; - createProcessor( - request?: protos.google.cloud.documentai.v1.ICreateProcessorRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.ICreateProcessorRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.ICreateProcessorRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.ICreateProcessorRequest|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('createProcessor request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.ICreateProcessorRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createProcessor response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createProcessor(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1.IProcessor, - protos.google.cloud.documentai.v1.ICreateProcessorRequest|undefined, - {}|undefined - ]) => { - this._log.info('createProcessor 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; - }); - } -/** - * Retrieves a specific evaluation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1.Evaluation|Evaluation} to get. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - * @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.documentai.v1.Evaluation|Evaluation}. - * 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_processor_service.get_evaluation.js - * region_tag:documentai_v1_generated_DocumentProcessorService_GetEvaluation_async - */ - getEvaluation( - request?: protos.google.cloud.documentai.v1.IGetEvaluationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1.IEvaluation, - protos.google.cloud.documentai.v1.IGetEvaluationRequest|undefined, {}|undefined - ]>; - getEvaluation( - request: protos.google.cloud.documentai.v1.IGetEvaluationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1.IEvaluation, - protos.google.cloud.documentai.v1.IGetEvaluationRequest|null|undefined, - {}|null|undefined>): void; - getEvaluation( - request: protos.google.cloud.documentai.v1.IGetEvaluationRequest, - callback: Callback< - protos.google.cloud.documentai.v1.IEvaluation, - protos.google.cloud.documentai.v1.IGetEvaluationRequest|null|undefined, - {}|null|undefined>): void; - getEvaluation( - request?: protos.google.cloud.documentai.v1.IGetEvaluationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1.IEvaluation, - protos.google.cloud.documentai.v1.IGetEvaluationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1.IEvaluation, - protos.google.cloud.documentai.v1.IGetEvaluationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1.IEvaluation, - protos.google.cloud.documentai.v1.IGetEvaluationRequest|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('getEvaluation request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1.IEvaluation, - protos.google.cloud.documentai.v1.IGetEvaluationRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getEvaluation response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getEvaluation(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1.IEvaluation, - protos.google.cloud.documentai.v1.IGetEvaluationRequest|undefined, - {}|undefined - ]) => { - this._log.info('getEvaluation 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; - }); - } - -/** - * LRO endpoint to batch process many documents. The output is written - * to Cloud Storage as JSON in the [Document] format. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of - * {@link protos.google.cloud.documentai.v1.Processor|Processor} or - * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion}. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param {google.cloud.documentai.v1.BatchDocumentsInputConfig} request.inputDocuments - * The input documents for the - * {@link protos.google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments} - * method. - * @param {google.cloud.documentai.v1.DocumentOutputConfig} request.documentOutputConfig - * The output configuration for the - * {@link protos.google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments} - * method. - * @param {boolean} request.skipHumanReview - * Whether human review should be skipped for this request. Default to - * `false`. - * @param {google.cloud.documentai.v1.ProcessOptions} request.processOptions - * Inference-time options for the process API - * @param {number[]} [request.labels] - * 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. - * @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/document_processor_service.batch_process_documents.js - * region_tag:documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_async - */ - batchProcessDocuments( - request?: protos.google.cloud.documentai.v1.IBatchProcessRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchProcessDocuments( - request: protos.google.cloud.documentai.v1.IBatchProcessRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchProcessDocuments( - request: protos.google.cloud.documentai.v1.IBatchProcessRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchProcessDocuments( - request?: protos.google.cloud.documentai.v1.IBatchProcessRequest, - 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('batchProcessDocuments response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('batchProcessDocuments request %j', request); - return this.innerApiCalls.batchProcessDocuments(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('batchProcessDocuments response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `batchProcessDocuments()`. - * @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/document_processor_service.batch_process_documents.js - * region_tag:documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_async - */ - async checkBatchProcessDocumentsProgress(name: string): Promise>{ - this._log.info('batchProcessDocuments 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.batchProcessDocuments, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Trains a new processor version. - * Operation metadata is returned as - * {@link protos.google.cloud.documentai.v1.TrainProcessorVersionMetadata|TrainProcessorVersionMetadata}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} request.customDocumentExtractionOptions - * Options to control Custom Document Extraction (CDE) Processor. - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.FoundationModelTuningOptions} request.foundationModelTuningOptions - * Options to control foundation model tuning of a processor. - * @param {string} request.parent - * Required. The parent (project, location and processor) to create the new - * version for. Format: - * `projects/{project}/locations/{location}/processors/{processor}`. - * @param {google.cloud.documentai.v1.ProcessorVersion} request.processorVersion - * Required. The processor version to be created. - * @param {google.cloud.documentai.v1.DocumentSchema} [request.documentSchema] - * Optional. The schema the processor version will be trained with. - * @param {google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData} [request.inputData] - * Optional. The input data used to train the - * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion}. - * @param {string} [request.baseProcessorVersion] - * 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}`. - * @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/document_processor_service.train_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_async - */ - trainProcessorVersion( - request?: protos.google.cloud.documentai.v1.ITrainProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - trainProcessorVersion( - request: protos.google.cloud.documentai.v1.ITrainProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - trainProcessorVersion( - request: protos.google.cloud.documentai.v1.ITrainProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - trainProcessorVersion( - request?: protos.google.cloud.documentai.v1.ITrainProcessorVersionRequest, - 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({ - 'parent': request.parent ?? '', - }); - 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('trainProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('trainProcessorVersion request %j', request); - return this.innerApiCalls.trainProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('trainProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `trainProcessorVersion()`. - * @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/document_processor_service.train_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_TrainProcessorVersion_async - */ - async checkTrainProcessorVersionProgress(name: string): Promise>{ - this._log.info('trainProcessorVersion 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.trainProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes the processor version, all artifacts under the processor version - * will be deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor version resource name to be deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * 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/document_processor_service.delete_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_async - */ - deleteProcessorVersion( - request?: protos.google.cloud.documentai.v1.IDeleteProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteProcessorVersion( - request: protos.google.cloud.documentai.v1.IDeleteProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteProcessorVersion( - request: protos.google.cloud.documentai.v1.IDeleteProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteProcessorVersion( - request?: protos.google.cloud.documentai.v1.IDeleteProcessorVersionRequest, - 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('deleteProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteProcessorVersion request %j', request); - return this.innerApiCalls.deleteProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteProcessorVersion()`. - * @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/document_processor_service.delete_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_async - */ - async checkDeleteProcessorVersionProgress(name: string): Promise>{ - this._log.info('deleteProcessorVersion 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.deleteProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deploys the processor version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor version resource name to be deployed. - * @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/document_processor_service.deploy_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_async - */ - deployProcessorVersion( - request?: protos.google.cloud.documentai.v1.IDeployProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deployProcessorVersion( - request: protos.google.cloud.documentai.v1.IDeployProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployProcessorVersion( - request: protos.google.cloud.documentai.v1.IDeployProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployProcessorVersion( - request?: protos.google.cloud.documentai.v1.IDeployProcessorVersionRequest, - 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('deployProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deployProcessorVersion request %j', request); - return this.innerApiCalls.deployProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deployProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deployProcessorVersion()`. - * @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/document_processor_service.deploy_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_async - */ - async checkDeployProcessorVersionProgress(name: string): Promise>{ - this._log.info('deployProcessorVersion 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.deployProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Undeploys the processor version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor version resource name to be undeployed. - * @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/document_processor_service.undeploy_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_async - */ - undeployProcessorVersion( - request?: protos.google.cloud.documentai.v1.IUndeployProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - undeployProcessorVersion( - request: protos.google.cloud.documentai.v1.IUndeployProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployProcessorVersion( - request: protos.google.cloud.documentai.v1.IUndeployProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployProcessorVersion( - request?: protos.google.cloud.documentai.v1.IUndeployProcessorVersionRequest, - 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('undeployProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('undeployProcessorVersion request %j', request); - return this.innerApiCalls.undeployProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('undeployProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `undeployProcessorVersion()`. - * @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/document_processor_service.undeploy_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_async - */ - async checkUndeployProcessorVersionProgress(name: string): Promise>{ - this._log.info('undeployProcessorVersion 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.undeployProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes the processor, unloads all deployed model artifacts if it was - * enabled and then deletes all artifacts associated with this processor. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor resource name to be deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * 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/document_processor_service.delete_processor.js - * region_tag:documentai_v1_generated_DocumentProcessorService_DeleteProcessor_async - */ - deleteProcessor( - request?: protos.google.cloud.documentai.v1.IDeleteProcessorRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteProcessor( - request: protos.google.cloud.documentai.v1.IDeleteProcessorRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteProcessor( - request: protos.google.cloud.documentai.v1.IDeleteProcessorRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteProcessor( - request?: protos.google.cloud.documentai.v1.IDeleteProcessorRequest, - 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('deleteProcessor response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteProcessor request %j', request); - return this.innerApiCalls.deleteProcessor(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteProcessor response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteProcessor()`. - * @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/document_processor_service.delete_processor.js - * region_tag:documentai_v1_generated_DocumentProcessorService_DeleteProcessor_async - */ - async checkDeleteProcessorProgress(name: string): Promise>{ - this._log.info('deleteProcessor 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.deleteProcessor, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Enables a processor - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor resource name to be enabled. - * @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/document_processor_service.enable_processor.js - * region_tag:documentai_v1_generated_DocumentProcessorService_EnableProcessor_async - */ - enableProcessor( - request?: protos.google.cloud.documentai.v1.IEnableProcessorRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - enableProcessor( - request: protos.google.cloud.documentai.v1.IEnableProcessorRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - enableProcessor( - request: protos.google.cloud.documentai.v1.IEnableProcessorRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - enableProcessor( - request?: protos.google.cloud.documentai.v1.IEnableProcessorRequest, - 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('enableProcessor response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('enableProcessor request %j', request); - return this.innerApiCalls.enableProcessor(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('enableProcessor response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `enableProcessor()`. - * @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/document_processor_service.enable_processor.js - * region_tag:documentai_v1_generated_DocumentProcessorService_EnableProcessor_async - */ - async checkEnableProcessorProgress(name: string): Promise>{ - this._log.info('enableProcessor 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.enableProcessor, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Disables a processor - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor resource name to be disabled. - * @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/document_processor_service.disable_processor.js - * region_tag:documentai_v1_generated_DocumentProcessorService_DisableProcessor_async - */ - disableProcessor( - request?: protos.google.cloud.documentai.v1.IDisableProcessorRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - disableProcessor( - request: protos.google.cloud.documentai.v1.IDisableProcessorRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - disableProcessor( - request: protos.google.cloud.documentai.v1.IDisableProcessorRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - disableProcessor( - request?: protos.google.cloud.documentai.v1.IDisableProcessorRequest, - 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('disableProcessor response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('disableProcessor request %j', request); - return this.innerApiCalls.disableProcessor(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('disableProcessor response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `disableProcessor()`. - * @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/document_processor_service.disable_processor.js - * region_tag:documentai_v1_generated_DocumentProcessorService_DisableProcessor_async - */ - async checkDisableProcessorProgress(name: string): Promise>{ - this._log.info('disableProcessor 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.disableProcessor, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Set the default (active) version of a - * {@link protos.google.cloud.documentai.v1.Processor|Processor} that will be used in - * {@link protos.google.cloud.documentai.v1.DocumentProcessorService.ProcessDocument|ProcessDocument} - * and - * {@link protos.google.cloud.documentai.v1.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.processor - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1.Processor|Processor} to change default - * version. - * @param {string} request.defaultProcessorVersion - * Required. The resource name of child - * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} to use as - * default. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - * @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/document_processor_service.set_default_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_async - */ - setDefaultProcessorVersion( - request?: protos.google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - setDefaultProcessorVersion( - request: protos.google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - setDefaultProcessorVersion( - request: protos.google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - setDefaultProcessorVersion( - request?: protos.google.cloud.documentai.v1.ISetDefaultProcessorVersionRequest, - 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({ - 'processor': request.processor ?? '', - }); - 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('setDefaultProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('setDefaultProcessorVersion request %j', request); - return this.innerApiCalls.setDefaultProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('setDefaultProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `setDefaultProcessorVersion()`. - * @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/document_processor_service.set_default_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_async - */ - async checkSetDefaultProcessorVersionProgress(name: string): Promise>{ - this._log.info('setDefaultProcessorVersion 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.setDefaultProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Send a document for Human Review. The input document should be processed by - * the specified processor. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.documentai.v1.Document} request.inlineDocument - * An inline document proto. - * @param {string} request.humanReviewConfig - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1.HumanReviewConfig|HumanReviewConfig} that the - * document will be reviewed with. - * @param {boolean} request.enableSchemaValidation - * Whether the validation should be performed on the ad-hoc review request. - * @param {google.cloud.documentai.v1.ReviewDocumentRequest.Priority} request.priority - * The priority of the human review task. - * @param {google.cloud.documentai.v1.DocumentSchema} request.documentSchema - * The document schema of the human review task. - * @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/document_processor_service.review_document.js - * region_tag:documentai_v1_generated_DocumentProcessorService_ReviewDocument_async - */ - reviewDocument( - request?: protos.google.cloud.documentai.v1.IReviewDocumentRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - reviewDocument( - request: protos.google.cloud.documentai.v1.IReviewDocumentRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - reviewDocument( - request: protos.google.cloud.documentai.v1.IReviewDocumentRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - reviewDocument( - request?: protos.google.cloud.documentai.v1.IReviewDocumentRequest, - 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({ - 'human_review_config': request.humanReviewConfig ?? '', - }); - 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('reviewDocument response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('reviewDocument request %j', request); - return this.innerApiCalls.reviewDocument(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('reviewDocument response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `reviewDocument()`. - * @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/document_processor_service.review_document.js - * region_tag:documentai_v1_generated_DocumentProcessorService_ReviewDocument_async - */ - async checkReviewDocumentProgress(name: string): Promise>{ - this._log.info('reviewDocument 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.reviewDocument, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Evaluates a ProcessorVersion against annotated documents, producing an - * Evaluation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.processorVersion - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} to - * evaluate. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param {google.cloud.documentai.v1.BatchDocumentsInputConfig} [request.evaluationDocuments] - * Optional. The documents used in the evaluation. If unspecified, use the - * processor's dataset as evaluation input. - * @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/document_processor_service.evaluate_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_async - */ - evaluateProcessorVersion( - request?: protos.google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - evaluateProcessorVersion( - request: protos.google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - evaluateProcessorVersion( - request: protos.google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - evaluateProcessorVersion( - request?: protos.google.cloud.documentai.v1.IEvaluateProcessorVersionRequest, - 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({ - 'processor_version': request.processorVersion ?? '', - }); - 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('evaluateProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('evaluateProcessorVersion request %j', request); - return this.innerApiCalls.evaluateProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('evaluateProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `evaluateProcessorVersion()`. - * @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/document_processor_service.evaluate_processor_version.js - * region_tag:documentai_v1_generated_DocumentProcessorService_EvaluateProcessorVersion_async - */ - async checkEvaluateProcessorVersionProgress(name: string): Promise>{ - this._log.info('evaluateProcessorVersion 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.evaluateProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists the processor types that exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * Used to retrieve the next page of results, empty if at the end of the list. - * @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.documentai.v1.ProcessorType|ProcessorType}. - * 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 `listProcessorTypesAsync()` - * 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. - */ - listProcessorTypes( - request?: protos.google.cloud.documentai.v1.IListProcessorTypesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1.IProcessorType[], - protos.google.cloud.documentai.v1.IListProcessorTypesRequest|null, - protos.google.cloud.documentai.v1.IListProcessorTypesResponse - ]>; - listProcessorTypes( - request: protos.google.cloud.documentai.v1.IListProcessorTypesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.documentai.v1.IListProcessorTypesRequest, - protos.google.cloud.documentai.v1.IListProcessorTypesResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessorType>): void; - listProcessorTypes( - request: protos.google.cloud.documentai.v1.IListProcessorTypesRequest, - callback: PaginationCallback< - protos.google.cloud.documentai.v1.IListProcessorTypesRequest, - protos.google.cloud.documentai.v1.IListProcessorTypesResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessorType>): void; - listProcessorTypes( - request?: protos.google.cloud.documentai.v1.IListProcessorTypesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.documentai.v1.IListProcessorTypesRequest, - protos.google.cloud.documentai.v1.IListProcessorTypesResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessorType>, - callback?: PaginationCallback< - protos.google.cloud.documentai.v1.IListProcessorTypesRequest, - protos.google.cloud.documentai.v1.IListProcessorTypesResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessorType>): - Promise<[ - protos.google.cloud.documentai.v1.IProcessorType[], - protos.google.cloud.documentai.v1.IListProcessorTypesRequest|null, - protos.google.cloud.documentai.v1.IListProcessorTypesResponse - ]>|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.documentai.v1.IListProcessorTypesRequest, - protos.google.cloud.documentai.v1.IListProcessorTypesResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessorType>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listProcessorTypes values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listProcessorTypes request %j', request); - return this.innerApiCalls - .listProcessorTypes(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.documentai.v1.IProcessorType[], - protos.google.cloud.documentai.v1.IListProcessorTypesRequest|null, - protos.google.cloud.documentai.v1.IListProcessorTypesResponse - ]) => { - this._log.info('listProcessorTypes values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listProcessorTypes`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * Used to retrieve the next page of results, empty if at the end of the list. - * @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.documentai.v1.ProcessorType|ProcessorType} 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 `listProcessorTypesAsync()` - * 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. - */ - listProcessorTypesStream( - request?: protos.google.cloud.documentai.v1.IListProcessorTypesRequest, - 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['listProcessorTypes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listProcessorTypes stream %j', request); - return this.descriptors.page.listProcessorTypes.createStream( - this.innerApiCalls.listProcessorTypes as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listProcessorTypes`, 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 location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * Used to retrieve the next page of results, empty if at the end of the list. - * @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.documentai.v1.ProcessorType|ProcessorType}. 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_processor_service.list_processor_types.js - * region_tag:documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_async - */ - listProcessorTypesAsync( - request?: protos.google.cloud.documentai.v1.IListProcessorTypesRequest, - 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['listProcessorTypes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listProcessorTypes iterate %j', request); - return this.descriptors.page.listProcessorTypes.asyncIterate( - this.innerApiCalls['listProcessorTypes'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all processors which belong to this project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * We will return the processors sorted by creation time. The page token - * will point to the next processor. - * @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.documentai.v1.Processor|Processor}. - * 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 `listProcessorsAsync()` - * 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. - */ - listProcessors( - request?: protos.google.cloud.documentai.v1.IListProcessorsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1.IProcessor[], - protos.google.cloud.documentai.v1.IListProcessorsRequest|null, - protos.google.cloud.documentai.v1.IListProcessorsResponse - ]>; - listProcessors( - request: protos.google.cloud.documentai.v1.IListProcessorsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.documentai.v1.IListProcessorsRequest, - protos.google.cloud.documentai.v1.IListProcessorsResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessor>): void; - listProcessors( - request: protos.google.cloud.documentai.v1.IListProcessorsRequest, - callback: PaginationCallback< - protos.google.cloud.documentai.v1.IListProcessorsRequest, - protos.google.cloud.documentai.v1.IListProcessorsResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessor>): void; - listProcessors( - request?: protos.google.cloud.documentai.v1.IListProcessorsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.documentai.v1.IListProcessorsRequest, - protos.google.cloud.documentai.v1.IListProcessorsResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessor>, - callback?: PaginationCallback< - protos.google.cloud.documentai.v1.IListProcessorsRequest, - protos.google.cloud.documentai.v1.IListProcessorsResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessor>): - Promise<[ - protos.google.cloud.documentai.v1.IProcessor[], - protos.google.cloud.documentai.v1.IListProcessorsRequest|null, - protos.google.cloud.documentai.v1.IListProcessorsResponse - ]>|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.documentai.v1.IListProcessorsRequest, - protos.google.cloud.documentai.v1.IListProcessorsResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessor>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listProcessors values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listProcessors request %j', request); - return this.innerApiCalls - .listProcessors(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.documentai.v1.IProcessor[], - protos.google.cloud.documentai.v1.IListProcessorsRequest|null, - protos.google.cloud.documentai.v1.IListProcessorsResponse - ]) => { - this._log.info('listProcessors values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listProcessors`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * We will return the processors sorted by creation time. The page token - * will point to the next processor. - * @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.documentai.v1.Processor|Processor} 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 `listProcessorsAsync()` - * 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. - */ - listProcessorsStream( - request?: protos.google.cloud.documentai.v1.IListProcessorsRequest, - 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['listProcessors']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listProcessors stream %j', request); - return this.descriptors.page.listProcessors.createStream( - this.innerApiCalls.listProcessors as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listProcessors`, 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 (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * We will return the processors sorted by creation time. The page token - * will point to the next processor. - * @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.documentai.v1.Processor|Processor}. 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_processor_service.list_processors.js - * region_tag:documentai_v1_generated_DocumentProcessorService_ListProcessors_async - */ - listProcessorsAsync( - request?: protos.google.cloud.documentai.v1.IListProcessorsRequest, - 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['listProcessors']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listProcessors iterate %j', request); - return this.descriptors.page.listProcessors.asyncIterate( - this.innerApiCalls['listProcessors'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all versions of a processor. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * We will return the processor versions sorted by creation time. The page - * token will point to the next processor version. - * @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.documentai.v1.ProcessorVersion|ProcessorVersion}. - * 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 `listProcessorVersionsAsync()` - * 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. - */ - listProcessorVersions( - request?: protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1.IProcessorVersion[], - protos.google.cloud.documentai.v1.IListProcessorVersionsRequest|null, - protos.google.cloud.documentai.v1.IListProcessorVersionsResponse - ]>; - listProcessorVersions( - request: protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, - protos.google.cloud.documentai.v1.IListProcessorVersionsResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessorVersion>): void; - listProcessorVersions( - request: protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, - protos.google.cloud.documentai.v1.IListProcessorVersionsResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessorVersion>): void; - listProcessorVersions( - request?: protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, - protos.google.cloud.documentai.v1.IListProcessorVersionsResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessorVersion>, - callback?: PaginationCallback< - protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, - protos.google.cloud.documentai.v1.IListProcessorVersionsResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessorVersion>): - Promise<[ - protos.google.cloud.documentai.v1.IProcessorVersion[], - protos.google.cloud.documentai.v1.IListProcessorVersionsRequest|null, - protos.google.cloud.documentai.v1.IListProcessorVersionsResponse - ]>|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.documentai.v1.IListProcessorVersionsRequest, - protos.google.cloud.documentai.v1.IListProcessorVersionsResponse|null|undefined, - protos.google.cloud.documentai.v1.IProcessorVersion>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listProcessorVersions values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listProcessorVersions request %j', request); - return this.innerApiCalls - .listProcessorVersions(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.documentai.v1.IProcessorVersion[], - protos.google.cloud.documentai.v1.IListProcessorVersionsRequest|null, - protos.google.cloud.documentai.v1.IListProcessorVersionsResponse - ]) => { - this._log.info('listProcessorVersions values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listProcessorVersions`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * We will return the processor versions sorted by creation time. The page - * token will point to the next processor version. - * @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.documentai.v1.ProcessorVersion|ProcessorVersion} 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 `listProcessorVersionsAsync()` - * 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. - */ - listProcessorVersionsStream( - request?: protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, - 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['listProcessorVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listProcessorVersions stream %j', request); - return this.descriptors.page.listProcessorVersions.createStream( - this.innerApiCalls.listProcessorVersions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listProcessorVersions`, 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 (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * We will return the processor versions sorted by creation time. The page - * token will point to the next processor version. - * @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.documentai.v1.ProcessorVersion|ProcessorVersion}. 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_processor_service.list_processor_versions.js - * region_tag:documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_async - */ - listProcessorVersionsAsync( - request?: protos.google.cloud.documentai.v1.IListProcessorVersionsRequest, - 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['listProcessorVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listProcessorVersions iterate %j', request); - return this.descriptors.page.listProcessorVersions.asyncIterate( - this.innerApiCalls['listProcessorVersions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Retrieves a set of evaluations for a given processor version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} to list - * evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * A page token, received from a previous `ListEvaluations` call. - * Provide this to retrieve the subsequent page. - * @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.documentai.v1.Evaluation|Evaluation}. - * 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 `listEvaluationsAsync()` - * 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. - */ - listEvaluations( - request?: protos.google.cloud.documentai.v1.IListEvaluationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1.IEvaluation[], - protos.google.cloud.documentai.v1.IListEvaluationsRequest|null, - protos.google.cloud.documentai.v1.IListEvaluationsResponse - ]>; - listEvaluations( - request: protos.google.cloud.documentai.v1.IListEvaluationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.documentai.v1.IListEvaluationsRequest, - protos.google.cloud.documentai.v1.IListEvaluationsResponse|null|undefined, - protos.google.cloud.documentai.v1.IEvaluation>): void; - listEvaluations( - request: protos.google.cloud.documentai.v1.IListEvaluationsRequest, - callback: PaginationCallback< - protos.google.cloud.documentai.v1.IListEvaluationsRequest, - protos.google.cloud.documentai.v1.IListEvaluationsResponse|null|undefined, - protos.google.cloud.documentai.v1.IEvaluation>): void; - listEvaluations( - request?: protos.google.cloud.documentai.v1.IListEvaluationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.documentai.v1.IListEvaluationsRequest, - protos.google.cloud.documentai.v1.IListEvaluationsResponse|null|undefined, - protos.google.cloud.documentai.v1.IEvaluation>, - callback?: PaginationCallback< - protos.google.cloud.documentai.v1.IListEvaluationsRequest, - protos.google.cloud.documentai.v1.IListEvaluationsResponse|null|undefined, - protos.google.cloud.documentai.v1.IEvaluation>): - Promise<[ - protos.google.cloud.documentai.v1.IEvaluation[], - protos.google.cloud.documentai.v1.IListEvaluationsRequest|null, - protos.google.cloud.documentai.v1.IListEvaluationsResponse - ]>|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.documentai.v1.IListEvaluationsRequest, - protos.google.cloud.documentai.v1.IListEvaluationsResponse|null|undefined, - protos.google.cloud.documentai.v1.IEvaluation>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listEvaluations values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listEvaluations request %j', request); - return this.innerApiCalls - .listEvaluations(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.documentai.v1.IEvaluation[], - protos.google.cloud.documentai.v1.IListEvaluationsRequest|null, - protos.google.cloud.documentai.v1.IListEvaluationsResponse - ]) => { - this._log.info('listEvaluations values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listEvaluations`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} to list - * evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * A page token, received from a previous `ListEvaluations` call. - * Provide this to retrieve the subsequent page. - * @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.documentai.v1.Evaluation|Evaluation} 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 `listEvaluationsAsync()` - * 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. - */ - listEvaluationsStream( - request?: protos.google.cloud.documentai.v1.IListEvaluationsRequest, - 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['listEvaluations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listEvaluations stream %j', request); - return this.descriptors.page.listEvaluations.createStream( - this.innerApiCalls.listEvaluations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listEvaluations`, 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 resource name of the - * {@link protos.google.cloud.documentai.v1.ProcessorVersion|ProcessorVersion} to list - * evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * A page token, received from a previous `ListEvaluations` call. - * Provide this to retrieve the subsequent page. - * @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.documentai.v1.Evaluation|Evaluation}. 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_processor_service.list_evaluations.js - * region_tag:documentai_v1_generated_DocumentProcessorService_ListEvaluations_async - */ - listEvaluationsAsync( - request?: protos.google.cloud.documentai.v1.IListEvaluationsRequest, - 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['listEvaluations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listEvaluations iterate %j', request); - return this.descriptors.page.listEvaluations.asyncIterate( - this.innerApiCalls['listEvaluations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @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 google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list 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 google.cloud.location.Location | Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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 evaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @param {string} processor_version - * @param {string} evaluation - * @returns {string} Resource name string. - */ - evaluationPath(project:string,location:string,processor:string,processorVersion:string,evaluation:string) { - return this.pathTemplates.evaluationPathTemplate.render({ - project: project, - location: location, - processor: processor, - processor_version: processorVersion, - evaluation: evaluation, - }); - } - - /** - * Parse the project from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project; - } - - /** - * Parse the location from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location; - } - - /** - * Parse the processor from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).processor; - } - - /** - * Parse the processor_version from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the processor_version. - */ - matchProcessorVersionFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).processor_version; - } - - /** - * Parse the evaluation from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation; - } - - /** - * Return a fully-qualified humanReviewConfig resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @returns {string} Resource name string. - */ - humanReviewConfigPath(project:string,location:string,processor:string) { - return this.pathTemplates.humanReviewConfigPathTemplate.render({ - project: project, - location: location, - processor: processor, - }); - } - - /** - * Parse the project from HumanReviewConfig resource. - * - * @param {string} humanReviewConfigName - * A fully-qualified path representing HumanReviewConfig resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHumanReviewConfigName(humanReviewConfigName: string) { - return this.pathTemplates.humanReviewConfigPathTemplate.match(humanReviewConfigName).project; - } - - /** - * Parse the location from HumanReviewConfig resource. - * - * @param {string} humanReviewConfigName - * A fully-qualified path representing HumanReviewConfig resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHumanReviewConfigName(humanReviewConfigName: string) { - return this.pathTemplates.humanReviewConfigPathTemplate.match(humanReviewConfigName).location; - } - - /** - * Parse the processor from HumanReviewConfig resource. - * - * @param {string} humanReviewConfigName - * A fully-qualified path representing HumanReviewConfig resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromHumanReviewConfigName(humanReviewConfigName: string) { - return this.pathTemplates.humanReviewConfigPathTemplate.match(humanReviewConfigName).processor; - } - - /** - * 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 processor resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @returns {string} Resource name string. - */ - processorPath(project:string,location:string,processor:string) { - return this.pathTemplates.processorPathTemplate.render({ - project: project, - location: location, - processor: processor, - }); - } - - /** - * Parse the project from Processor resource. - * - * @param {string} processorName - * A fully-qualified path representing Processor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProcessorName(processorName: string) { - return this.pathTemplates.processorPathTemplate.match(processorName).project; - } - - /** - * Parse the location from Processor resource. - * - * @param {string} processorName - * A fully-qualified path representing Processor resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProcessorName(processorName: string) { - return this.pathTemplates.processorPathTemplate.match(processorName).location; - } - - /** - * Parse the processor from Processor resource. - * - * @param {string} processorName - * A fully-qualified path representing Processor resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromProcessorName(processorName: string) { - return this.pathTemplates.processorPathTemplate.match(processorName).processor; - } - - /** - * Return a fully-qualified processorType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor_type - * @returns {string} Resource name string. - */ - processorTypePath(project:string,location:string,processorType:string) { - return this.pathTemplates.processorTypePathTemplate.render({ - project: project, - location: location, - processor_type: processorType, - }); - } - - /** - * Parse the project from ProcessorType resource. - * - * @param {string} processorTypeName - * A fully-qualified path representing ProcessorType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProcessorTypeName(processorTypeName: string) { - return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).project; - } - - /** - * Parse the location from ProcessorType resource. - * - * @param {string} processorTypeName - * A fully-qualified path representing ProcessorType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProcessorTypeName(processorTypeName: string) { - return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).location; - } - - /** - * Parse the processor_type from ProcessorType resource. - * - * @param {string} processorTypeName - * A fully-qualified path representing ProcessorType resource. - * @returns {string} A string representing the processor_type. - */ - matchProcessorTypeFromProcessorTypeName(processorTypeName: string) { - return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).processor_type; - } - - /** - * Return a fully-qualified processorVersion resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @param {string} processor_version - * @returns {string} Resource name string. - */ - processorVersionPath(project:string,location:string,processor:string,processorVersion:string) { - return this.pathTemplates.processorVersionPathTemplate.render({ - project: project, - location: location, - processor: processor, - processor_version: processorVersion, - }); - } - - /** - * Parse the project from ProcessorVersion resource. - * - * @param {string} processorVersionName - * A fully-qualified path representing ProcessorVersion resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProcessorVersionName(processorVersionName: string) { - return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).project; - } - - /** - * Parse the location from ProcessorVersion resource. - * - * @param {string} processorVersionName - * A fully-qualified path representing ProcessorVersion resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProcessorVersionName(processorVersionName: string) { - return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).location; - } - - /** - * Parse the processor from ProcessorVersion resource. - * - * @param {string} processorVersionName - * A fully-qualified path representing ProcessorVersion resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromProcessorVersionName(processorVersionName: string) { - return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).processor; - } - - /** - * Parse the processor_version from ProcessorVersion resource. - * - * @param {string} processorVersionName - * A fully-qualified path representing ProcessorVersion resource. - * @returns {string} A string representing the processor_version. - */ - matchProcessorVersionFromProcessorVersionName(processorVersionName: string) { - return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).processor_version; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * 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.documentProcessorServiceStub && !this._terminated) { - return this.documentProcessorServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client_config.json b/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client_config.json deleted file mode 100644 index dc1f741acb4..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_client_config.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "interfaces": { - "google.cloud.documentai.v1.DocumentProcessorService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "deadline_exceeded_resource_exhausted_unavailable": [ - "DEADLINE_EXCEEDED", - "RESOURCE_EXHAUSTED", - "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 - }, - "cf44f94e283152b741c30fbc9df4a6abb71aa468": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 9, - "max_retry_delay_millis": 90000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "c85d7af2fd532496a9c7916f9bf84795125b2bf2": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.5, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ProcessDocument": { - "timeout_millis": 300000, - "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", - "retry_params_name": "cf44f94e283152b741c30fbc9df4a6abb71aa468" - }, - "BatchProcessDocuments": { - "timeout_millis": 120000, - "retry_codes_name": "idempotent", - "retry_params_name": "c85d7af2fd532496a9c7916f9bf84795125b2bf2" - }, - "FetchProcessorTypes": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListProcessorTypes": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetProcessorType": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListProcessors": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetProcessor": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TrainProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListProcessorVersions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeployProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UndeployProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateProcessor": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteProcessor": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "EnableProcessor": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DisableProcessor": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetDefaultProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ReviewDocument": { - "timeout_millis": 120000, - "retry_codes_name": "idempotent", - "retry_params_name": "c85d7af2fd532496a9c7916f9bf84795125b2bf2" - }, - "EvaluateProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetEvaluation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListEvaluations": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_proto_list.json b/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_proto_list.json deleted file mode 100644 index 6289f351f4a..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1/document_processor_service_proto_list.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - "../../protos/google/cloud/documentai/v1/barcode.proto", - "../../protos/google/cloud/documentai/v1/document.proto", - "../../protos/google/cloud/documentai/v1/document_io.proto", - "../../protos/google/cloud/documentai/v1/document_processor_service.proto", - "../../protos/google/cloud/documentai/v1/document_schema.proto", - "../../protos/google/cloud/documentai/v1/evaluation.proto", - "../../protos/google/cloud/documentai/v1/geometry.proto", - "../../protos/google/cloud/documentai/v1/operation_metadata.proto", - "../../protos/google/cloud/documentai/v1/processor.proto", - "../../protos/google/cloud/documentai/v1/processor_type.proto" -] diff --git a/owl-bot-staging/google-cloud-documentai/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-documentai/src/v1/gapic_metadata.json deleted file mode 100644 index 59cbeb99dc1..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1/gapic_metadata.json +++ /dev/null @@ -1,259 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.documentai.v1", - "libraryPackage": "@google-cloud/documentai", - "services": { - "DocumentProcessorService": { - "clients": { - "grpc": { - "libraryClient": "DocumentProcessorServiceClient", - "rpcs": { - "ProcessDocument": { - "methods": [ - "processDocument" - ] - }, - "FetchProcessorTypes": { - "methods": [ - "fetchProcessorTypes" - ] - }, - "GetProcessorType": { - "methods": [ - "getProcessorType" - ] - }, - "GetProcessor": { - "methods": [ - "getProcessor" - ] - }, - "GetProcessorVersion": { - "methods": [ - "getProcessorVersion" - ] - }, - "CreateProcessor": { - "methods": [ - "createProcessor" - ] - }, - "GetEvaluation": { - "methods": [ - "getEvaluation" - ] - }, - "BatchProcessDocuments": { - "methods": [ - "batchProcessDocuments" - ] - }, - "TrainProcessorVersion": { - "methods": [ - "trainProcessorVersion" - ] - }, - "DeleteProcessorVersion": { - "methods": [ - "deleteProcessorVersion" - ] - }, - "DeployProcessorVersion": { - "methods": [ - "deployProcessorVersion" - ] - }, - "UndeployProcessorVersion": { - "methods": [ - "undeployProcessorVersion" - ] - }, - "DeleteProcessor": { - "methods": [ - "deleteProcessor" - ] - }, - "EnableProcessor": { - "methods": [ - "enableProcessor" - ] - }, - "DisableProcessor": { - "methods": [ - "disableProcessor" - ] - }, - "SetDefaultProcessorVersion": { - "methods": [ - "setDefaultProcessorVersion" - ] - }, - "ReviewDocument": { - "methods": [ - "reviewDocument" - ] - }, - "EvaluateProcessorVersion": { - "methods": [ - "evaluateProcessorVersion" - ] - }, - "ListProcessorTypes": { - "methods": [ - "listProcessorTypes", - "listProcessorTypesStream", - "listProcessorTypesAsync" - ] - }, - "ListProcessors": { - "methods": [ - "listProcessors", - "listProcessorsStream", - "listProcessorsAsync" - ] - }, - "ListProcessorVersions": { - "methods": [ - "listProcessorVersions", - "listProcessorVersionsStream", - "listProcessorVersionsAsync" - ] - }, - "ListEvaluations": { - "methods": [ - "listEvaluations", - "listEvaluationsStream", - "listEvaluationsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DocumentProcessorServiceClient", - "rpcs": { - "ProcessDocument": { - "methods": [ - "processDocument" - ] - }, - "FetchProcessorTypes": { - "methods": [ - "fetchProcessorTypes" - ] - }, - "GetProcessorType": { - "methods": [ - "getProcessorType" - ] - }, - "GetProcessor": { - "methods": [ - "getProcessor" - ] - }, - "GetProcessorVersion": { - "methods": [ - "getProcessorVersion" - ] - }, - "CreateProcessor": { - "methods": [ - "createProcessor" - ] - }, - "GetEvaluation": { - "methods": [ - "getEvaluation" - ] - }, - "BatchProcessDocuments": { - "methods": [ - "batchProcessDocuments" - ] - }, - "TrainProcessorVersion": { - "methods": [ - "trainProcessorVersion" - ] - }, - "DeleteProcessorVersion": { - "methods": [ - "deleteProcessorVersion" - ] - }, - "DeployProcessorVersion": { - "methods": [ - "deployProcessorVersion" - ] - }, - "UndeployProcessorVersion": { - "methods": [ - "undeployProcessorVersion" - ] - }, - "DeleteProcessor": { - "methods": [ - "deleteProcessor" - ] - }, - "EnableProcessor": { - "methods": [ - "enableProcessor" - ] - }, - "DisableProcessor": { - "methods": [ - "disableProcessor" - ] - }, - "SetDefaultProcessorVersion": { - "methods": [ - "setDefaultProcessorVersion" - ] - }, - "ReviewDocument": { - "methods": [ - "reviewDocument" - ] - }, - "EvaluateProcessorVersion": { - "methods": [ - "evaluateProcessorVersion" - ] - }, - "ListProcessorTypes": { - "methods": [ - "listProcessorTypes", - "listProcessorTypesStream", - "listProcessorTypesAsync" - ] - }, - "ListProcessors": { - "methods": [ - "listProcessors", - "listProcessorsStream", - "listProcessorsAsync" - ] - }, - "ListProcessorVersions": { - "methods": [ - "listProcessorVersions", - "listProcessorVersionsStream", - "listProcessorVersionsAsync" - ] - }, - "ListEvaluations": { - "methods": [ - "listEvaluations", - "listEvaluationsStream", - "listEvaluationsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-documentai/src/v1/index.ts b/owl-bot-staging/google-cloud-documentai/src/v1/index.ts deleted file mode 100644 index d0e9c42d965..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1/index.ts +++ /dev/null @@ -1,19 +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 {DocumentProcessorServiceClient} from './document_processor_service_client'; diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts deleted file mode 100644 index 27cb62e3cd3..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts +++ /dev/null @@ -1,4176 +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, PaginationCallback, GaxCall, LocationsClient, LocationProtos} 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/v1beta3/document_processor_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './document_processor_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * 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. - * @class - * @memberof v1beta3 - */ -export class DocumentProcessorServiceClient { - 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('documentai'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - documentProcessorServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DocumentProcessorServiceClient. - * - * @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 DocumentProcessorServiceClient({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 DocumentProcessorServiceClient; - 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 = 'documentai.' + 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; - } - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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 = { - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}/dataset' - ), - datasetSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema' - ), - evaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}' - ), - humanReviewConfigPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - processorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}' - ), - processorTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processorTypes/{processor_type}' - ), - processorVersionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - }; - - // 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 = { - listProcessorTypes: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'processorTypes'), - listProcessors: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'processors'), - listProcessorVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'processorVersions'), - listEvaluations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'evaluations') - }; - - 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.cloud.location.Locations.GetLocation',get: '/v1beta3/{name=projects/*/locations/*}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1beta3/{name=projects/*}/locations',additional_bindings: [{get: '/uiv1beta3/{name=projects/*}/locations',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1beta3/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/uiv1beta3/{name=projects/*/locations/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta3/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta3/{name=projects/*/locations/*/operations}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*/operations}',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const batchProcessDocumentsResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.BatchProcessResponse') as gax.protobuf.Type; - const batchProcessDocumentsMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.BatchProcessMetadata') as gax.protobuf.Type; - const trainProcessorVersionResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.TrainProcessorVersionResponse') as gax.protobuf.Type; - const trainProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata') as gax.protobuf.Type; - const deleteProcessorVersionResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.DeleteProcessorVersionMetadata') as gax.protobuf.Type; - const deployProcessorVersionResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.DeployProcessorVersionResponse') as gax.protobuf.Type; - const deployProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.DeployProcessorVersionMetadata') as gax.protobuf.Type; - const undeployProcessorVersionResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.UndeployProcessorVersionResponse') as gax.protobuf.Type; - const undeployProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.UndeployProcessorVersionMetadata') as gax.protobuf.Type; - const deleteProcessorResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteProcessorMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.DeleteProcessorMetadata') as gax.protobuf.Type; - const enableProcessorResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.EnableProcessorResponse') as gax.protobuf.Type; - const enableProcessorMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.EnableProcessorMetadata') as gax.protobuf.Type; - const disableProcessorResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.DisableProcessorResponse') as gax.protobuf.Type; - const disableProcessorMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.DisableProcessorMetadata') as gax.protobuf.Type; - const setDefaultProcessorVersionResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse') as gax.protobuf.Type; - const setDefaultProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata') as gax.protobuf.Type; - const reviewDocumentResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.ReviewDocumentResponse') as gax.protobuf.Type; - const reviewDocumentMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata') as gax.protobuf.Type; - const evaluateProcessorVersionResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse') as gax.protobuf.Type; - const evaluateProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata') as gax.protobuf.Type; - const importProcessorVersionResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.ImportProcessorVersionResponse') as gax.protobuf.Type; - const importProcessorVersionMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.ImportProcessorVersionMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - batchProcessDocuments: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchProcessDocumentsResponse.decode.bind(batchProcessDocumentsResponse), - batchProcessDocumentsMetadata.decode.bind(batchProcessDocumentsMetadata)), - trainProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - trainProcessorVersionResponse.decode.bind(trainProcessorVersionResponse), - trainProcessorVersionMetadata.decode.bind(trainProcessorVersionMetadata)), - deleteProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteProcessorVersionResponse.decode.bind(deleteProcessorVersionResponse), - deleteProcessorVersionMetadata.decode.bind(deleteProcessorVersionMetadata)), - deployProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deployProcessorVersionResponse.decode.bind(deployProcessorVersionResponse), - deployProcessorVersionMetadata.decode.bind(deployProcessorVersionMetadata)), - undeployProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - undeployProcessorVersionResponse.decode.bind(undeployProcessorVersionResponse), - undeployProcessorVersionMetadata.decode.bind(undeployProcessorVersionMetadata)), - deleteProcessor: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteProcessorResponse.decode.bind(deleteProcessorResponse), - deleteProcessorMetadata.decode.bind(deleteProcessorMetadata)), - enableProcessor: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - enableProcessorResponse.decode.bind(enableProcessorResponse), - enableProcessorMetadata.decode.bind(enableProcessorMetadata)), - disableProcessor: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - disableProcessorResponse.decode.bind(disableProcessorResponse), - disableProcessorMetadata.decode.bind(disableProcessorMetadata)), - setDefaultProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - setDefaultProcessorVersionResponse.decode.bind(setDefaultProcessorVersionResponse), - setDefaultProcessorVersionMetadata.decode.bind(setDefaultProcessorVersionMetadata)), - reviewDocument: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - reviewDocumentResponse.decode.bind(reviewDocumentResponse), - reviewDocumentMetadata.decode.bind(reviewDocumentMetadata)), - evaluateProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - evaluateProcessorVersionResponse.decode.bind(evaluateProcessorVersionResponse), - evaluateProcessorVersionMetadata.decode.bind(evaluateProcessorVersionMetadata)), - importProcessorVersion: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - importProcessorVersionResponse.decode.bind(importProcessorVersionResponse), - importProcessorVersionMetadata.decode.bind(importProcessorVersionMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.documentai.v1beta3.DocumentProcessorService', 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.documentProcessorServiceStub) { - return this.documentProcessorServiceStub; - } - - // Put together the "service stub" for - // google.cloud.documentai.v1beta3.DocumentProcessorService. - this.documentProcessorServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.documentai.v1beta3.DocumentProcessorService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.documentai.v1beta3.DocumentProcessorService, - 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 documentProcessorServiceStubMethods = - ['processDocument', 'batchProcessDocuments', 'fetchProcessorTypes', 'listProcessorTypes', 'getProcessorType', 'listProcessors', 'getProcessor', 'trainProcessorVersion', 'getProcessorVersion', 'listProcessorVersions', 'deleteProcessorVersion', 'deployProcessorVersion', 'undeployProcessorVersion', 'createProcessor', 'deleteProcessor', 'enableProcessor', 'disableProcessor', 'setDefaultProcessorVersion', 'reviewDocument', 'evaluateProcessorVersion', 'getEvaluation', 'listEvaluations', 'importProcessorVersion']; - for (const methodName of documentProcessorServiceStubMethods) { - const callPromise = this.documentProcessorServiceStub.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] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.documentProcessorServiceStub; - } - - /** - * 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 'documentai.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 'documentai.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 -- - // ------------------- -/** - * Processes a single document. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.documentai.v1beta3.Document} request.inlineDocument - * An inline document proto. - * @param {google.cloud.documentai.v1beta3.RawDocument} request.rawDocument - * A raw document content (bytes). - * @param {google.cloud.documentai.v1beta3.GcsDocument} request.gcsDocument - * A raw document on Google Cloud Storage. - * @param {string} request.name - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1beta3.Processor|Processor} or - * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} - * to use for processing. If a - * {@link protos.google.cloud.documentai.v1beta3.Processor|Processor} is specified, the - * server will use its [default - * version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param {google.cloud.documentai.v1beta3.Document} request.document - * The document payload, the - * {@link protos.google.cloud.documentai.v1beta3.Document.content|content} and - * {@link protos.google.cloud.documentai.v1beta3.Document.mime_type|mime_type} fields must - * be set. - * @param {boolean} request.skipHumanReview - * Whether human review should be skipped for this request. Default to - * `false`. - * @param {google.protobuf.FieldMask} request.fieldMask - * Specifies which fields to include in the - * {@link protos.google.cloud.documentai.v1beta3.ProcessResponse.document|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}`. - * @param {google.cloud.documentai.v1beta3.ProcessOptions} request.processOptions - * Inference-time options for the process API - * @param {number[]} [request.labels] - * 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. - * @param {boolean} [request.imagelessMode] - * Optional. Option to remove images from 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.documentai.v1beta3.ProcessResponse|ProcessResponse}. - * 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/v1beta3/document_processor_service.process_document.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_async - */ - processDocument( - request?: protos.google.cloud.documentai.v1beta3.IProcessRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessResponse, - protos.google.cloud.documentai.v1beta3.IProcessRequest|undefined, {}|undefined - ]>; - processDocument( - request: protos.google.cloud.documentai.v1beta3.IProcessRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessResponse, - protos.google.cloud.documentai.v1beta3.IProcessRequest|null|undefined, - {}|null|undefined>): void; - processDocument( - request: protos.google.cloud.documentai.v1beta3.IProcessRequest, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessResponse, - protos.google.cloud.documentai.v1beta3.IProcessRequest|null|undefined, - {}|null|undefined>): void; - processDocument( - request?: protos.google.cloud.documentai.v1beta3.IProcessRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1beta3.IProcessResponse, - protos.google.cloud.documentai.v1beta3.IProcessRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1beta3.IProcessResponse, - protos.google.cloud.documentai.v1beta3.IProcessRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessResponse, - protos.google.cloud.documentai.v1beta3.IProcessRequest|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('processDocument request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessResponse, - protos.google.cloud.documentai.v1beta3.IProcessRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('processDocument response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.processDocument(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1beta3.IProcessResponse, - protos.google.cloud.documentai.v1beta3.IProcessRequest|undefined, - {}|undefined - ]) => { - this._log.info('processDocument 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; - }); - } -/** - * Fetches processor types. Note that we don't use - * {@link protos.google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes|ListProcessorTypes} - * here, because it isn't paginated. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * @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.documentai.v1beta3.FetchProcessorTypesResponse|FetchProcessorTypesResponse}. - * 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/v1beta3/document_processor_service.fetch_processor_types.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_async - */ - fetchProcessorTypes( - request?: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|undefined, {}|undefined - ]>; - fetchProcessorTypes( - request: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|null|undefined, - {}|null|undefined>): void; - fetchProcessorTypes( - request: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|null|undefined, - {}|null|undefined>): void; - fetchProcessorTypes( - request?: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|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('fetchProcessorTypes request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('fetchProcessorTypes response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.fetchProcessorTypes(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse, - protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesRequest|undefined, - {}|undefined - ]) => { - this._log.info('fetchProcessorTypes 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 processor type detail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor type resource name. - * @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.documentai.v1beta3.ProcessorType|ProcessorType}. - * 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/v1beta3/document_processor_service.get_processor_type.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_GetProcessorType_async - */ - getProcessorType( - request?: protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessorType, - protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|undefined, {}|undefined - ]>; - getProcessorType( - request: protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessorType, - protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|null|undefined, - {}|null|undefined>): void; - getProcessorType( - request: protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessorType, - protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|null|undefined, - {}|null|undefined>): void; - getProcessorType( - request?: protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1beta3.IProcessorType, - protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1beta3.IProcessorType, - protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessorType, - protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|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('getProcessorType request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessorType, - protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getProcessorType response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getProcessorType(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1beta3.IProcessorType, - protos.google.cloud.documentai.v1beta3.IGetProcessorTypeRequest|undefined, - {}|undefined - ]) => { - this._log.info('getProcessorType 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 processor detail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor resource name. - * @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.documentai.v1beta3.Processor|Processor}. - * 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/v1beta3/document_processor_service.get_processor.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_async - */ - getProcessor( - request?: protos.google.cloud.documentai.v1beta3.IGetProcessorRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|undefined, {}|undefined - ]>; - getProcessor( - request: protos.google.cloud.documentai.v1beta3.IGetProcessorRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|null|undefined, - {}|null|undefined>): void; - getProcessor( - request: protos.google.cloud.documentai.v1beta3.IGetProcessorRequest, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|null|undefined, - {}|null|undefined>): void; - getProcessor( - request?: protos.google.cloud.documentai.v1beta3.IGetProcessorRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|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('getProcessor request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getProcessor response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getProcessor(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.IGetProcessorRequest|undefined, - {}|undefined - ]) => { - this._log.info('getProcessor 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 processor version detail. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor resource name. - * @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.documentai.v1beta3.ProcessorVersion|ProcessorVersion}. - * 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/v1beta3/document_processor_service.get_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_async - */ - getProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessorVersion, - protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|undefined, {}|undefined - ]>; - getProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessorVersion, - protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|null|undefined, - {}|null|undefined>): void; - getProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessorVersion, - protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|null|undefined, - {}|null|undefined>): void; - getProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1beta3.IProcessorVersion, - protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1beta3.IProcessorVersion, - protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessorVersion, - protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|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('getProcessorVersion request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessorVersion, - protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getProcessorVersion response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getProcessorVersion(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1beta3.IProcessorVersion, - protos.google.cloud.documentai.v1beta3.IGetProcessorVersionRequest|undefined, - {}|undefined - ]) => { - this._log.info('getProcessorVersion 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; - }); - } -/** - * Creates a processor from the - * {@link protos.google.cloud.documentai.v1beta3.ProcessorType|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. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent (project and location) under which to create the - * processor. Format: `projects/{project}/locations/{location}` - * @param {google.cloud.documentai.v1beta3.Processor} request.processor - * Required. The processor to be created, requires - * {@link protos.google.cloud.documentai.v1beta3.Processor.type|Processor.type} and - * {@link protos.google.cloud.documentai.v1beta3.Processor.display_name|Processor.display_name} - * to be set. Also, the - * {@link protos.google.cloud.documentai.v1beta3.Processor.kms_key_name|Processor.kms_key_name} - * field must be set if the processor is under CMEK. - * @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.documentai.v1beta3.Processor|Processor}. - * 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/v1beta3/document_processor_service.create_processor.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_async - */ - createProcessor( - request?: protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|undefined, {}|undefined - ]>; - createProcessor( - request: protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|null|undefined, - {}|null|undefined>): void; - createProcessor( - request: protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|null|undefined, - {}|null|undefined>): void; - createProcessor( - request?: protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|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('createProcessor request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createProcessor response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createProcessor(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1beta3.IProcessor, - protos.google.cloud.documentai.v1beta3.ICreateProcessorRequest|undefined, - {}|undefined - ]) => { - this._log.info('createProcessor 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; - }); - } -/** - * Retrieves a specific evaluation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1beta3.Evaluation|Evaluation} to get. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` - * @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.documentai.v1beta3.Evaluation|Evaluation}. - * 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/v1beta3/document_processor_service.get_evaluation.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_async - */ - getEvaluation( - request?: protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IEvaluation, - protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|undefined, {}|undefined - ]>; - getEvaluation( - request: protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IEvaluation, - protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|null|undefined, - {}|null|undefined>): void; - getEvaluation( - request: protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IEvaluation, - protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|null|undefined, - {}|null|undefined>): void; - getEvaluation( - request?: protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1beta3.IEvaluation, - protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1beta3.IEvaluation, - protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IEvaluation, - protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|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('getEvaluation request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1beta3.IEvaluation, - protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getEvaluation response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getEvaluation(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1beta3.IEvaluation, - protos.google.cloud.documentai.v1beta3.IGetEvaluationRequest|undefined, - {}|undefined - ]) => { - this._log.info('getEvaluation 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; - }); - } - -/** - * LRO endpoint to batch process many documents. The output is written - * to Cloud Storage as JSON in the [Document] format. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of - * {@link protos.google.cloud.documentai.v1beta3.Processor|Processor} or - * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion}. - * Format: `projects/{project}/locations/{location}/processors/{processor}`, - * or - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param {number[]} request.inputConfigs - * The input config for each single document in the batch process. - * @param {google.cloud.documentai.v1beta3.BatchProcessRequest.BatchOutputConfig} request.outputConfig - * The overall output config for batch process. - * @param {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} request.inputDocuments - * The input documents for the - * {@link protos.google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments} - * method. - * @param {google.cloud.documentai.v1beta3.DocumentOutputConfig} request.documentOutputConfig - * The output configuration for the - * {@link protos.google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments} - * method. - * @param {boolean} request.skipHumanReview - * Whether human review should be skipped for this request. Default to - * `false`. - * @param {google.cloud.documentai.v1beta3.ProcessOptions} request.processOptions - * Inference-time options for the process API - * @param {number[]} [request.labels] - * 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. - * @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/v1beta3/document_processor_service.batch_process_documents.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_async - */ - batchProcessDocuments( - request?: protos.google.cloud.documentai.v1beta3.IBatchProcessRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchProcessDocuments( - request: protos.google.cloud.documentai.v1beta3.IBatchProcessRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchProcessDocuments( - request: protos.google.cloud.documentai.v1beta3.IBatchProcessRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchProcessDocuments( - request?: protos.google.cloud.documentai.v1beta3.IBatchProcessRequest, - 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('batchProcessDocuments response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('batchProcessDocuments request %j', request); - return this.innerApiCalls.batchProcessDocuments(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('batchProcessDocuments response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `batchProcessDocuments()`. - * @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/v1beta3/document_processor_service.batch_process_documents.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_async - */ - async checkBatchProcessDocumentsProgress(name: string): Promise>{ - this._log.info('batchProcessDocuments 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.batchProcessDocuments, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Trains a new processor version. - * Operation metadata is returned as - * {@link protos.google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata|TrainProcessorVersionMetadata}. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.CustomDocumentExtractionOptions} request.customDocumentExtractionOptions - * Options to control Custom Document Extraction (CDE) Processor. - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.FoundationModelTuningOptions} request.foundationModelTuningOptions - * Options to control foundation model tuning of a processor. - * @param {string} request.parent - * Required. The parent (project, location and processor) to create the new - * version for. Format: - * `projects/{project}/locations/{location}/processors/{processor}`. - * @param {google.cloud.documentai.v1beta3.ProcessorVersion} request.processorVersion - * Required. The processor version to be created. - * @param {google.cloud.documentai.v1beta3.DocumentSchema} [request.documentSchema] - * Optional. The schema the processor version will be trained with. - * @param {google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData} [request.inputData] - * Optional. The input data used to train the - * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion}. - * @param {string} [request.baseProcessorVersion] - * 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}`. - * @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/v1beta3/document_processor_service.train_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_async - */ - trainProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - trainProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - trainProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - trainProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.ITrainProcessorVersionRequest, - 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({ - 'parent': request.parent ?? '', - }); - 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('trainProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('trainProcessorVersion request %j', request); - return this.innerApiCalls.trainProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('trainProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `trainProcessorVersion()`. - * @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/v1beta3/document_processor_service.train_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_async - */ - async checkTrainProcessorVersionProgress(name: string): Promise>{ - this._log.info('trainProcessorVersion 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.trainProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes the processor version, all artifacts under the processor version - * will be deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor version resource name to be deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * 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/v1beta3/document_processor_service.delete_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_async - */ - deleteProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.IDeleteProcessorVersionRequest, - 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('deleteProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteProcessorVersion request %j', request); - return this.innerApiCalls.deleteProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteProcessorVersion()`. - * @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/v1beta3/document_processor_service.delete_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_async - */ - async checkDeleteProcessorVersionProgress(name: string): Promise>{ - this._log.info('deleteProcessorVersion 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.deleteProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deploys the processor version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor version resource name to be deployed. - * @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/v1beta3/document_processor_service.deploy_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_async - */ - deployProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deployProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deployProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.IDeployProcessorVersionRequest, - 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('deployProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deployProcessorVersion request %j', request); - return this.innerApiCalls.deployProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deployProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deployProcessorVersion()`. - * @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/v1beta3/document_processor_service.deploy_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_async - */ - async checkDeployProcessorVersionProgress(name: string): Promise>{ - this._log.info('deployProcessorVersion 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.deployProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Undeploys the processor version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor version resource name to be undeployed. - * @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/v1beta3/document_processor_service.undeploy_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_async - */ - undeployProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - undeployProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeployProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.IUndeployProcessorVersionRequest, - 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('undeployProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('undeployProcessorVersion request %j', request); - return this.innerApiCalls.undeployProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('undeployProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `undeployProcessorVersion()`. - * @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/v1beta3/document_processor_service.undeploy_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_async - */ - async checkUndeployProcessorVersionProgress(name: string): Promise>{ - this._log.info('undeployProcessorVersion 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.undeployProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes the processor, unloads all deployed model artifacts if it was - * enabled and then deletes all artifacts associated with this processor. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor resource name to be deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * 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/v1beta3/document_processor_service.delete_processor.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_async - */ - deleteProcessor( - request?: protos.google.cloud.documentai.v1beta3.IDeleteProcessorRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteProcessor( - request: protos.google.cloud.documentai.v1beta3.IDeleteProcessorRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteProcessor( - request: protos.google.cloud.documentai.v1beta3.IDeleteProcessorRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteProcessor( - request?: protos.google.cloud.documentai.v1beta3.IDeleteProcessorRequest, - 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('deleteProcessor response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteProcessor request %j', request); - return this.innerApiCalls.deleteProcessor(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteProcessor response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteProcessor()`. - * @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/v1beta3/document_processor_service.delete_processor.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_async - */ - async checkDeleteProcessorProgress(name: string): Promise>{ - this._log.info('deleteProcessor 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.deleteProcessor, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Enables a processor - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor resource name to be enabled. - * @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/v1beta3/document_processor_service.enable_processor.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_async - */ - enableProcessor( - request?: protos.google.cloud.documentai.v1beta3.IEnableProcessorRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - enableProcessor( - request: protos.google.cloud.documentai.v1beta3.IEnableProcessorRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - enableProcessor( - request: protos.google.cloud.documentai.v1beta3.IEnableProcessorRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - enableProcessor( - request?: protos.google.cloud.documentai.v1beta3.IEnableProcessorRequest, - 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('enableProcessor response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('enableProcessor request %j', request); - return this.innerApiCalls.enableProcessor(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('enableProcessor response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `enableProcessor()`. - * @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/v1beta3/document_processor_service.enable_processor.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_async - */ - async checkEnableProcessorProgress(name: string): Promise>{ - this._log.info('enableProcessor 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.enableProcessor, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Disables a processor - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The processor resource name to be disabled. - * @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/v1beta3/document_processor_service.disable_processor.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_async - */ - disableProcessor( - request?: protos.google.cloud.documentai.v1beta3.IDisableProcessorRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - disableProcessor( - request: protos.google.cloud.documentai.v1beta3.IDisableProcessorRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - disableProcessor( - request: protos.google.cloud.documentai.v1beta3.IDisableProcessorRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - disableProcessor( - request?: protos.google.cloud.documentai.v1beta3.IDisableProcessorRequest, - 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('disableProcessor response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('disableProcessor request %j', request); - return this.innerApiCalls.disableProcessor(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('disableProcessor response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `disableProcessor()`. - * @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/v1beta3/document_processor_service.disable_processor.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_async - */ - async checkDisableProcessorProgress(name: string): Promise>{ - this._log.info('disableProcessor 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.disableProcessor, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Set the default (active) version of a - * {@link protos.google.cloud.documentai.v1beta3.Processor|Processor} that will be used in - * {@link protos.google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument|ProcessDocument} - * and - * {@link protos.google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments|BatchProcessDocuments}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.processor - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1beta3.Processor|Processor} to change default - * version. - * @param {string} request.defaultProcessorVersion - * Required. The resource name of child - * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to use - * as default. Format: - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}` - * @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/v1beta3/document_processor_service.set_default_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_async - */ - setDefaultProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - setDefaultProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - setDefaultProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - setDefaultProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.ISetDefaultProcessorVersionRequest, - 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({ - 'processor': request.processor ?? '', - }); - 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('setDefaultProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('setDefaultProcessorVersion request %j', request); - return this.innerApiCalls.setDefaultProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('setDefaultProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `setDefaultProcessorVersion()`. - * @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/v1beta3/document_processor_service.set_default_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_async - */ - async checkSetDefaultProcessorVersionProgress(name: string): Promise>{ - this._log.info('setDefaultProcessorVersion 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.setDefaultProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Send a document for Human Review. The input document should be processed by - * the specified processor. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.documentai.v1beta3.Document} request.inlineDocument - * An inline document proto. - * @param {string} request.humanReviewConfig - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1beta3.HumanReviewConfig|HumanReviewConfig} that - * the document will be reviewed with. - * @param {google.cloud.documentai.v1beta3.Document} request.document - * The document that needs human review. - * @param {boolean} request.enableSchemaValidation - * Whether the validation should be performed on the ad-hoc review request. - * @param {google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority} request.priority - * The priority of the human review task. - * @param {google.cloud.documentai.v1beta3.DocumentSchema} request.documentSchema - * The document schema of the human review task. - * @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/v1beta3/document_processor_service.review_document.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_async - * @deprecated ReviewDocument is deprecated and may be removed in a future version. - */ - reviewDocument( - request?: protos.google.cloud.documentai.v1beta3.IReviewDocumentRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - reviewDocument( - request: protos.google.cloud.documentai.v1beta3.IReviewDocumentRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - reviewDocument( - request: protos.google.cloud.documentai.v1beta3.IReviewDocumentRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - reviewDocument( - request?: protos.google.cloud.documentai.v1beta3.IReviewDocumentRequest, - 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({ - 'human_review_config': request.humanReviewConfig ?? '', - }); - this.initialize().catch(err => {throw err}); - this.warn('DEP$DocumentProcessorService-$ReviewDocument','ReviewDocument is deprecated and may be removed in a future version.', 'DeprecationWarning'); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('reviewDocument response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('reviewDocument request %j', request); - return this.innerApiCalls.reviewDocument(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('reviewDocument response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `reviewDocument()`. - * @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/v1beta3/document_processor_service.review_document.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_async - * @deprecated ReviewDocument is deprecated and may be removed in a future version. - */ - async checkReviewDocumentProgress(name: string): Promise>{ - this.warn('DEP$DocumentProcessorService-$checkReviewDocumentProgress','checkReviewDocumentProgress is deprecated and may be removed in a future version.', 'DeprecationWarning'); - this._log.info('reviewDocument 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.reviewDocument, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Evaluates a ProcessorVersion against annotated documents, producing an - * Evaluation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.processorVersion - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to - * evaluate. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param {google.cloud.documentai.v1beta3.BatchDocumentsInputConfig} [request.evaluationDocuments] - * Optional. The documents used in the evaluation. If unspecified, use the - * processor's dataset as evaluation input. - * @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/v1beta3/document_processor_service.evaluate_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_async - */ - evaluateProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - evaluateProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - evaluateProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - evaluateProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.IEvaluateProcessorVersionRequest, - 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({ - 'processor_version': request.processorVersion ?? '', - }); - 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('evaluateProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('evaluateProcessorVersion request %j', request); - return this.innerApiCalls.evaluateProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('evaluateProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `evaluateProcessorVersion()`. - * @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/v1beta3/document_processor_service.evaluate_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_async - */ - async checkEvaluateProcessorVersionProgress(name: string): Promise>{ - this._log.info('evaluateProcessorVersion 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.evaluateProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Imports a processor version from source processor version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.processorVersionSource - * The source processor version to import from. The source processor version - * and destination processor need to be in the same environment and region. - * @param {google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.ExternalProcessorVersionSource} request.externalProcessorVersionSource - * The source processor version to import from. It can be from a different - * environment and region than the destination processor. - * @param {string} request.parent - * Required. The destination processor name to create the processor version - * in. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * @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/v1beta3/document_processor_service.import_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_async - */ - importProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - importProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importProcessorVersion( - request: protos.google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importProcessorVersion( - request?: protos.google.cloud.documentai.v1beta3.IImportProcessorVersionRequest, - 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({ - 'parent': request.parent ?? '', - }); - 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('importProcessorVersion response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('importProcessorVersion request %j', request); - return this.innerApiCalls.importProcessorVersion(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('importProcessorVersion response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `importProcessorVersion()`. - * @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/v1beta3/document_processor_service.import_processor_version.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ImportProcessorVersion_async - */ - async checkImportProcessorVersionProgress(name: string): Promise>{ - this._log.info('importProcessorVersion 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.importProcessorVersion, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists the processor types that exist. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * Used to retrieve the next page of results, empty if at the end of the list. - * @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.documentai.v1beta3.ProcessorType|ProcessorType}. - * 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 `listProcessorTypesAsync()` - * 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. - */ - listProcessorTypes( - request?: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessorType[], - protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest|null, - protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse - ]>; - listProcessorTypes( - request: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessorType>): void; - listProcessorTypes( - request: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, - callback: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessorType>): void; - listProcessorTypes( - request?: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessorType>, - callback?: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessorType>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessorType[], - protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest|null, - protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse - ]>|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.documentai.v1beta3.IListProcessorTypesRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessorType>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listProcessorTypes values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listProcessorTypes request %j', request); - return this.innerApiCalls - .listProcessorTypes(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.documentai.v1beta3.IProcessorType[], - protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest|null, - protos.google.cloud.documentai.v1beta3.IListProcessorTypesResponse - ]) => { - this._log.info('listProcessorTypes values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listProcessorTypes`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * Used to retrieve the next page of results, empty if at the end of the list. - * @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.documentai.v1beta3.ProcessorType|ProcessorType} 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 `listProcessorTypesAsync()` - * 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. - */ - listProcessorTypesStream( - request?: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, - 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['listProcessorTypes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listProcessorTypes stream %j', request); - return this.descriptors.page.listProcessorTypes.createStream( - this.innerApiCalls.listProcessorTypes as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listProcessorTypes`, 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 location of processor types to list. - * Format: `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * Used to retrieve the next page of results, empty if at the end of the list. - * @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.documentai.v1beta3.ProcessorType|ProcessorType}. 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/v1beta3/document_processor_service.list_processor_types.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_async - */ - listProcessorTypesAsync( - request?: protos.google.cloud.documentai.v1beta3.IListProcessorTypesRequest, - 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['listProcessorTypes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listProcessorTypes iterate %j', request); - return this.descriptors.page.listProcessorTypes.asyncIterate( - this.innerApiCalls['listProcessorTypes'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all processors which belong to this project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * We will return the processors sorted by creation time. The page token - * will point to the next processor. - * @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.documentai.v1beta3.Processor|Processor}. - * 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 `listProcessorsAsync()` - * 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. - */ - listProcessors( - request?: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessor[], - protos.google.cloud.documentai.v1beta3.IListProcessorsRequest|null, - protos.google.cloud.documentai.v1beta3.IListProcessorsResponse - ]>; - listProcessors( - request: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessor>): void; - listProcessors( - request: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, - callback: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessor>): void; - listProcessors( - request?: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessor>, - callback?: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessor>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessor[], - protos.google.cloud.documentai.v1beta3.IListProcessorsRequest|null, - protos.google.cloud.documentai.v1beta3.IListProcessorsResponse - ]>|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.documentai.v1beta3.IListProcessorsRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessor>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listProcessors values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listProcessors request %j', request); - return this.innerApiCalls - .listProcessors(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.documentai.v1beta3.IProcessor[], - protos.google.cloud.documentai.v1beta3.IListProcessorsRequest|null, - protos.google.cloud.documentai.v1beta3.IListProcessorsResponse - ]) => { - this._log.info('listProcessors values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listProcessors`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * We will return the processors sorted by creation time. The page token - * will point to the next processor. - * @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.documentai.v1beta3.Processor|Processor} 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 `listProcessorsAsync()` - * 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. - */ - listProcessorsStream( - request?: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, - 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['listProcessors']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listProcessors stream %j', request); - return this.descriptors.page.listProcessors.createStream( - this.innerApiCalls.listProcessors as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listProcessors`, 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 (project and location) which owns this collection of - * Processors. Format: `projects/{project}/locations/{location}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * We will return the processors sorted by creation time. The page token - * will point to the next processor. - * @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.documentai.v1beta3.Processor|Processor}. 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/v1beta3/document_processor_service.list_processors.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_async - */ - listProcessorsAsync( - request?: protos.google.cloud.documentai.v1beta3.IListProcessorsRequest, - 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['listProcessors']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listProcessors iterate %j', request); - return this.descriptors.page.listProcessors.asyncIterate( - this.innerApiCalls['listProcessors'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all versions of a processor. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * We will return the processor versions sorted by creation time. The page - * token will point to the next processor version. - * @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.documentai.v1beta3.ProcessorVersion|ProcessorVersion}. - * 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 `listProcessorVersionsAsync()` - * 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. - */ - listProcessorVersions( - request?: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessorVersion[], - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest|null, - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse - ]>; - listProcessorVersions( - request: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessorVersion>): void; - listProcessorVersions( - request: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessorVersion>): void; - listProcessorVersions( - request?: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessorVersion>, - callback?: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessorVersion>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IProcessorVersion[], - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest|null, - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse - ]>|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.documentai.v1beta3.IListProcessorVersionsRequest, - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IProcessorVersion>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listProcessorVersions values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listProcessorVersions request %j', request); - return this.innerApiCalls - .listProcessorVersions(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.documentai.v1beta3.IProcessorVersion[], - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest|null, - protos.google.cloud.documentai.v1beta3.IListProcessorVersionsResponse - ]) => { - this._log.info('listProcessorVersions values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listProcessorVersions`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * We will return the processor versions sorted by creation time. The page - * token will point to the next processor version. - * @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.documentai.v1beta3.ProcessorVersion|ProcessorVersion} 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 `listProcessorVersionsAsync()` - * 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. - */ - listProcessorVersionsStream( - request?: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, - 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['listProcessorVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listProcessorVersions stream %j', request); - return this.descriptors.page.listProcessorVersions.createStream( - this.innerApiCalls.listProcessorVersions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listProcessorVersions`, 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 (project, location and processor) to list all - * versions. Format: - * `projects/{project}/locations/{location}/processors/{processor}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * We will return the processor versions sorted by creation time. The page - * token will point to the next processor version. - * @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.documentai.v1beta3.ProcessorVersion|ProcessorVersion}. 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/v1beta3/document_processor_service.list_processor_versions.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_async - */ - listProcessorVersionsAsync( - request?: protos.google.cloud.documentai.v1beta3.IListProcessorVersionsRequest, - 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['listProcessorVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listProcessorVersions iterate %j', request); - return this.descriptors.page.listProcessorVersions.asyncIterate( - this.innerApiCalls['listProcessorVersions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Retrieves a set of evaluations for a given processor version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to - * list evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * A page token, received from a previous `ListEvaluations` call. - * Provide this to retrieve the subsequent page. - * @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.documentai.v1beta3.Evaluation|Evaluation}. - * 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 `listEvaluationsAsync()` - * 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. - */ - listEvaluations( - request?: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IEvaluation[], - protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest|null, - protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse - ]>; - listEvaluations( - request: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, - protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IEvaluation>): void; - listEvaluations( - request: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, - callback: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, - protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IEvaluation>): void; - listEvaluations( - request?: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, - protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IEvaluation>, - callback?: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, - protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IEvaluation>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IEvaluation[], - protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest|null, - protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse - ]>|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.documentai.v1beta3.IListEvaluationsRequest, - protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IEvaluation>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listEvaluations values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listEvaluations request %j', request); - return this.innerApiCalls - .listEvaluations(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.documentai.v1beta3.IEvaluation[], - protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest|null, - protos.google.cloud.documentai.v1beta3.IListEvaluationsResponse - ]) => { - this._log.info('listEvaluations values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listEvaluations`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the - * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to - * list evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * A page token, received from a previous `ListEvaluations` call. - * Provide this to retrieve the subsequent page. - * @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.documentai.v1beta3.Evaluation|Evaluation} 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 `listEvaluationsAsync()` - * 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. - */ - listEvaluationsStream( - request?: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, - 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['listEvaluations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listEvaluations stream %j', request); - return this.descriptors.page.listEvaluations.createStream( - this.innerApiCalls.listEvaluations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listEvaluations`, 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 resource name of the - * {@link protos.google.cloud.documentai.v1beta3.ProcessorVersion|ProcessorVersion} to - * list evaluations for. - * `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` - * @param {number} request.pageSize - * 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`. - * @param {string} request.pageToken - * A page token, received from a previous `ListEvaluations` call. - * Provide this to retrieve the subsequent page. - * @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.documentai.v1beta3.Evaluation|Evaluation}. 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/v1beta3/document_processor_service.list_evaluations.js - * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_async - */ - listEvaluationsAsync( - request?: protos.google.cloud.documentai.v1beta3.IListEvaluationsRequest, - 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['listEvaluations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listEvaluations iterate %j', request); - return this.descriptors.page.listEvaluations.asyncIterate( - this.innerApiCalls['listEvaluations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @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 google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list 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 google.cloud.location.Location | Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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 dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,processor:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - processor: processor, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the processor from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).processor; - } - - /** - * Return a fully-qualified datasetSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @returns {string} Resource name string. - */ - datasetSchemaPath(project:string,location:string,processor:string) { - return this.pathTemplates.datasetSchemaPathTemplate.render({ - project: project, - location: location, - processor: processor, - }); - } - - /** - * Parse the project from DatasetSchema resource. - * - * @param {string} datasetSchemaName - * A fully-qualified path representing DatasetSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetSchemaName(datasetSchemaName: string) { - return this.pathTemplates.datasetSchemaPathTemplate.match(datasetSchemaName).project; - } - - /** - * Parse the location from DatasetSchema resource. - * - * @param {string} datasetSchemaName - * A fully-qualified path representing DatasetSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetSchemaName(datasetSchemaName: string) { - return this.pathTemplates.datasetSchemaPathTemplate.match(datasetSchemaName).location; - } - - /** - * Parse the processor from DatasetSchema resource. - * - * @param {string} datasetSchemaName - * A fully-qualified path representing DatasetSchema resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromDatasetSchemaName(datasetSchemaName: string) { - return this.pathTemplates.datasetSchemaPathTemplate.match(datasetSchemaName).processor; - } - - /** - * Return a fully-qualified evaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @param {string} processor_version - * @param {string} evaluation - * @returns {string} Resource name string. - */ - evaluationPath(project:string,location:string,processor:string,processorVersion:string,evaluation:string) { - return this.pathTemplates.evaluationPathTemplate.render({ - project: project, - location: location, - processor: processor, - processor_version: processorVersion, - evaluation: evaluation, - }); - } - - /** - * Parse the project from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project; - } - - /** - * Parse the location from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location; - } - - /** - * Parse the processor from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).processor; - } - - /** - * Parse the processor_version from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the processor_version. - */ - matchProcessorVersionFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).processor_version; - } - - /** - * Parse the evaluation from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation; - } - - /** - * Return a fully-qualified humanReviewConfig resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @returns {string} Resource name string. - */ - humanReviewConfigPath(project:string,location:string,processor:string) { - return this.pathTemplates.humanReviewConfigPathTemplate.render({ - project: project, - location: location, - processor: processor, - }); - } - - /** - * Parse the project from HumanReviewConfig resource. - * - * @param {string} humanReviewConfigName - * A fully-qualified path representing HumanReviewConfig resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHumanReviewConfigName(humanReviewConfigName: string) { - return this.pathTemplates.humanReviewConfigPathTemplate.match(humanReviewConfigName).project; - } - - /** - * Parse the location from HumanReviewConfig resource. - * - * @param {string} humanReviewConfigName - * A fully-qualified path representing HumanReviewConfig resource. - * @returns {string} A string representing the location. - */ - matchLocationFromHumanReviewConfigName(humanReviewConfigName: string) { - return this.pathTemplates.humanReviewConfigPathTemplate.match(humanReviewConfigName).location; - } - - /** - * Parse the processor from HumanReviewConfig resource. - * - * @param {string} humanReviewConfigName - * A fully-qualified path representing HumanReviewConfig resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromHumanReviewConfigName(humanReviewConfigName: string) { - return this.pathTemplates.humanReviewConfigPathTemplate.match(humanReviewConfigName).processor; - } - - /** - * 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 processor resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @returns {string} Resource name string. - */ - processorPath(project:string,location:string,processor:string) { - return this.pathTemplates.processorPathTemplate.render({ - project: project, - location: location, - processor: processor, - }); - } - - /** - * Parse the project from Processor resource. - * - * @param {string} processorName - * A fully-qualified path representing Processor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProcessorName(processorName: string) { - return this.pathTemplates.processorPathTemplate.match(processorName).project; - } - - /** - * Parse the location from Processor resource. - * - * @param {string} processorName - * A fully-qualified path representing Processor resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProcessorName(processorName: string) { - return this.pathTemplates.processorPathTemplate.match(processorName).location; - } - - /** - * Parse the processor from Processor resource. - * - * @param {string} processorName - * A fully-qualified path representing Processor resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromProcessorName(processorName: string) { - return this.pathTemplates.processorPathTemplate.match(processorName).processor; - } - - /** - * Return a fully-qualified processorType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor_type - * @returns {string} Resource name string. - */ - processorTypePath(project:string,location:string,processorType:string) { - return this.pathTemplates.processorTypePathTemplate.render({ - project: project, - location: location, - processor_type: processorType, - }); - } - - /** - * Parse the project from ProcessorType resource. - * - * @param {string} processorTypeName - * A fully-qualified path representing ProcessorType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProcessorTypeName(processorTypeName: string) { - return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).project; - } - - /** - * Parse the location from ProcessorType resource. - * - * @param {string} processorTypeName - * A fully-qualified path representing ProcessorType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProcessorTypeName(processorTypeName: string) { - return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).location; - } - - /** - * Parse the processor_type from ProcessorType resource. - * - * @param {string} processorTypeName - * A fully-qualified path representing ProcessorType resource. - * @returns {string} A string representing the processor_type. - */ - matchProcessorTypeFromProcessorTypeName(processorTypeName: string) { - return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).processor_type; - } - - /** - * Return a fully-qualified processorVersion resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @param {string} processor_version - * @returns {string} Resource name string. - */ - processorVersionPath(project:string,location:string,processor:string,processorVersion:string) { - return this.pathTemplates.processorVersionPathTemplate.render({ - project: project, - location: location, - processor: processor, - processor_version: processorVersion, - }); - } - - /** - * Parse the project from ProcessorVersion resource. - * - * @param {string} processorVersionName - * A fully-qualified path representing ProcessorVersion resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProcessorVersionName(processorVersionName: string) { - return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).project; - } - - /** - * Parse the location from ProcessorVersion resource. - * - * @param {string} processorVersionName - * A fully-qualified path representing ProcessorVersion resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProcessorVersionName(processorVersionName: string) { - return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).location; - } - - /** - * Parse the processor from ProcessorVersion resource. - * - * @param {string} processorVersionName - * A fully-qualified path representing ProcessorVersion resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromProcessorVersionName(processorVersionName: string) { - return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).processor; - } - - /** - * Parse the processor_version from ProcessorVersion resource. - * - * @param {string} processorVersionName - * A fully-qualified path representing ProcessorVersion resource. - * @returns {string} A string representing the processor_version. - */ - matchProcessorVersionFromProcessorVersionName(processorVersionName: string) { - return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).processor_version; - } - - /** - * Return a fully-qualified project resource name string. - * - * @param {string} project - * @returns {string} Resource name string. - */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ - project: project, - }); - } - - /** - * Parse the project from Project resource. - * - * @param {string} projectName - * A fully-qualified path representing Project resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; - } - - /** - * 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.documentProcessorServiceStub && !this._terminated) { - return this.documentProcessorServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client_config.json b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client_config.json deleted file mode 100644 index 04847ad3c4f..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_client_config.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "interfaces": { - "google.cloud.documentai.v1beta3.DocumentProcessorService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "deadline_exceeded_resource_exhausted_unavailable": [ - "DEADLINE_EXCEEDED", - "RESOURCE_EXHAUSTED", - "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 - }, - "cf44f94e283152b741c30fbc9df4a6abb71aa468": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 9, - "max_retry_delay_millis": 90000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "c85d7af2fd532496a9c7916f9bf84795125b2bf2": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.5, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ProcessDocument": { - "timeout_millis": 300000, - "retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", - "retry_params_name": "cf44f94e283152b741c30fbc9df4a6abb71aa468" - }, - "BatchProcessDocuments": { - "timeout_millis": 120000, - "retry_codes_name": "idempotent", - "retry_params_name": "c85d7af2fd532496a9c7916f9bf84795125b2bf2" - }, - "FetchProcessorTypes": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListProcessorTypes": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetProcessorType": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListProcessors": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetProcessor": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TrainProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListProcessorVersions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeployProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UndeployProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateProcessor": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteProcessor": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "EnableProcessor": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DisableProcessor": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SetDefaultProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ReviewDocument": { - "timeout_millis": 120000, - "retry_codes_name": "idempotent", - "retry_params_name": "c85d7af2fd532496a9c7916f9bf84795125b2bf2" - }, - "EvaluateProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetEvaluation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListEvaluations": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportProcessorVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_proto_list.json b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_proto_list.json deleted file mode 100644 index db4c908da7b..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_processor_service_proto_list.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - "../../protos/google/cloud/documentai/v1beta3/barcode.proto", - "../../protos/google/cloud/documentai/v1beta3/dataset.proto", - "../../protos/google/cloud/documentai/v1beta3/document.proto", - "../../protos/google/cloud/documentai/v1beta3/document_io.proto", - "../../protos/google/cloud/documentai/v1beta3/document_processor_service.proto", - "../../protos/google/cloud/documentai/v1beta3/document_schema.proto", - "../../protos/google/cloud/documentai/v1beta3/document_service.proto", - "../../protos/google/cloud/documentai/v1beta3/evaluation.proto", - "../../protos/google/cloud/documentai/v1beta3/geometry.proto", - "../../protos/google/cloud/documentai/v1beta3/operation_metadata.proto", - "../../protos/google/cloud/documentai/v1beta3/processor.proto", - "../../protos/google/cloud/documentai/v1beta3/processor_type.proto" -] diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client.ts b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client.ts deleted file mode 100644 index 514109c7b44..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client.ts +++ /dev/null @@ -1,2032 +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, PaginationCallback, GaxCall, LocationsClient, LocationProtos} 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/v1beta3/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; - -/** - * Service to call Cloud DocumentAI to manage document collection (dataset). - * @class - * @memberof v1beta3 - */ -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('documentai'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - 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 = 'documentai.' + 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; - } - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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 = { - datasetPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}/dataset' - ), - datasetSchemaPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema' - ), - evaluationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}' - ), - processorPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}' - ), - processorTypePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processorTypes/{processor_type}' - ), - processorVersionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}' - ), - }; - - // 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 = { - listDocuments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'documentMetadata') - }; - - 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.cloud.location.Locations.GetLocation',get: '/v1beta3/{name=projects/*/locations/*}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1beta3/{name=projects/*}/locations',additional_bindings: [{get: '/uiv1beta3/{name=projects/*}/locations',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1beta3/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/uiv1beta3/{name=projects/*/locations/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1beta3/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1beta3/{name=projects/*/locations/*/operations}',additional_bindings: [{get: '/uiv1beta3/{name=projects/*/locations/*/operations}',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const updateDatasetResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.Dataset') as gax.protobuf.Type; - const updateDatasetMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.UpdateDatasetOperationMetadata') as gax.protobuf.Type; - const importDocumentsResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.ImportDocumentsResponse') as gax.protobuf.Type; - const importDocumentsMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.ImportDocumentsMetadata') as gax.protobuf.Type; - const batchDeleteDocumentsResponse = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.BatchDeleteDocumentsResponse') as gax.protobuf.Type; - const batchDeleteDocumentsMetadata = protoFilesRoot.lookup( - '.google.cloud.documentai.v1beta3.BatchDeleteDocumentsMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - updateDataset: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateDatasetResponse.decode.bind(updateDatasetResponse), - updateDatasetMetadata.decode.bind(updateDatasetMetadata)), - importDocuments: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - importDocumentsResponse.decode.bind(importDocumentsResponse), - importDocumentsMetadata.decode.bind(importDocumentsMetadata)), - batchDeleteDocuments: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - batchDeleteDocumentsResponse.decode.bind(batchDeleteDocumentsResponse), - batchDeleteDocumentsMetadata.decode.bind(batchDeleteDocumentsMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.documentai.v1beta3.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.documentai.v1beta3.DocumentService. - this.documentServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.documentai.v1beta3.DocumentService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.documentai.v1beta3.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 = - ['updateDataset', 'importDocuments', 'getDocument', 'listDocuments', 'batchDeleteDocuments', 'getDatasetSchema', 'updateDatasetSchema']; - 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] || - this.descriptors.longrunning[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 'documentai.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 'documentai.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 -- - // ------------------- -/** - * Returns relevant fields present in the requested document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.dataset - * Required. The resource name of the dataset that the document belongs to . - * Format: - * projects/{project}/locations/{location}/processors/{processor}/dataset - * @param {google.cloud.documentai.v1beta3.DocumentId} request.documentId - * Required. Document identifier. - * @param {google.protobuf.FieldMask} request.readMask - * If set, only fields listed here will be returned. Otherwise, all fields - * will be returned by default. - * @param {google.cloud.documentai.v1beta3.DocumentPageRange} request.pageRange - * List of pages for which the fields specified in the `read_mask` must - * be served. - * @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.documentai.v1beta3.GetDocumentResponse|GetDocumentResponse}. - * 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/v1beta3/document_service.get_document.js - * region_tag:documentai_v1beta3_generated_DocumentService_GetDocument_async - */ - getDocument( - request?: protos.google.cloud.documentai.v1beta3.IGetDocumentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, - protos.google.cloud.documentai.v1beta3.IGetDocumentRequest|undefined, {}|undefined - ]>; - getDocument( - request: protos.google.cloud.documentai.v1beta3.IGetDocumentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, - protos.google.cloud.documentai.v1beta3.IGetDocumentRequest|null|undefined, - {}|null|undefined>): void; - getDocument( - request: protos.google.cloud.documentai.v1beta3.IGetDocumentRequest, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, - protos.google.cloud.documentai.v1beta3.IGetDocumentRequest|null|undefined, - {}|null|undefined>): void; - getDocument( - request?: protos.google.cloud.documentai.v1beta3.IGetDocumentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, - protos.google.cloud.documentai.v1beta3.IGetDocumentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, - protos.google.cloud.documentai.v1beta3.IGetDocumentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, - protos.google.cloud.documentai.v1beta3.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({ - 'dataset': request.dataset ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getDocument request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1beta3.IGetDocumentResponse, - protos.google.cloud.documentai.v1beta3.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.documentai.v1beta3.IGetDocumentResponse, - protos.google.cloud.documentai.v1beta3.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; - }); - } -/** - * Gets the `DatasetSchema` of a `Dataset`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The dataset schema resource name. - * Format: - * projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema - * @param {boolean} request.visibleFieldsOnly - * If set, only returns the visible fields of the schema. - * @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.documentai.v1beta3.DatasetSchema|DatasetSchema}. - * 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/v1beta3/document_service.get_dataset_schema.js - * region_tag:documentai_v1beta3_generated_DocumentService_GetDatasetSchema_async - */ - getDatasetSchema( - request?: protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|undefined, {}|undefined - ]>; - getDatasetSchema( - request: protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|null|undefined, - {}|null|undefined>): void; - getDatasetSchema( - request: protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|null|undefined, - {}|null|undefined>): void; - getDatasetSchema( - request?: protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|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('getDatasetSchema request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getDatasetSchema response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getDatasetSchema(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IGetDatasetSchemaRequest|undefined, - {}|undefined - ]) => { - this._log.info('getDatasetSchema 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 `DatasetSchema`. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.documentai.v1beta3.DatasetSchema} request.datasetSchema - * Required. The name field of the `DatasetSchema` is used to identify the - * resource to be updated. - * @param {google.protobuf.FieldMask} request.updateMask - * The update mask applies to the resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.documentai.v1beta3.DatasetSchema|DatasetSchema}. - * 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/v1beta3/document_service.update_dataset_schema.js - * region_tag:documentai_v1beta3_generated_DocumentService_UpdateDatasetSchema_async - */ - updateDatasetSchema( - request?: protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|undefined, {}|undefined - ]>; - updateDatasetSchema( - request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|null|undefined, - {}|null|undefined>): void; - updateDatasetSchema( - request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, - callback: Callback< - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|null|undefined, - {}|null|undefined>): void; - updateDatasetSchema( - request?: protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|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({ - 'dataset_schema.name': request.datasetSchema!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateDatasetSchema request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateDatasetSchema response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateDatasetSchema(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.documentai.v1beta3.IDatasetSchema, - protos.google.cloud.documentai.v1beta3.IUpdateDatasetSchemaRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateDatasetSchema 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 metadata associated with a dataset. - * Note that this method requires the - * `documentai.googleapis.com/datasets.update` 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. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.documentai.v1beta3.Dataset} request.dataset - * Required. The `name` field of the `Dataset` is used to identify the - * resource to be updated. - * @param {google.protobuf.FieldMask} request.updateMask - * The update mask applies to the resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * 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/v1beta3/document_service.update_dataset.js - * region_tag:documentai_v1beta3_generated_DocumentService_UpdateDataset_async - */ - updateDataset( - request?: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateDataset( - request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateDataset( - request: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateDataset( - request?: protos.google.cloud.documentai.v1beta3.IUpdateDatasetRequest, - 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({ - 'dataset.name': request.dataset!.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('updateDataset response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateDataset request %j', request); - return this.innerApiCalls.updateDataset(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateDataset response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateDataset()`. - * @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/v1beta3/document_service.update_dataset.js - * region_tag:documentai_v1beta3_generated_DocumentService_UpdateDataset_async - */ - async checkUpdateDatasetProgress(name: string): Promise>{ - this._log.info('updateDataset 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.updateDataset, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Import documents into a dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.dataset - * Required. The dataset resource name. - * Format: - * projects/{project}/locations/{location}/processors/{processor}/dataset - * @param {number[]} request.batchDocumentsImportConfigs - * Required. The Cloud Storage uri containing raw documents that must be - * imported. - * @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/v1beta3/document_service.import_documents.js - * region_tag:documentai_v1beta3_generated_DocumentService_ImportDocuments_async - */ - importDocuments( - request?: protos.google.cloud.documentai.v1beta3.IImportDocumentsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - importDocuments( - request: protos.google.cloud.documentai.v1beta3.IImportDocumentsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importDocuments( - request: protos.google.cloud.documentai.v1beta3.IImportDocumentsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - importDocuments( - request?: protos.google.cloud.documentai.v1beta3.IImportDocumentsRequest, - 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({ - 'dataset': request.dataset ?? '', - }); - 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('importDocuments response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('importDocuments request %j', request); - return this.innerApiCalls.importDocuments(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('importDocuments response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `importDocuments()`. - * @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/v1beta3/document_service.import_documents.js - * region_tag:documentai_v1beta3_generated_DocumentService_ImportDocuments_async - */ - async checkImportDocumentsProgress(name: string): Promise>{ - this._log.info('importDocuments 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.importDocuments, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a set of documents. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.dataset - * Required. The dataset resource name. - * Format: - * projects/{project}/locations/{location}/processors/{processor}/dataset - * @param {google.cloud.documentai.v1beta3.BatchDatasetDocuments} request.datasetDocuments - * Required. Dataset documents input. If given `filter`, all documents - * satisfying the filter will be deleted. If given documentIds, a maximum of - * 50 documents can be deleted in a batch. The request will be rejected if - * more than 50 document_ids are provided. - * @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/v1beta3/document_service.batch_delete_documents.js - * region_tag:documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_async - */ - batchDeleteDocuments( - request?: protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - batchDeleteDocuments( - request: protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchDeleteDocuments( - request: protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - batchDeleteDocuments( - request?: protos.google.cloud.documentai.v1beta3.IBatchDeleteDocumentsRequest, - 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({ - 'dataset': request.dataset ?? '', - }); - 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('batchDeleteDocuments response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('batchDeleteDocuments request %j', request); - return this.innerApiCalls.batchDeleteDocuments(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('batchDeleteDocuments response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `batchDeleteDocuments()`. - * @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/v1beta3/document_service.batch_delete_documents.js - * region_tag:documentai_v1beta3_generated_DocumentService_BatchDeleteDocuments_async - */ - async checkBatchDeleteDocumentsProgress(name: string): Promise>{ - this._log.info('batchDeleteDocuments 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.batchDeleteDocuments, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Returns a list of documents present in the dataset. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.dataset - * Required. The resource name of the dataset to be listed. - * Format: - * projects/{project}/locations/{location}/processors/{processor}/dataset - * @param {number} request.pageSize - * The maximum number of documents to return. The service may return - * fewer than this value. - * If unspecified, at most 20 documents will be returned. - * The maximum value is 100; values above 100 will be coerced to 100. - * @param {string} request.pageToken - * A page token, received from a previous `ListDocuments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDocuments` - * must match the call that provided the page token. - * @param {string} [request.filter] - * Optional. Query to filter the documents based on - * https://google.aip.dev/160. - * ## Currently support query strings are: - * - * `SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED` - * - `LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED` - * - `DisplayName=\"file_name.pdf\"` - * - `EntityType=abc/def` - * - `TagName=\"auto-labeling-running\"|\"sampled\"` - * - * Note: - * - Only `AND`, `=` and `!=` are supported. - * e.g. `DisplayName=file_name AND EntityType!=abc` IS supported. - * - Wildcard `*` is supported only in `DisplayName` filter - * - No duplicate filter keys are allowed, - * e.g. `EntityType=a AND EntityType=b` is NOT supported. - * - String match is case sensitive (for filter `DisplayName` & `EntityType`). - * @param {boolean} [request.returnTotalSize] - * Optional. Controls if the request requires a total size of matched - * documents. See - * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.total_size|ListDocumentsResponse.total_size}. - * - * Enabling this flag may adversely impact performance. - * - * Defaults to false. - * @param {number} [request.skip] - * Optional. Number of results to skip beginning from the `page_token` if - * provided. https://google.aip.dev/158#skipping-results. It must be a - * non-negative integer. Negative values will be rejected. Note that this is - * not the number of pages to skip. If this value causes the cursor to move - * past the end of results, - * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.document_metadata|ListDocumentsResponse.document_metadata} - * and - * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token} - * will be empty. - * @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.documentai.v1beta3.DocumentMetadata|DocumentMetadata}. - * 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 `listDocumentsAsync()` - * 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. - */ - listDocuments( - request?: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.documentai.v1beta3.IDocumentMetadata[], - protos.google.cloud.documentai.v1beta3.IListDocumentsRequest|null, - protos.google.cloud.documentai.v1beta3.IListDocumentsResponse - ]>; - listDocuments( - request: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, - protos.google.cloud.documentai.v1beta3.IListDocumentsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IDocumentMetadata>): void; - listDocuments( - request: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, - callback: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, - protos.google.cloud.documentai.v1beta3.IListDocumentsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IDocumentMetadata>): void; - listDocuments( - request?: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, - protos.google.cloud.documentai.v1beta3.IListDocumentsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IDocumentMetadata>, - callback?: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, - protos.google.cloud.documentai.v1beta3.IListDocumentsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IDocumentMetadata>): - Promise<[ - protos.google.cloud.documentai.v1beta3.IDocumentMetadata[], - protos.google.cloud.documentai.v1beta3.IListDocumentsRequest|null, - protos.google.cloud.documentai.v1beta3.IListDocumentsResponse - ]>|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({ - 'dataset': request.dataset ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, - protos.google.cloud.documentai.v1beta3.IListDocumentsResponse|null|undefined, - protos.google.cloud.documentai.v1beta3.IDocumentMetadata>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDocuments values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDocuments request %j', request); - return this.innerApiCalls - .listDocuments(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.documentai.v1beta3.IDocumentMetadata[], - protos.google.cloud.documentai.v1beta3.IListDocumentsRequest|null, - protos.google.cloud.documentai.v1beta3.IListDocumentsResponse - ]) => { - this._log.info('listDocuments values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDocuments`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.dataset - * Required. The resource name of the dataset to be listed. - * Format: - * projects/{project}/locations/{location}/processors/{processor}/dataset - * @param {number} request.pageSize - * The maximum number of documents to return. The service may return - * fewer than this value. - * If unspecified, at most 20 documents will be returned. - * The maximum value is 100; values above 100 will be coerced to 100. - * @param {string} request.pageToken - * A page token, received from a previous `ListDocuments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDocuments` - * must match the call that provided the page token. - * @param {string} [request.filter] - * Optional. Query to filter the documents based on - * https://google.aip.dev/160. - * ## Currently support query strings are: - * - * `SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED` - * - `LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED` - * - `DisplayName=\"file_name.pdf\"` - * - `EntityType=abc/def` - * - `TagName=\"auto-labeling-running\"|\"sampled\"` - * - * Note: - * - Only `AND`, `=` and `!=` are supported. - * e.g. `DisplayName=file_name AND EntityType!=abc` IS supported. - * - Wildcard `*` is supported only in `DisplayName` filter - * - No duplicate filter keys are allowed, - * e.g. `EntityType=a AND EntityType=b` is NOT supported. - * - String match is case sensitive (for filter `DisplayName` & `EntityType`). - * @param {boolean} [request.returnTotalSize] - * Optional. Controls if the request requires a total size of matched - * documents. See - * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.total_size|ListDocumentsResponse.total_size}. - * - * Enabling this flag may adversely impact performance. - * - * Defaults to false. - * @param {number} [request.skip] - * Optional. Number of results to skip beginning from the `page_token` if - * provided. https://google.aip.dev/158#skipping-results. It must be a - * non-negative integer. Negative values will be rejected. Note that this is - * not the number of pages to skip. If this value causes the cursor to move - * past the end of results, - * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.document_metadata|ListDocumentsResponse.document_metadata} - * and - * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token} - * will be empty. - * @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.documentai.v1beta3.DocumentMetadata|DocumentMetadata} 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 `listDocumentsAsync()` - * 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. - */ - listDocumentsStream( - request?: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, - 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({ - 'dataset': request.dataset ?? '', - }); - const defaultCallSettings = this._defaults['listDocuments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDocuments stream %j', request); - return this.descriptors.page.listDocuments.createStream( - this.innerApiCalls.listDocuments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDocuments`, 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.dataset - * Required. The resource name of the dataset to be listed. - * Format: - * projects/{project}/locations/{location}/processors/{processor}/dataset - * @param {number} request.pageSize - * The maximum number of documents to return. The service may return - * fewer than this value. - * If unspecified, at most 20 documents will be returned. - * The maximum value is 100; values above 100 will be coerced to 100. - * @param {string} request.pageToken - * A page token, received from a previous `ListDocuments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListDocuments` - * must match the call that provided the page token. - * @param {string} [request.filter] - * Optional. Query to filter the documents based on - * https://google.aip.dev/160. - * ## Currently support query strings are: - * - * `SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED` - * - `LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED` - * - `DisplayName=\"file_name.pdf\"` - * - `EntityType=abc/def` - * - `TagName=\"auto-labeling-running\"|\"sampled\"` - * - * Note: - * - Only `AND`, `=` and `!=` are supported. - * e.g. `DisplayName=file_name AND EntityType!=abc` IS supported. - * - Wildcard `*` is supported only in `DisplayName` filter - * - No duplicate filter keys are allowed, - * e.g. `EntityType=a AND EntityType=b` is NOT supported. - * - String match is case sensitive (for filter `DisplayName` & `EntityType`). - * @param {boolean} [request.returnTotalSize] - * Optional. Controls if the request requires a total size of matched - * documents. See - * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.total_size|ListDocumentsResponse.total_size}. - * - * Enabling this flag may adversely impact performance. - * - * Defaults to false. - * @param {number} [request.skip] - * Optional. Number of results to skip beginning from the `page_token` if - * provided. https://google.aip.dev/158#skipping-results. It must be a - * non-negative integer. Negative values will be rejected. Note that this is - * not the number of pages to skip. If this value causes the cursor to move - * past the end of results, - * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.document_metadata|ListDocumentsResponse.document_metadata} - * and - * {@link protos.google.cloud.documentai.v1beta3.ListDocumentsResponse.next_page_token|ListDocumentsResponse.next_page_token} - * will be empty. - * @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.documentai.v1beta3.DocumentMetadata|DocumentMetadata}. 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/v1beta3/document_service.list_documents.js - * region_tag:documentai_v1beta3_generated_DocumentService_ListDocuments_async - */ - listDocumentsAsync( - request?: protos.google.cloud.documentai.v1beta3.IListDocumentsRequest, - 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({ - 'dataset': request.dataset ?? '', - }); - const defaultCallSettings = this._defaults['listDocuments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDocuments iterate %j', request); - return this.descriptors.page.listDocuments.asyncIterate( - this.innerApiCalls['listDocuments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @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 google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list 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 google.cloud.location.Location | Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * 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 dataset resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @returns {string} Resource name string. - */ - datasetPath(project:string,location:string,processor:string) { - return this.pathTemplates.datasetPathTemplate.render({ - project: project, - location: location, - processor: processor, - }); - } - - /** - * Parse the project from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).project; - } - - /** - * Parse the location from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).location; - } - - /** - * Parse the processor from Dataset resource. - * - * @param {string} datasetName - * A fully-qualified path representing Dataset resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromDatasetName(datasetName: string) { - return this.pathTemplates.datasetPathTemplate.match(datasetName).processor; - } - - /** - * Return a fully-qualified datasetSchema resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @returns {string} Resource name string. - */ - datasetSchemaPath(project:string,location:string,processor:string) { - return this.pathTemplates.datasetSchemaPathTemplate.render({ - project: project, - location: location, - processor: processor, - }); - } - - /** - * Parse the project from DatasetSchema resource. - * - * @param {string} datasetSchemaName - * A fully-qualified path representing DatasetSchema resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDatasetSchemaName(datasetSchemaName: string) { - return this.pathTemplates.datasetSchemaPathTemplate.match(datasetSchemaName).project; - } - - /** - * Parse the location from DatasetSchema resource. - * - * @param {string} datasetSchemaName - * A fully-qualified path representing DatasetSchema resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDatasetSchemaName(datasetSchemaName: string) { - return this.pathTemplates.datasetSchemaPathTemplate.match(datasetSchemaName).location; - } - - /** - * Parse the processor from DatasetSchema resource. - * - * @param {string} datasetSchemaName - * A fully-qualified path representing DatasetSchema resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromDatasetSchemaName(datasetSchemaName: string) { - return this.pathTemplates.datasetSchemaPathTemplate.match(datasetSchemaName).processor; - } - - /** - * Return a fully-qualified evaluation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @param {string} processor_version - * @param {string} evaluation - * @returns {string} Resource name string. - */ - evaluationPath(project:string,location:string,processor:string,processorVersion:string,evaluation:string) { - return this.pathTemplates.evaluationPathTemplate.render({ - project: project, - location: location, - processor: processor, - processor_version: processorVersion, - evaluation: evaluation, - }); - } - - /** - * Parse the project from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).project; - } - - /** - * Parse the location from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).location; - } - - /** - * Parse the processor from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).processor; - } - - /** - * Parse the processor_version from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the processor_version. - */ - matchProcessorVersionFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).processor_version; - } - - /** - * Parse the evaluation from Evaluation resource. - * - * @param {string} evaluationName - * A fully-qualified path representing Evaluation resource. - * @returns {string} A string representing the evaluation. - */ - matchEvaluationFromEvaluationName(evaluationName: string) { - return this.pathTemplates.evaluationPathTemplate.match(evaluationName).evaluation; - } - - /** - * Return a fully-qualified processor resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @returns {string} Resource name string. - */ - processorPath(project:string,location:string,processor:string) { - return this.pathTemplates.processorPathTemplate.render({ - project: project, - location: location, - processor: processor, - }); - } - - /** - * Parse the project from Processor resource. - * - * @param {string} processorName - * A fully-qualified path representing Processor resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProcessorName(processorName: string) { - return this.pathTemplates.processorPathTemplate.match(processorName).project; - } - - /** - * Parse the location from Processor resource. - * - * @param {string} processorName - * A fully-qualified path representing Processor resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProcessorName(processorName: string) { - return this.pathTemplates.processorPathTemplate.match(processorName).location; - } - - /** - * Parse the processor from Processor resource. - * - * @param {string} processorName - * A fully-qualified path representing Processor resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromProcessorName(processorName: string) { - return this.pathTemplates.processorPathTemplate.match(processorName).processor; - } - - /** - * Return a fully-qualified processorType resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor_type - * @returns {string} Resource name string. - */ - processorTypePath(project:string,location:string,processorType:string) { - return this.pathTemplates.processorTypePathTemplate.render({ - project: project, - location: location, - processor_type: processorType, - }); - } - - /** - * Parse the project from ProcessorType resource. - * - * @param {string} processorTypeName - * A fully-qualified path representing ProcessorType resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProcessorTypeName(processorTypeName: string) { - return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).project; - } - - /** - * Parse the location from ProcessorType resource. - * - * @param {string} processorTypeName - * A fully-qualified path representing ProcessorType resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProcessorTypeName(processorTypeName: string) { - return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).location; - } - - /** - * Parse the processor_type from ProcessorType resource. - * - * @param {string} processorTypeName - * A fully-qualified path representing ProcessorType resource. - * @returns {string} A string representing the processor_type. - */ - matchProcessorTypeFromProcessorTypeName(processorTypeName: string) { - return this.pathTemplates.processorTypePathTemplate.match(processorTypeName).processor_type; - } - - /** - * Return a fully-qualified processorVersion resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} processor - * @param {string} processor_version - * @returns {string} Resource name string. - */ - processorVersionPath(project:string,location:string,processor:string,processorVersion:string) { - return this.pathTemplates.processorVersionPathTemplate.render({ - project: project, - location: location, - processor: processor, - processor_version: processorVersion, - }); - } - - /** - * Parse the project from ProcessorVersion resource. - * - * @param {string} processorVersionName - * A fully-qualified path representing ProcessorVersion resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProcessorVersionName(processorVersionName: string) { - return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).project; - } - - /** - * Parse the location from ProcessorVersion resource. - * - * @param {string} processorVersionName - * A fully-qualified path representing ProcessorVersion resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProcessorVersionName(processorVersionName: string) { - return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).location; - } - - /** - * Parse the processor from ProcessorVersion resource. - * - * @param {string} processorVersionName - * A fully-qualified path representing ProcessorVersion resource. - * @returns {string} A string representing the processor. - */ - matchProcessorFromProcessorVersionName(processorVersionName: string) { - return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).processor; - } - - /** - * Parse the processor_version from ProcessorVersion resource. - * - * @param {string} processorVersionName - * A fully-qualified path representing ProcessorVersion resource. - * @returns {string} A string representing the processor_version. - */ - matchProcessorVersionFromProcessorVersionName(processorVersionName: string) { - return this.pathTemplates.processorVersionPathTemplate.match(processorVersionName).processor_version; - } - - /** - * 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(); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client_config.json b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client_config.json deleted file mode 100644 index 1b9c7897100..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_client_config.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "interfaces": { - "google.cloud.documentai.v1beta3.DocumentService": { - "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": { - "UpdateDataset": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportDocuments": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDocument": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDocuments": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "BatchDeleteDocuments": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDatasetSchema": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateDatasetSchema": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_proto_list.json b/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_proto_list.json deleted file mode 100644 index db4c908da7b..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1beta3/document_service_proto_list.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - "../../protos/google/cloud/documentai/v1beta3/barcode.proto", - "../../protos/google/cloud/documentai/v1beta3/dataset.proto", - "../../protos/google/cloud/documentai/v1beta3/document.proto", - "../../protos/google/cloud/documentai/v1beta3/document_io.proto", - "../../protos/google/cloud/documentai/v1beta3/document_processor_service.proto", - "../../protos/google/cloud/documentai/v1beta3/document_schema.proto", - "../../protos/google/cloud/documentai/v1beta3/document_service.proto", - "../../protos/google/cloud/documentai/v1beta3/evaluation.proto", - "../../protos/google/cloud/documentai/v1beta3/geometry.proto", - "../../protos/google/cloud/documentai/v1beta3/operation_metadata.proto", - "../../protos/google/cloud/documentai/v1beta3/processor.proto", - "../../protos/google/cloud/documentai/v1beta3/processor_type.proto" -] diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/gapic_metadata.json b/owl-bot-staging/google-cloud-documentai/src/v1beta3/gapic_metadata.json deleted file mode 100644 index 263a76d30e4..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1beta3/gapic_metadata.json +++ /dev/null @@ -1,357 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.documentai.v1beta3", - "libraryPackage": "@google-cloud/documentai", - "services": { - "DocumentProcessorService": { - "clients": { - "grpc": { - "libraryClient": "DocumentProcessorServiceClient", - "rpcs": { - "ProcessDocument": { - "methods": [ - "processDocument" - ] - }, - "FetchProcessorTypes": { - "methods": [ - "fetchProcessorTypes" - ] - }, - "GetProcessorType": { - "methods": [ - "getProcessorType" - ] - }, - "GetProcessor": { - "methods": [ - "getProcessor" - ] - }, - "GetProcessorVersion": { - "methods": [ - "getProcessorVersion" - ] - }, - "CreateProcessor": { - "methods": [ - "createProcessor" - ] - }, - "GetEvaluation": { - "methods": [ - "getEvaluation" - ] - }, - "BatchProcessDocuments": { - "methods": [ - "batchProcessDocuments" - ] - }, - "TrainProcessorVersion": { - "methods": [ - "trainProcessorVersion" - ] - }, - "DeleteProcessorVersion": { - "methods": [ - "deleteProcessorVersion" - ] - }, - "DeployProcessorVersion": { - "methods": [ - "deployProcessorVersion" - ] - }, - "UndeployProcessorVersion": { - "methods": [ - "undeployProcessorVersion" - ] - }, - "DeleteProcessor": { - "methods": [ - "deleteProcessor" - ] - }, - "EnableProcessor": { - "methods": [ - "enableProcessor" - ] - }, - "DisableProcessor": { - "methods": [ - "disableProcessor" - ] - }, - "SetDefaultProcessorVersion": { - "methods": [ - "setDefaultProcessorVersion" - ] - }, - "ReviewDocument": { - "methods": [ - "reviewDocument" - ] - }, - "EvaluateProcessorVersion": { - "methods": [ - "evaluateProcessorVersion" - ] - }, - "ImportProcessorVersion": { - "methods": [ - "importProcessorVersion" - ] - }, - "ListProcessorTypes": { - "methods": [ - "listProcessorTypes", - "listProcessorTypesStream", - "listProcessorTypesAsync" - ] - }, - "ListProcessors": { - "methods": [ - "listProcessors", - "listProcessorsStream", - "listProcessorsAsync" - ] - }, - "ListProcessorVersions": { - "methods": [ - "listProcessorVersions", - "listProcessorVersionsStream", - "listProcessorVersionsAsync" - ] - }, - "ListEvaluations": { - "methods": [ - "listEvaluations", - "listEvaluationsStream", - "listEvaluationsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DocumentProcessorServiceClient", - "rpcs": { - "ProcessDocument": { - "methods": [ - "processDocument" - ] - }, - "FetchProcessorTypes": { - "methods": [ - "fetchProcessorTypes" - ] - }, - "GetProcessorType": { - "methods": [ - "getProcessorType" - ] - }, - "GetProcessor": { - "methods": [ - "getProcessor" - ] - }, - "GetProcessorVersion": { - "methods": [ - "getProcessorVersion" - ] - }, - "CreateProcessor": { - "methods": [ - "createProcessor" - ] - }, - "GetEvaluation": { - "methods": [ - "getEvaluation" - ] - }, - "BatchProcessDocuments": { - "methods": [ - "batchProcessDocuments" - ] - }, - "TrainProcessorVersion": { - "methods": [ - "trainProcessorVersion" - ] - }, - "DeleteProcessorVersion": { - "methods": [ - "deleteProcessorVersion" - ] - }, - "DeployProcessorVersion": { - "methods": [ - "deployProcessorVersion" - ] - }, - "UndeployProcessorVersion": { - "methods": [ - "undeployProcessorVersion" - ] - }, - "DeleteProcessor": { - "methods": [ - "deleteProcessor" - ] - }, - "EnableProcessor": { - "methods": [ - "enableProcessor" - ] - }, - "DisableProcessor": { - "methods": [ - "disableProcessor" - ] - }, - "SetDefaultProcessorVersion": { - "methods": [ - "setDefaultProcessorVersion" - ] - }, - "ReviewDocument": { - "methods": [ - "reviewDocument" - ] - }, - "EvaluateProcessorVersion": { - "methods": [ - "evaluateProcessorVersion" - ] - }, - "ImportProcessorVersion": { - "methods": [ - "importProcessorVersion" - ] - }, - "ListProcessorTypes": { - "methods": [ - "listProcessorTypes", - "listProcessorTypesStream", - "listProcessorTypesAsync" - ] - }, - "ListProcessors": { - "methods": [ - "listProcessors", - "listProcessorsStream", - "listProcessorsAsync" - ] - }, - "ListProcessorVersions": { - "methods": [ - "listProcessorVersions", - "listProcessorVersionsStream", - "listProcessorVersionsAsync" - ] - }, - "ListEvaluations": { - "methods": [ - "listEvaluations", - "listEvaluationsStream", - "listEvaluationsAsync" - ] - } - } - } - } - }, - "DocumentService": { - "clients": { - "grpc": { - "libraryClient": "DocumentServiceClient", - "rpcs": { - "GetDocument": { - "methods": [ - "getDocument" - ] - }, - "GetDatasetSchema": { - "methods": [ - "getDatasetSchema" - ] - }, - "UpdateDatasetSchema": { - "methods": [ - "updateDatasetSchema" - ] - }, - "UpdateDataset": { - "methods": [ - "updateDataset" - ] - }, - "ImportDocuments": { - "methods": [ - "importDocuments" - ] - }, - "BatchDeleteDocuments": { - "methods": [ - "batchDeleteDocuments" - ] - }, - "ListDocuments": { - "methods": [ - "listDocuments", - "listDocumentsStream", - "listDocumentsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DocumentServiceClient", - "rpcs": { - "GetDocument": { - "methods": [ - "getDocument" - ] - }, - "GetDatasetSchema": { - "methods": [ - "getDatasetSchema" - ] - }, - "UpdateDatasetSchema": { - "methods": [ - "updateDatasetSchema" - ] - }, - "UpdateDataset": { - "methods": [ - "updateDataset" - ] - }, - "ImportDocuments": { - "methods": [ - "importDocuments" - ] - }, - "BatchDeleteDocuments": { - "methods": [ - "batchDeleteDocuments" - ] - }, - "ListDocuments": { - "methods": [ - "listDocuments", - "listDocumentsStream", - "listDocumentsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-documentai/src/v1beta3/index.ts b/owl-bot-staging/google-cloud-documentai/src/v1beta3/index.ts deleted file mode 100644 index ad757a8edc3..00000000000 --- a/owl-bot-staging/google-cloud-documentai/src/v1beta3/index.ts +++ /dev/null @@ -1,20 +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 {DocumentProcessorServiceClient} from './document_processor_service_client'; -export {DocumentServiceClient} from './document_service_client'; diff --git a/owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.js deleted file mode 100644 index a3b5aa4a874..00000000000 --- a/owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +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 documentai = require('@google-cloud/documentai'); - -function main() { - const documentProcessorServiceClient = new documentai.DocumentProcessorServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 5e87e3e26b4..00000000000 --- a/owl-bot-staging/google-cloud-documentai/system-test/fixtures/sample/src/index.ts +++ /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. ** - -import {DocumentProcessorServiceClient} from '@google-cloud/documentai'; - -// check that the client class type name can be used -function doStuffWithDocumentProcessorServiceClient(client: DocumentProcessorServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const documentProcessorServiceClient = new DocumentProcessorServiceClient(); - doStuffWithDocumentProcessorServiceClient(documentProcessorServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-documentai/system-test/install.ts b/owl-bot-staging/google-cloud-documentai/system-test/install.ts deleted file mode 100644 index 394f3362d20..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/test/gapic_document_processor_service_v1.ts b/owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1.ts deleted file mode 100644 index e6e8ff1f9ba..00000000000 --- a/owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1.ts +++ /dev/null @@ -1,4453 +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 documentprocessorserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, LocationProtos} 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 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 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.DocumentProcessorServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'documentai.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient(); - 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 = documentprocessorserviceModule.v1.DocumentProcessorServiceClient.servicePath; - assert.strictEqual(servicePath, 'documentai.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = documentprocessorserviceModule.v1.DocumentProcessorServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'documentai.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'documentai.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'documentai.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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'documentai.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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'documentai.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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = documentprocessorserviceModule.v1.DocumentProcessorServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.documentProcessorServiceStub, undefined); - await client.initialize(); - assert(client.documentProcessorServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.documentProcessorServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.documentProcessorServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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('processDocument', () => { - it('invokes processDocument without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.ProcessResponse() - ); - client.innerApiCalls.processDocument = stubSimpleCall(expectedResponse); - const [response] = await client.processDocument(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.processDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.processDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes processDocument without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.ProcessResponse() - ); - client.innerApiCalls.processDocument = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.processDocument( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.processDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.processDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes processDocument with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.processDocument = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.processDocument(request), expectedError); - const actualRequest = (client.innerApiCalls.processDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.processDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes processDocument with closed client', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ProcessRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.processDocument(request), expectedError); - }); - }); - - describe('fetchProcessorTypes', () => { - it('invokes fetchProcessorTypes without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.FetchProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.FetchProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.FetchProcessorTypesResponse() - ); - client.innerApiCalls.fetchProcessorTypes = stubSimpleCall(expectedResponse); - const [response] = await client.fetchProcessorTypes(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchProcessorTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchProcessorTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchProcessorTypes without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.FetchProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.FetchProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.FetchProcessorTypesResponse() - ); - client.innerApiCalls.fetchProcessorTypes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchProcessorTypes( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1.IFetchProcessorTypesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchProcessorTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchProcessorTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchProcessorTypes with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.FetchProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.FetchProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchProcessorTypes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchProcessorTypes(request), expectedError); - const actualRequest = (client.innerApiCalls.fetchProcessorTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchProcessorTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchProcessorTypes with closed client', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.FetchProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.FetchProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.fetchProcessorTypes(request), expectedError); - }); - }); - - describe('getProcessorType', () => { - it('invokes getProcessorType without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetProcessorTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.ProcessorType() - ); - client.innerApiCalls.getProcessorType = stubSimpleCall(expectedResponse); - const [response] = await client.getProcessorType(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProcessorType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessorType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessorType without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetProcessorTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.ProcessorType() - ); - client.innerApiCalls.getProcessorType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getProcessorType( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessorType|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProcessorType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessorType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessorType with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetProcessorTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getProcessorType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getProcessorType(request), expectedError); - const actualRequest = (client.innerApiCalls.getProcessorType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessorType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessorType with closed client', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetProcessorTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorTypeRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getProcessorType(request), expectedError); - }); - }); - - describe('getProcessor', () => { - it('invokes getProcessor without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.Processor() - ); - client.innerApiCalls.getProcessor = stubSimpleCall(expectedResponse); - const [response] = await client.getProcessor(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessor without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.Processor() - ); - client.innerApiCalls.getProcessor = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getProcessor( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessor|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessor with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getProcessor = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getProcessor(request), expectedError); - const actualRequest = (client.innerApiCalls.getProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessor with closed client', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getProcessor(request), expectedError); - }); - }); - - describe('getProcessorVersion', () => { - it('invokes getProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.ProcessorVersion() - ); - client.innerApiCalls.getProcessorVersion = stubSimpleCall(expectedResponse); - const [response] = await client.getProcessorVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.ProcessorVersion() - ); - client.innerApiCalls.getProcessorVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getProcessorVersion( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessorVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessorVersion with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getProcessorVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.getProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessorVersion with closed client', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getProcessorVersion(request), expectedError); - }); - }); - - describe('createProcessor', () => { - it('invokes createProcessor without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.CreateProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.CreateProcessorRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.Processor() - ); - client.innerApiCalls.createProcessor = stubSimpleCall(expectedResponse); - const [response] = await client.createProcessor(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createProcessor without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.CreateProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.CreateProcessorRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.Processor() - ); - client.innerApiCalls.createProcessor = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createProcessor( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessor|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createProcessor with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.CreateProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.CreateProcessorRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createProcessor = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createProcessor(request), expectedError); - const actualRequest = (client.innerApiCalls.createProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createProcessor with closed client', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.CreateProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.CreateProcessorRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createProcessor(request), expectedError); - }); - }); - - describe('getEvaluation', () => { - it('invokes getEvaluation without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetEvaluationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.Evaluation() - ); - client.innerApiCalls.getEvaluation = stubSimpleCall(expectedResponse); - const [response] = await client.getEvaluation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEvaluation without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetEvaluationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1.Evaluation() - ); - client.innerApiCalls.getEvaluation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEvaluation( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1.IEvaluation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEvaluation with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetEvaluationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEvaluation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEvaluation(request), expectedError); - const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEvaluation with closed client', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.GetEvaluationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.GetEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getEvaluation(request), expectedError); - }); - }); - - describe('batchProcessDocuments', () => { - it('invokes batchProcessDocuments without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.BatchProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.BatchProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchProcessDocuments = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchProcessDocuments(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchProcessDocuments without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.BatchProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.BatchProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchProcessDocuments = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchProcessDocuments( - 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.batchProcessDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchProcessDocuments with call error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.BatchProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.BatchProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchProcessDocuments = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchProcessDocuments(request), expectedError); - const actualRequest = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchProcessDocuments with LRO error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.BatchProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.BatchProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchProcessDocuments = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchProcessDocuments(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkBatchProcessDocumentsProgress without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkBatchProcessDocumentsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchProcessDocumentsProgress with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkBatchProcessDocumentsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('trainProcessorVersion', () => { - it('invokes trainProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.TrainProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.TrainProcessorVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.trainProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.trainProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes trainProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.TrainProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.TrainProcessorVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.trainProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.trainProcessorVersion( - 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.trainProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes trainProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.TrainProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.TrainProcessorVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.trainProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.trainProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes trainProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.TrainProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.TrainProcessorVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.trainProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.trainProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkTrainProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkTrainProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkTrainProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkTrainProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteProcessorVersion', () => { - it('invokes deleteProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DeleteProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DeleteProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteProcessorVersion( - 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.deleteProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DeleteProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DeleteProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkDeleteProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkDeleteProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deployProcessorVersion', () => { - it('invokes deployProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deployProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.deployProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deployProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deployProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deployProcessorVersion( - 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.deployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deployProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deployProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deployProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deployProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeployProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkDeployProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeployProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkDeployProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('undeployProcessorVersion', () => { - it('invokes undeployProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.UndeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.UndeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.undeployProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.undeployProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeployProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.UndeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.UndeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.undeployProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.undeployProcessorVersion( - 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.undeployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeployProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.UndeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.UndeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.undeployProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeployProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.UndeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.UndeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.undeployProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUndeployProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkUndeployProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUndeployProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkUndeployProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteProcessor', () => { - it('invokes deleteProcessor without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DeleteProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteProcessor = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteProcessor(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProcessor without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DeleteProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteProcessor = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteProcessor( - 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.deleteProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProcessor with call error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DeleteProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteProcessor = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteProcessor(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProcessor with LRO error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DeleteProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DeleteProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteProcessor = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteProcessor(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteProcessorProgress without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkDeleteProcessorProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteProcessorProgress with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkDeleteProcessorProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('enableProcessor', () => { - it('invokes enableProcessor without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.EnableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.EnableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.enableProcessor = stubLongRunningCall(expectedResponse); - const [operation] = await client.enableProcessor(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableProcessor without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.EnableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.EnableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.enableProcessor = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.enableProcessor( - 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.enableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableProcessor with call error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.EnableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.EnableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.enableProcessor = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.enableProcessor(request), expectedError); - const actualRequest = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableProcessor with LRO error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.EnableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.EnableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.enableProcessor = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.enableProcessor(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkEnableProcessorProgress without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkEnableProcessorProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkEnableProcessorProgress with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkEnableProcessorProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('disableProcessor', () => { - it('invokes disableProcessor without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DisableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DisableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.disableProcessor = stubLongRunningCall(expectedResponse); - const [operation] = await client.disableProcessor(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableProcessor without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DisableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DisableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.disableProcessor = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.disableProcessor( - 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.disableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableProcessor with call error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DisableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DisableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.disableProcessor = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.disableProcessor(request), expectedError); - const actualRequest = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableProcessor with LRO error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.DisableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.DisableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.disableProcessor = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.disableProcessor(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDisableProcessorProgress without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkDisableProcessorProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDisableProcessorProgress with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkDisableProcessorProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('setDefaultProcessorVersion', () => { - it('invokes setDefaultProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest', ['processor']); - request.processor = defaultValue1; - const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.setDefaultProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setDefaultProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest', ['processor']); - request.processor = defaultValue1; - const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setDefaultProcessorVersion( - 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.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setDefaultProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest', ['processor']); - request.processor = defaultValue1; - const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.setDefaultProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setDefaultProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.SetDefaultProcessorVersionRequest', ['processor']); - request.processor = defaultValue1; - const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.setDefaultProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkSetDefaultProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkSetDefaultProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkSetDefaultProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkSetDefaultProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('reviewDocument', () => { - it('invokes reviewDocument without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ReviewDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ReviewDocumentRequest', ['humanReviewConfig']); - request.humanReviewConfig = defaultValue1; - const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.reviewDocument = stubLongRunningCall(expectedResponse); - const [operation] = await client.reviewDocument(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes reviewDocument without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ReviewDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ReviewDocumentRequest', ['humanReviewConfig']); - request.humanReviewConfig = defaultValue1; - const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.reviewDocument = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.reviewDocument( - 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.reviewDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes reviewDocument with call error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ReviewDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ReviewDocumentRequest', ['humanReviewConfig']); - request.humanReviewConfig = defaultValue1; - const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.reviewDocument = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.reviewDocument(request), expectedError); - const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes reviewDocument with LRO error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ReviewDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ReviewDocumentRequest', ['humanReviewConfig']); - request.humanReviewConfig = defaultValue1; - const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.reviewDocument = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.reviewDocument(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkReviewDocumentProgress without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkReviewDocumentProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkReviewDocumentProgress with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkReviewDocumentProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('evaluateProcessorVersion', () => { - it('invokes evaluateProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.EvaluateProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.EvaluateProcessorVersionRequest', ['processorVersion']); - request.processorVersion = defaultValue1; - const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.evaluateProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes evaluateProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.EvaluateProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.EvaluateProcessorVersionRequest', ['processorVersion']); - request.processorVersion = defaultValue1; - const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.evaluateProcessorVersion( - 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.evaluateProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes evaluateProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.EvaluateProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.EvaluateProcessorVersionRequest', ['processorVersion']); - request.processorVersion = defaultValue1; - const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.evaluateProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes evaluateProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.EvaluateProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.EvaluateProcessorVersionRequest', ['processorVersion']); - request.processorVersion = defaultValue1; - const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.evaluateProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkEvaluateProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkEvaluateProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkEvaluateProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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.checkEvaluateProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listProcessorTypes', () => { - it('invokes listProcessorTypes without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), - ]; - client.innerApiCalls.listProcessorTypes = stubSimpleCall(expectedResponse); - const [response] = await client.listProcessorTypes(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listProcessorTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessorTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorTypes without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), - ]; - client.innerApiCalls.listProcessorTypes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listProcessorTypes( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessorType[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listProcessorTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessorTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorTypes with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listProcessorTypes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listProcessorTypes(request), expectedError); - const actualRequest = (client.innerApiCalls.listProcessorTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessorTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorTypesStream without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), - ]; - client.descriptors.page.listProcessorTypes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listProcessorTypesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1.ProcessorType[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1.ProcessorType) => { - 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.listProcessorTypes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProcessorTypes, request)); - assert( - (client.descriptors.page.listProcessorTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listProcessorTypesStream with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listProcessorTypes.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listProcessorTypesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1.ProcessorType[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1.ProcessorType) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listProcessorTypes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProcessorTypes, request)); - assert( - (client.descriptors.page.listProcessorTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listProcessorTypes without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorType()), - ]; - client.descriptors.page.listProcessorTypes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.documentai.v1.IProcessorType[] = []; - const iterable = client.listProcessorTypesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listProcessorTypes with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listProcessorTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listProcessorTypesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.documentai.v1.IProcessorType[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listProcessors', () => { - it('invokes listProcessors without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), - ]; - client.innerApiCalls.listProcessors = stubSimpleCall(expectedResponse); - const [response] = await client.listProcessors(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listProcessors as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessors as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessors without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), - ]; - client.innerApiCalls.listProcessors = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listProcessors( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessor[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listProcessors as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessors as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessors with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listProcessors = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listProcessors(request), expectedError); - const actualRequest = (client.innerApiCalls.listProcessors as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessors as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorsStream without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), - ]; - client.descriptors.page.listProcessors.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listProcessorsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1.Processor[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1.Processor) => { - 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.listProcessors.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProcessors, request)); - assert( - (client.descriptors.page.listProcessors.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listProcessorsStream with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listProcessors.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listProcessorsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1.Processor[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1.Processor) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listProcessors.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProcessors, request)); - assert( - (client.descriptors.page.listProcessors.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listProcessors without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Processor()), - ]; - client.descriptors.page.listProcessors.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.documentai.v1.IProcessor[] = []; - const iterable = client.listProcessorsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listProcessors.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listProcessors.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listProcessors with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listProcessors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listProcessorsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.documentai.v1.IProcessor[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listProcessors.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listProcessors.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listProcessorVersions', () => { - it('invokes listProcessorVersions without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), - ]; - client.innerApiCalls.listProcessorVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listProcessorVersions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listProcessorVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessorVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorVersions without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), - ]; - client.innerApiCalls.listProcessorVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listProcessorVersions( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1.IProcessorVersion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listProcessorVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessorVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorVersions with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listProcessorVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listProcessorVersions(request), expectedError); - const actualRequest = (client.innerApiCalls.listProcessorVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessorVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorVersionsStream without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), - ]; - client.descriptors.page.listProcessorVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listProcessorVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1.ProcessorVersion[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1.ProcessorVersion) => { - 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.listProcessorVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProcessorVersions, request)); - assert( - (client.descriptors.page.listProcessorVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listProcessorVersionsStream with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listProcessorVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listProcessorVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1.ProcessorVersion[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1.ProcessorVersion) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listProcessorVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProcessorVersions, request)); - assert( - (client.descriptors.page.listProcessorVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listProcessorVersions without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1.ProcessorVersion()), - ]; - client.descriptors.page.listProcessorVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.documentai.v1.IProcessorVersion[] = []; - const iterable = client.listProcessorVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listProcessorVersions with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listProcessorVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listProcessorVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.documentai.v1.IProcessorVersion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listEvaluations', () => { - it('invokes listEvaluations without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), - ]; - client.innerApiCalls.listEvaluations = stubSimpleCall(expectedResponse); - const [response] = await client.listEvaluations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEvaluations without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), - ]; - client.innerApiCalls.listEvaluations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listEvaluations( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1.IEvaluation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEvaluations with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listEvaluations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEvaluations(request), expectedError); - const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEvaluationsStream without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), - ]; - client.descriptors.page.listEvaluations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listEvaluationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1.Evaluation[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1.Evaluation) => { - 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.listEvaluations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEvaluations, request)); - assert( - (client.descriptors.page.listEvaluations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listEvaluationsStream with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listEvaluationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1.Evaluation[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1.Evaluation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listEvaluations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEvaluations, request)); - assert( - (client.descriptors.page.listEvaluations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEvaluations without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1.Evaluation()), - ]; - client.descriptors.page.listEvaluations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.documentai.v1.IEvaluation[] = []; - const iterable = client.listEvaluationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEvaluations with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listEvaluationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.documentai.v1.IEvaluation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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('evaluation', async () => { - const fakePath = "/rendered/path/evaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - processor_version: "processorVersionValue", - evaluation: "evaluationValue", - }; - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.evaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.evaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('evaluationPath', () => { - const result = client.evaluationPath("projectValue", "locationValue", "processorValue", "processorVersionValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.evaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEvaluationName', () => { - const result = client.matchProjectFromEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEvaluationName', () => { - const result = client.matchLocationFromEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromEvaluationName', () => { - const result = client.matchProcessorFromEvaluationName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorVersionFromEvaluationName', () => { - const result = client.matchProcessorVersionFromEvaluationName(fakePath); - assert.strictEqual(result, "processorVersionValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromEvaluationName', () => { - const result = client.matchEvaluationFromEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('humanReviewConfig', async () => { - const fakePath = "/rendered/path/humanReviewConfig"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - }; - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.humanReviewConfigPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.humanReviewConfigPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('humanReviewConfigPath', () => { - const result = client.humanReviewConfigPath("projectValue", "locationValue", "processorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.humanReviewConfigPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHumanReviewConfigName', () => { - const result = client.matchProjectFromHumanReviewConfigName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.humanReviewConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHumanReviewConfigName', () => { - const result = client.matchLocationFromHumanReviewConfigName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.humanReviewConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromHumanReviewConfigName', () => { - const result = client.matchProcessorFromHumanReviewConfigName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.humanReviewConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - 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('processor', async () => { - const fakePath = "/rendered/path/processor"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - }; - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.processorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.processorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('processorPath', () => { - const result = client.processorPath("projectValue", "locationValue", "processorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.processorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProcessorName', () => { - const result = client.matchProjectFromProcessorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.processorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProcessorName', () => { - const result = client.matchLocationFromProcessorName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.processorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromProcessorName', () => { - const result = client.matchProcessorFromProcessorName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.processorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('processorType', async () => { - const fakePath = "/rendered/path/processorType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor_type: "processorTypeValue", - }; - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.processorTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.processorTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('processorTypePath', () => { - const result = client.processorTypePath("projectValue", "locationValue", "processorTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.processorTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProcessorTypeName', () => { - const result = client.matchProjectFromProcessorTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProcessorTypeName', () => { - const result = client.matchLocationFromProcessorTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorTypeFromProcessorTypeName', () => { - const result = client.matchProcessorTypeFromProcessorTypeName(fakePath); - assert.strictEqual(result, "processorTypeValue"); - assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('processorVersion', async () => { - const fakePath = "/rendered/path/processorVersion"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - processor_version: "processorVersionValue", - }; - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.processorVersionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.processorVersionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('processorVersionPath', () => { - const result = client.processorVersionPath("projectValue", "locationValue", "processorValue", "processorVersionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.processorVersionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProcessorVersionName', () => { - const result = client.matchProjectFromProcessorVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProcessorVersionName', () => { - const result = client.matchLocationFromProcessorVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromProcessorVersionName', () => { - const result = client.matchProcessorFromProcessorVersionName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorVersionFromProcessorVersionName', () => { - const result = client.matchProcessorVersionFromProcessorVersionName(fakePath); - assert.strictEqual(result, "processorVersionValue"); - assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new documentprocessorserviceModule.v1.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1beta3.ts b/owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1beta3.ts deleted file mode 100644 index 693ad00eb7b..00000000000 --- a/owl-bot-staging/google-cloud-documentai/test/gapic_document_processor_service_v1beta3.ts +++ /dev/null @@ -1,4711 +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 documentprocessorserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, LocationProtos} 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 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 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('v1beta3.DocumentProcessorServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'documentai.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient(); - 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 = documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient.servicePath; - assert.strictEqual(servicePath, 'documentai.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'documentai.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'documentai.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'documentai.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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'documentai.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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'documentai.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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.documentProcessorServiceStub, undefined); - await client.initialize(); - assert(client.documentProcessorServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.documentProcessorServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.documentProcessorServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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('processDocument', () => { - it('invokes processDocument without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ProcessResponse() - ); - client.innerApiCalls.processDocument = stubSimpleCall(expectedResponse); - const [response] = await client.processDocument(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.processDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.processDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes processDocument without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ProcessResponse() - ); - client.innerApiCalls.processDocument = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.processDocument( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.processDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.processDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes processDocument with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.processDocument = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.processDocument(request), expectedError); - const actualRequest = (client.innerApiCalls.processDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.processDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes processDocument with closed client', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ProcessRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.processDocument(request), expectedError); - }); - }); - - describe('fetchProcessorTypes', () => { - it('invokes fetchProcessorTypes without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse() - ); - client.innerApiCalls.fetchProcessorTypes = stubSimpleCall(expectedResponse); - const [response] = await client.fetchProcessorTypes(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchProcessorTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchProcessorTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchProcessorTypes without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.FetchProcessorTypesResponse() - ); - client.innerApiCalls.fetchProcessorTypes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchProcessorTypes( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IFetchProcessorTypesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchProcessorTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchProcessorTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchProcessorTypes with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchProcessorTypes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchProcessorTypes(request), expectedError); - const actualRequest = (client.innerApiCalls.fetchProcessorTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchProcessorTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchProcessorTypes with closed client', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.FetchProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.fetchProcessorTypes(request), expectedError); - }); - }); - - describe('getProcessorType', () => { - it('invokes getProcessorType without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetProcessorTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ProcessorType() - ); - client.innerApiCalls.getProcessorType = stubSimpleCall(expectedResponse); - const [response] = await client.getProcessorType(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProcessorType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessorType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessorType without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetProcessorTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ProcessorType() - ); - client.innerApiCalls.getProcessorType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getProcessorType( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessorType|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProcessorType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessorType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessorType with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetProcessorTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getProcessorType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getProcessorType(request), expectedError); - const actualRequest = (client.innerApiCalls.getProcessorType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessorType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessorType with closed client', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetProcessorTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorTypeRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getProcessorType(request), expectedError); - }); - }); - - describe('getProcessor', () => { - it('invokes getProcessor without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.Processor() - ); - client.innerApiCalls.getProcessor = stubSimpleCall(expectedResponse); - const [response] = await client.getProcessor(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessor without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.Processor() - ); - client.innerApiCalls.getProcessor = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getProcessor( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessor|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessor with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getProcessor = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getProcessor(request), expectedError); - const actualRequest = (client.innerApiCalls.getProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessor with closed client', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getProcessor(request), expectedError); - }); - }); - - describe('getProcessorVersion', () => { - it('invokes getProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ProcessorVersion() - ); - client.innerApiCalls.getProcessorVersion = stubSimpleCall(expectedResponse); - const [response] = await client.getProcessorVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ProcessorVersion() - ); - client.innerApiCalls.getProcessorVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getProcessorVersion( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessorVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessorVersion with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getProcessorVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.getProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getProcessorVersion with closed client', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getProcessorVersion(request), expectedError); - }); - }); - - describe('createProcessor', () => { - it('invokes createProcessor without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.CreateProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.CreateProcessorRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.Processor() - ); - client.innerApiCalls.createProcessor = stubSimpleCall(expectedResponse); - const [response] = await client.createProcessor(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createProcessor without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.CreateProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.CreateProcessorRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.Processor() - ); - client.innerApiCalls.createProcessor = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createProcessor( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessor|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createProcessor with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.CreateProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.CreateProcessorRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createProcessor = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createProcessor(request), expectedError); - const actualRequest = (client.innerApiCalls.createProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createProcessor with closed client', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.CreateProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.CreateProcessorRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createProcessor(request), expectedError); - }); - }); - - describe('getEvaluation', () => { - it('invokes getEvaluation without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetEvaluationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.Evaluation() - ); - client.innerApiCalls.getEvaluation = stubSimpleCall(expectedResponse); - const [response] = await client.getEvaluation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEvaluation without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetEvaluationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.Evaluation() - ); - client.innerApiCalls.getEvaluation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getEvaluation( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IEvaluation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEvaluation with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetEvaluationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEvaluation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEvaluation(request), expectedError); - const actualRequest = (client.innerApiCalls.getEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getEvaluation with closed client', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetEvaluationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getEvaluation(request), expectedError); - }); - }); - - describe('batchProcessDocuments', () => { - it('invokes batchProcessDocuments without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.BatchProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchProcessDocuments = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchProcessDocuments(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchProcessDocuments without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.BatchProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchProcessDocuments = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchProcessDocuments( - 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.batchProcessDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchProcessDocuments with call error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.BatchProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchProcessDocuments = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchProcessDocuments(request), expectedError); - const actualRequest = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchProcessDocuments with LRO error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.BatchProcessRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchProcessRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchProcessDocuments = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchProcessDocuments(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchProcessDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkBatchProcessDocumentsProgress without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkBatchProcessDocumentsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchProcessDocumentsProgress with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkBatchProcessDocumentsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('trainProcessorVersion', () => { - it('invokes trainProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.trainProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.trainProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes trainProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.trainProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.trainProcessorVersion( - 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.trainProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes trainProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.trainProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.trainProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes trainProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.TrainProcessorVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.trainProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.trainProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.trainProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkTrainProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkTrainProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkTrainProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkTrainProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteProcessorVersion', () => { - it('invokes deleteProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteProcessorVersion( - 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.deleteProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkDeleteProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkDeleteProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deployProcessorVersion', () => { - it('invokes deployProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deployProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.deployProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deployProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deployProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deployProcessorVersion( - 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.deployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deployProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deployProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deployProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deployProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeployProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkDeployProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeployProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkDeployProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('undeployProcessorVersion', () => { - it('invokes undeployProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.undeployProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.undeployProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeployProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.undeployProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.undeployProcessorVersion( - 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.undeployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeployProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.undeployProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeployProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.UndeployProcessorVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.undeployProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUndeployProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkUndeployProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUndeployProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkUndeployProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteProcessor', () => { - it('invokes deleteProcessor without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DeleteProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteProcessor = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteProcessor(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProcessor without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DeleteProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteProcessor = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteProcessor( - 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.deleteProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProcessor with call error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DeleteProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteProcessor = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteProcessor(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteProcessor with LRO error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DeleteProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DeleteProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteProcessor = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteProcessor(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteProcessorProgress without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkDeleteProcessorProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteProcessorProgress with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkDeleteProcessorProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('enableProcessor', () => { - it('invokes enableProcessor without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.EnableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.EnableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.enableProcessor = stubLongRunningCall(expectedResponse); - const [operation] = await client.enableProcessor(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableProcessor without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.EnableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.EnableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.enableProcessor = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.enableProcessor( - 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.enableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableProcessor with call error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.EnableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.EnableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.enableProcessor = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.enableProcessor(request), expectedError); - const actualRequest = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes enableProcessor with LRO error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.EnableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.EnableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.enableProcessor = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.enableProcessor(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.enableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkEnableProcessorProgress without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkEnableProcessorProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkEnableProcessorProgress with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkEnableProcessorProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('disableProcessor', () => { - it('invokes disableProcessor without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DisableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DisableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.disableProcessor = stubLongRunningCall(expectedResponse); - const [operation] = await client.disableProcessor(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableProcessor without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DisableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DisableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.disableProcessor = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.disableProcessor( - 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.disableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableProcessor with call error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DisableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DisableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.disableProcessor = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.disableProcessor(request), expectedError); - const actualRequest = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes disableProcessor with LRO error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DisableProcessorRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.DisableProcessorRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.disableProcessor = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.disableProcessor(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.disableProcessor as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDisableProcessorProgress without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkDisableProcessorProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDisableProcessorProgress with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkDisableProcessorProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('setDefaultProcessorVersion', () => { - it('invokes setDefaultProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest', ['processor']); - request.processor = defaultValue1; - const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.setDefaultProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setDefaultProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest', ['processor']); - request.processor = defaultValue1; - const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setDefaultProcessorVersion( - 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.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setDefaultProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest', ['processor']); - request.processor = defaultValue1; - const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.setDefaultProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setDefaultProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest', ['processor']); - request.processor = defaultValue1; - const expectedHeaderRequestParams = `processor=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.setDefaultProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.setDefaultProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setDefaultProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkSetDefaultProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkSetDefaultProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkSetDefaultProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkSetDefaultProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('reviewDocument', () => { - it('invokes reviewDocument without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ReviewDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ReviewDocumentRequest', ['humanReviewConfig']); - request.humanReviewConfig = defaultValue1; - const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.reviewDocument = stubLongRunningCall(expectedResponse); - const [operation] = await client.reviewDocument(request); - const [response] = await operation.promise(); - assert(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes reviewDocument without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ReviewDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ReviewDocumentRequest', ['humanReviewConfig']); - request.humanReviewConfig = defaultValue1; - const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.reviewDocument = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.reviewDocument( - 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(stub.calledOnce); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes reviewDocument with call error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ReviewDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ReviewDocumentRequest', ['humanReviewConfig']); - request.humanReviewConfig = defaultValue1; - const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.reviewDocument = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.reviewDocument(request), expectedError); - assert(stub.calledOnce); - const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes reviewDocument with LRO error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ReviewDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ReviewDocumentRequest', ['humanReviewConfig']); - request.humanReviewConfig = defaultValue1; - const expectedHeaderRequestParams = `human_review_config=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.reviewDocument = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.reviewDocument(request); - await assert.rejects(operation.promise(), expectedError); - assert(stub.calledOnce); - const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.reviewDocument as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkReviewDocumentProgress without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - 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.checkReviewDocumentProgress(expectedResponse.name); - assert(stub.calledOnce); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkReviewDocumentProgress with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const stub = sinon.stub(client, 'warn'); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkReviewDocumentProgress(''), expectedError); - assert(stub.calledOnce); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('evaluateProcessorVersion', () => { - it('invokes evaluateProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest', ['processorVersion']); - request.processorVersion = defaultValue1; - const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.evaluateProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes evaluateProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest', ['processorVersion']); - request.processorVersion = defaultValue1; - const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.evaluateProcessorVersion( - 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.evaluateProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes evaluateProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest', ['processorVersion']); - request.processorVersion = defaultValue1; - const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.evaluateProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes evaluateProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest', ['processorVersion']); - request.processorVersion = defaultValue1; - const expectedHeaderRequestParams = `processor_version=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.evaluateProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.evaluateProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.evaluateProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkEvaluateProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkEvaluateProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkEvaluateProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkEvaluateProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('importProcessorVersion', () => { - it('invokes importProcessorVersion without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importProcessorVersion = stubLongRunningCall(expectedResponse); - const [operation] = await client.importProcessorVersion(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.importProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importProcessorVersion without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importProcessorVersion = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importProcessorVersion( - 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.importProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importProcessorVersion with call error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.importProcessorVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importProcessorVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.importProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importProcessorVersion with LRO error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportProcessorVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.importProcessorVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importProcessorVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.importProcessorVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importProcessorVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkImportProcessorVersionProgress without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkImportProcessorVersionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkImportProcessorVersionProgress with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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.checkImportProcessorVersionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listProcessorTypes', () => { - it('invokes listProcessorTypes without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), - ]; - client.innerApiCalls.listProcessorTypes = stubSimpleCall(expectedResponse); - const [response] = await client.listProcessorTypes(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listProcessorTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessorTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorTypes without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), - ]; - client.innerApiCalls.listProcessorTypes = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listProcessorTypes( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessorType[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listProcessorTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessorTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorTypes with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listProcessorTypes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listProcessorTypes(request), expectedError); - const actualRequest = (client.innerApiCalls.listProcessorTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessorTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorTypesStream without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), - ]; - client.descriptors.page.listProcessorTypes.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listProcessorTypesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1beta3.ProcessorType[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1beta3.ProcessorType) => { - 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.listProcessorTypes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProcessorTypes, request)); - assert( - (client.descriptors.page.listProcessorTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listProcessorTypesStream with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listProcessorTypes.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listProcessorTypesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1beta3.ProcessorType[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1beta3.ProcessorType) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listProcessorTypes.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProcessorTypes, request)); - assert( - (client.descriptors.page.listProcessorTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listProcessorTypes without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorType()), - ]; - client.descriptors.page.listProcessorTypes.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.documentai.v1beta3.IProcessorType[] = []; - const iterable = client.listProcessorTypesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listProcessorTypes with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorTypesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listProcessorTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listProcessorTypesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.documentai.v1beta3.IProcessorType[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listProcessorTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listProcessors', () => { - it('invokes listProcessors without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), - ]; - client.innerApiCalls.listProcessors = stubSimpleCall(expectedResponse); - const [response] = await client.listProcessors(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listProcessors as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessors as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessors without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), - ]; - client.innerApiCalls.listProcessors = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listProcessors( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessor[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listProcessors as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessors as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessors with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listProcessors = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listProcessors(request), expectedError); - const actualRequest = (client.innerApiCalls.listProcessors as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessors as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorsStream without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), - ]; - client.descriptors.page.listProcessors.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listProcessorsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1beta3.Processor[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1beta3.Processor) => { - 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.listProcessors.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProcessors, request)); - assert( - (client.descriptors.page.listProcessors.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listProcessorsStream with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listProcessors.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listProcessorsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1beta3.Processor[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1beta3.Processor) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listProcessors.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProcessors, request)); - assert( - (client.descriptors.page.listProcessors.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listProcessors without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Processor()), - ]; - client.descriptors.page.listProcessors.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.documentai.v1beta3.IProcessor[] = []; - const iterable = client.listProcessorsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listProcessors.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listProcessors.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listProcessors with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listProcessors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listProcessorsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.documentai.v1beta3.IProcessor[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listProcessors.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listProcessors.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listProcessorVersions', () => { - it('invokes listProcessorVersions without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), - ]; - client.innerApiCalls.listProcessorVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listProcessorVersions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listProcessorVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessorVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorVersions without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), - ]; - client.innerApiCalls.listProcessorVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listProcessorVersions( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IProcessorVersion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listProcessorVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessorVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorVersions with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listProcessorVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listProcessorVersions(request), expectedError); - const actualRequest = (client.innerApiCalls.listProcessorVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listProcessorVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listProcessorVersionsStream without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), - ]; - client.descriptors.page.listProcessorVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listProcessorVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1beta3.ProcessorVersion[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1beta3.ProcessorVersion) => { - 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.listProcessorVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProcessorVersions, request)); - assert( - (client.descriptors.page.listProcessorVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listProcessorVersionsStream with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listProcessorVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listProcessorVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1beta3.ProcessorVersion[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1beta3.ProcessorVersion) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listProcessorVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listProcessorVersions, request)); - assert( - (client.descriptors.page.listProcessorVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listProcessorVersions without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.ProcessorVersion()), - ]; - client.descriptors.page.listProcessorVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.documentai.v1beta3.IProcessorVersion[] = []; - const iterable = client.listProcessorVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listProcessorVersions with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListProcessorVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listProcessorVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listProcessorVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.documentai.v1beta3.IProcessorVersion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listProcessorVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listEvaluations', () => { - it('invokes listEvaluations without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), - ]; - client.innerApiCalls.listEvaluations = stubSimpleCall(expectedResponse); - const [response] = await client.listEvaluations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEvaluations without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), - ]; - client.innerApiCalls.listEvaluations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listEvaluations( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IEvaluation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEvaluations with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listEvaluations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEvaluations(request), expectedError); - const actualRequest = (client.innerApiCalls.listEvaluations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEvaluations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listEvaluationsStream without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), - ]; - client.descriptors.page.listEvaluations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listEvaluationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1beta3.Evaluation[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1beta3.Evaluation) => { - 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.listEvaluations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEvaluations, request)); - assert( - (client.descriptors.page.listEvaluations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listEvaluationsStream with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listEvaluationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1beta3.Evaluation[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1beta3.Evaluation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listEvaluations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listEvaluations, request)); - assert( - (client.descriptors.page.listEvaluations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEvaluations without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.Evaluation()), - ]; - client.descriptors.page.listEvaluations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.documentai.v1beta3.IEvaluation[] = []; - const iterable = client.listEvaluationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listEvaluations with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListEvaluationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listEvaluationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.documentai.v1beta3.IEvaluation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listEvaluations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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 documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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('dataset', async () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - }; - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "processorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromDatasetName', () => { - const result = client.matchProcessorFromDatasetName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('datasetSchema', async () => { - const fakePath = "/rendered/path/datasetSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - }; - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.datasetSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetSchemaPath', () => { - const result = client.datasetSchemaPath("projectValue", "locationValue", "processorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetSchemaName', () => { - const result = client.matchProjectFromDatasetSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetSchemaName', () => { - const result = client.matchLocationFromDatasetSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromDatasetSchemaName', () => { - const result = client.matchProcessorFromDatasetSchemaName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.datasetSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('evaluation', async () => { - const fakePath = "/rendered/path/evaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - processor_version: "processorVersionValue", - evaluation: "evaluationValue", - }; - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.evaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.evaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('evaluationPath', () => { - const result = client.evaluationPath("projectValue", "locationValue", "processorValue", "processorVersionValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.evaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEvaluationName', () => { - const result = client.matchProjectFromEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEvaluationName', () => { - const result = client.matchLocationFromEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromEvaluationName', () => { - const result = client.matchProcessorFromEvaluationName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorVersionFromEvaluationName', () => { - const result = client.matchProcessorVersionFromEvaluationName(fakePath); - assert.strictEqual(result, "processorVersionValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromEvaluationName', () => { - const result = client.matchEvaluationFromEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('humanReviewConfig', async () => { - const fakePath = "/rendered/path/humanReviewConfig"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - }; - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.humanReviewConfigPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.humanReviewConfigPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('humanReviewConfigPath', () => { - const result = client.humanReviewConfigPath("projectValue", "locationValue", "processorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.humanReviewConfigPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHumanReviewConfigName', () => { - const result = client.matchProjectFromHumanReviewConfigName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.humanReviewConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromHumanReviewConfigName', () => { - const result = client.matchLocationFromHumanReviewConfigName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.humanReviewConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromHumanReviewConfigName', () => { - const result = client.matchProcessorFromHumanReviewConfigName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.humanReviewConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - 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('processor', async () => { - const fakePath = "/rendered/path/processor"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - }; - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.processorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.processorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('processorPath', () => { - const result = client.processorPath("projectValue", "locationValue", "processorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.processorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProcessorName', () => { - const result = client.matchProjectFromProcessorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.processorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProcessorName', () => { - const result = client.matchLocationFromProcessorName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.processorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromProcessorName', () => { - const result = client.matchProcessorFromProcessorName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.processorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('processorType', async () => { - const fakePath = "/rendered/path/processorType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor_type: "processorTypeValue", - }; - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.processorTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.processorTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('processorTypePath', () => { - const result = client.processorTypePath("projectValue", "locationValue", "processorTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.processorTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProcessorTypeName', () => { - const result = client.matchProjectFromProcessorTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProcessorTypeName', () => { - const result = client.matchLocationFromProcessorTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorTypeFromProcessorTypeName', () => { - const result = client.matchProcessorTypeFromProcessorTypeName(fakePath); - assert.strictEqual(result, "processorTypeValue"); - assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('processorVersion', async () => { - const fakePath = "/rendered/path/processorVersion"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - processor_version: "processorVersionValue", - }; - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.processorVersionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.processorVersionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('processorVersionPath', () => { - const result = client.processorVersionPath("projectValue", "locationValue", "processorValue", "processorVersionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.processorVersionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProcessorVersionName', () => { - const result = client.matchProjectFromProcessorVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProcessorVersionName', () => { - const result = client.matchLocationFromProcessorVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromProcessorVersionName', () => { - const result = client.matchProcessorFromProcessorVersionName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorVersionFromProcessorVersionName', () => { - const result = client.matchProcessorVersionFromProcessorVersionName(fakePath); - assert.strictEqual(result, "processorVersionValue"); - assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new documentprocessorserviceModule.v1beta3.DocumentProcessorServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectPath', () => { - const result = client.projectPath("projectValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectName', () => { - const result = client.matchProjectFromProjectName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-documentai/test/gapic_document_service_v1beta3.ts b/owl-bot-staging/google-cloud-documentai/test/gapic_document_service_v1beta3.ts deleted file mode 100644 index 723a87a1654..00000000000 --- a/owl-bot-staging/google-cloud-documentai/test/gapic_document_service_v1beta3.ts +++ /dev/null @@ -1,2040 +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, LROperation, operationsProtos, LocationProtos} 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 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 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('v1beta3.DocumentServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'documentai.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new documentserviceModule.v1beta3.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.v1beta3.DocumentServiceClient.servicePath; - assert.strictEqual(servicePath, 'documentai.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = documentserviceModule.v1beta3.DocumentServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'documentai.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'documentai.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'documentai.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.v1beta3.DocumentServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'documentai.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.v1beta3.DocumentServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'documentai.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.v1beta3.DocumentServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = documentserviceModule.v1beta3.DocumentServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new documentserviceModule.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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.v1beta3.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('getDocument', () => { - it('invokes getDocument without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDocumentRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetDocumentResponse() - ); - 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.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDocumentRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetDocumentResponse() - ); - client.innerApiCalls.getDocument = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDocument( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IGetDocumentResponse|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.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDocumentRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${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.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetDocumentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDocumentRequest', ['dataset']); - request.dataset = 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('getDatasetSchema', () => { - it('invokes getDatasetSchema without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DatasetSchema() - ); - client.innerApiCalls.getDatasetSchema = stubSimpleCall(expectedResponse); - const [response] = await client.getDatasetSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDatasetSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDatasetSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDatasetSchema without error using callback', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DatasetSchema() - ); - client.innerApiCalls.getDatasetSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDatasetSchema( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IDatasetSchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDatasetSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDatasetSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDatasetSchema with error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDatasetSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDatasetSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.getDatasetSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDatasetSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDatasetSchema with closed client', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.GetDatasetSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getDatasetSchema(request), expectedError); - }); - }); - - describe('updateDatasetSchema', () => { - it('invokes updateDatasetSchema without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest() - ); - request.datasetSchema ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest', ['datasetSchema', 'name']); - request.datasetSchema.name = defaultValue1; - const expectedHeaderRequestParams = `dataset_schema.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DatasetSchema() - ); - client.innerApiCalls.updateDatasetSchema = stubSimpleCall(expectedResponse); - const [response] = await client.updateDatasetSchema(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDatasetSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDatasetSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDatasetSchema without error using callback', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest() - ); - request.datasetSchema ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest', ['datasetSchema', 'name']); - request.datasetSchema.name = defaultValue1; - const expectedHeaderRequestParams = `dataset_schema.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.DatasetSchema() - ); - client.innerApiCalls.updateDatasetSchema = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDatasetSchema( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IDatasetSchema|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDatasetSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDatasetSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDatasetSchema with error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest() - ); - request.datasetSchema ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest', ['datasetSchema', 'name']); - request.datasetSchema.name = defaultValue1; - const expectedHeaderRequestParams = `dataset_schema.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDatasetSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDatasetSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDatasetSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDatasetSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDatasetSchema with closed client', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest() - ); - request.datasetSchema ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetSchemaRequest', ['datasetSchema', 'name']); - request.datasetSchema.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateDatasetSchema(request), expectedError); - }); - }); - - describe('updateDataset', () => { - it('invokes updateDataset without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.UpdateDatasetRequest() - ); - request.dataset ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetRequest', ['dataset', 'name']); - request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateDataset = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateDataset(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDataset without error using callback', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.UpdateDatasetRequest() - ); - request.dataset ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetRequest', ['dataset', 'name']); - request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateDataset = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDataset( - 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.updateDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDataset with call error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.UpdateDatasetRequest() - ); - request.dataset ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetRequest', ['dataset', 'name']); - request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataset = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateDataset(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDataset with LRO error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.UpdateDatasetRequest() - ); - request.dataset ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.UpdateDatasetRequest', ['dataset', 'name']); - request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataset = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateDataset(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateDatasetProgress without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - 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.checkUpdateDatasetProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateDatasetProgress with error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - 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.checkUpdateDatasetProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('importDocuments', () => { - it('invokes importDocuments without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ImportDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importDocuments = stubLongRunningCall(expectedResponse); - const [operation] = await client.importDocuments(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.importDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importDocuments without error using callback', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ImportDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.importDocuments = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importDocuments( - 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.importDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importDocuments with call error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ImportDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.importDocuments = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importDocuments(request), expectedError); - const actualRequest = (client.innerApiCalls.importDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importDocuments with LRO error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ImportDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ImportDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.importDocuments = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importDocuments(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.importDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkImportDocumentsProgress without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - 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.checkImportDocumentsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkImportDocumentsProgress with error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - 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.checkImportDocumentsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('batchDeleteDocuments', () => { - it('invokes batchDeleteDocuments without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchDeleteDocuments = stubLongRunningCall(expectedResponse); - const [operation] = await client.batchDeleteDocuments(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchDeleteDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchDeleteDocuments without error using callback', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.batchDeleteDocuments = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchDeleteDocuments( - 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.batchDeleteDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchDeleteDocuments with call error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchDeleteDocuments = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchDeleteDocuments(request), expectedError); - const actualRequest = (client.innerApiCalls.batchDeleteDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchDeleteDocuments with LRO error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.BatchDeleteDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchDeleteDocuments = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchDeleteDocuments(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchDeleteDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchDeleteDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkBatchDeleteDocumentsProgress without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - 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.checkBatchDeleteDocumentsProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkBatchDeleteDocumentsProgress with error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - 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.checkBatchDeleteDocumentsProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listDocuments', () => { - it('invokes listDocuments without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), - ]; - client.innerApiCalls.listDocuments = stubSimpleCall(expectedResponse); - const [response] = await client.listDocuments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDocuments without error using callback', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), - ]; - client.innerApiCalls.listDocuments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDocuments( - request, - (err?: Error|null, result?: protos.google.cloud.documentai.v1beta3.IDocumentMetadata[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDocuments with error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDocuments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDocuments(request), expectedError); - const actualRequest = (client.innerApiCalls.listDocuments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDocuments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDocumentsStream without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), - ]; - client.descriptors.page.listDocuments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDocumentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1beta3.DocumentMetadata[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1beta3.DocumentMetadata) => { - 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.listDocuments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDocuments, request)); - assert( - (client.descriptors.page.listDocuments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDocumentsStream with error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDocuments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDocumentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.documentai.v1beta3.DocumentMetadata[] = []; - stream.on('data', (response: protos.google.cloud.documentai.v1beta3.DocumentMetadata) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDocuments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDocuments, request)); - assert( - (client.descriptors.page.listDocuments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDocuments without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), - generateSampleMessage(new protos.google.cloud.documentai.v1beta3.DocumentMetadata()), - ]; - client.descriptors.page.listDocuments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.documentai.v1beta3.IDocumentMetadata[] = []; - const iterable = client.listDocumentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDocuments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDocuments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDocuments with error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.documentai.v1beta3.ListDocumentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.documentai.v1beta3.ListDocumentsRequest', ['dataset']); - request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDocuments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDocumentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.documentai.v1beta3.IDocumentMetadata[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDocuments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDocuments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - 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 documentserviceModule.v1beta3.DocumentServiceClient({ - 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 documentserviceModule.v1beta3.DocumentServiceClient({ - 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 documentserviceModule.v1beta3.DocumentServiceClient({ - 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 documentserviceModule.v1beta3.DocumentServiceClient({ - 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 documentserviceModule.v1beta3.DocumentServiceClient({ - 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 documentserviceModule.v1beta3.DocumentServiceClient({ - 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 documentserviceModule.v1beta3.DocumentServiceClient({ - 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 documentserviceModule.v1beta3.DocumentServiceClient({ - 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 documentserviceModule.v1beta3.DocumentServiceClient({ - 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 documentserviceModule.v1beta3.DocumentServiceClient({ - 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('dataset', async () => { - const fakePath = "/rendered/path/dataset"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - }; - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.datasetPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetPath', () => { - const result = client.datasetPath("projectValue", "locationValue", "processorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetName', () => { - const result = client.matchProjectFromDatasetName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetName', () => { - const result = client.matchLocationFromDatasetName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromDatasetName', () => { - const result = client.matchProcessorFromDatasetName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.datasetPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('datasetSchema', async () => { - const fakePath = "/rendered/path/datasetSchema"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - }; - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.datasetSchemaPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.datasetSchemaPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('datasetSchemaPath', () => { - const result = client.datasetSchemaPath("projectValue", "locationValue", "processorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.datasetSchemaPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDatasetSchemaName', () => { - const result = client.matchProjectFromDatasetSchemaName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.datasetSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDatasetSchemaName', () => { - const result = client.matchLocationFromDatasetSchemaName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.datasetSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromDatasetSchemaName', () => { - const result = client.matchProcessorFromDatasetSchemaName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.datasetSchemaPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('evaluation', async () => { - const fakePath = "/rendered/path/evaluation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - processor_version: "processorVersionValue", - evaluation: "evaluationValue", - }; - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.evaluationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.evaluationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('evaluationPath', () => { - const result = client.evaluationPath("projectValue", "locationValue", "processorValue", "processorVersionValue", "evaluationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.evaluationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromEvaluationName', () => { - const result = client.matchProjectFromEvaluationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromEvaluationName', () => { - const result = client.matchLocationFromEvaluationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromEvaluationName', () => { - const result = client.matchProcessorFromEvaluationName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorVersionFromEvaluationName', () => { - const result = client.matchProcessorVersionFromEvaluationName(fakePath); - assert.strictEqual(result, "processorVersionValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchEvaluationFromEvaluationName', () => { - const result = client.matchEvaluationFromEvaluationName(fakePath); - assert.strictEqual(result, "evaluationValue"); - assert((client.pathTemplates.evaluationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('processor', async () => { - const fakePath = "/rendered/path/processor"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - }; - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.processorPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.processorPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('processorPath', () => { - const result = client.processorPath("projectValue", "locationValue", "processorValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.processorPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProcessorName', () => { - const result = client.matchProjectFromProcessorName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.processorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProcessorName', () => { - const result = client.matchLocationFromProcessorName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.processorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromProcessorName', () => { - const result = client.matchProcessorFromProcessorName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.processorPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('processorType', async () => { - const fakePath = "/rendered/path/processorType"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor_type: "processorTypeValue", - }; - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.processorTypePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.processorTypePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('processorTypePath', () => { - const result = client.processorTypePath("projectValue", "locationValue", "processorTypeValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.processorTypePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProcessorTypeName', () => { - const result = client.matchProjectFromProcessorTypeName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProcessorTypeName', () => { - const result = client.matchLocationFromProcessorTypeName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorTypeFromProcessorTypeName', () => { - const result = client.matchProcessorTypeFromProcessorTypeName(fakePath); - assert.strictEqual(result, "processorTypeValue"); - assert((client.pathTemplates.processorTypePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('processorVersion', async () => { - const fakePath = "/rendered/path/processorVersion"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - processor: "processorValue", - processor_version: "processorVersionValue", - }; - const client = new documentserviceModule.v1beta3.DocumentServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.processorVersionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.processorVersionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('processorVersionPath', () => { - const result = client.processorVersionPath("projectValue", "locationValue", "processorValue", "processorVersionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.processorVersionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProcessorVersionName', () => { - const result = client.matchProjectFromProcessorVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProcessorVersionName', () => { - const result = client.matchLocationFromProcessorVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorFromProcessorVersionName', () => { - const result = client.matchProcessorFromProcessorVersionName(fakePath); - assert.strictEqual(result, "processorValue"); - assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchProcessorVersionFromProcessorVersionName', () => { - const result = client.matchProcessorVersionFromProcessorVersionName(fakePath); - assert.strictEqual(result, "processorVersionValue"); - assert((client.pathTemplates.processorVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-documentai/tsconfig.json b/owl-bot-staging/google-cloud-documentai/tsconfig.json deleted file mode 100644 index ca73e7bfc82..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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-documentai/webpack.config.js b/owl-bot-staging/google-cloud-documentai/webpack.config.js deleted file mode 100644 index fc7bef574e6..00000000000 --- a/owl-bot-staging/google-cloud-documentai/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: 'DocumentProcessorService', - filename: './document-processor-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-documentai/protos/google/cloud/documentai/v1beta3/barcode.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/barcode.proto index ec0958f97c7..02a4cd4bfac 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/barcode.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/barcode.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. diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto index 31cb997a761..08321edd64c 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/dataset.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/dataset.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. @@ -69,9 +69,6 @@ message Dataset { // Configuration specific to an unmanaged dataset. message UnmanagedDatasetConfig {} - // Configuration specific to spanner-based indexing. - message SpannerIndexingConfig {} - // Different states of a dataset. enum State { // Default unspecified enum, should not be used. @@ -106,14 +103,6 @@ message Dataset { [(google.api.field_behavior) = OPTIONAL]; } - oneof indexing_source { - // Optional. A lightweight indexing source with low latency and high - // reliability, but lacking advanced features like CMEK and content-based - // search. - SpannerIndexingConfig spanner_indexing_config = 4 - [(google.api.field_behavior) = OPTIONAL]; - } - // Dataset resource name. // Format: // `projects/{project}/locations/{location}/processors/{processor}/dataset` diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto index 4560ae86dd3..c803d16bbbd 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document.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. @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.documentai.v1beta3; import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/documentai/v1beta3/barcode.proto"; import "google/cloud/documentai/v1beta3/geometry.proto"; import "google/protobuf/timestamp.proto"; @@ -340,7 +341,7 @@ message Document { repeated DetectedLanguage detected_languages = 2; } - // Detected non-text visual elements, for example, checkbox, signature, etc. + // Detected non-text visual elements, for example, checkbox, signature etc. // on the page. message VisualElement { // [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for @@ -530,7 +531,7 @@ message Document { // A list of visually detected tokens on the page. repeated Token tokens = 8; - // A list of detected non-text visual elements for example, checkbox, + // A list of detected non-text visual elements, for example, checkbox, // signature etc. on the page. repeated VisualElement visual_elements = 9; @@ -628,10 +629,11 @@ message Document { // [Document.text][google.cloud.documentai.v1beta3.Document.text]. TextAnchor text_anchor = 1 [(google.api.field_behavior) = OPTIONAL]; - // Required. Entity type from a schema for example, `Address`. + // Required. Entity type from a schema, for example, `Address`. string type = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. Text value of the entity for example, `1600 Amphitheatre Pkwy`. + // Optional. Text value of the entity, for example, `1600 Amphitheatre + // Pkwy`. string mention_text = 3 [(google.api.field_behavior) = OPTIONAL]; // Optional. Deprecated. Use `id` field instead. @@ -644,7 +646,7 @@ message Document { // 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 + // Optional. Canonical id. This will be a unique value in the entity list // for this document. string id = 7 [(google.api.field_behavior) = OPTIONAL]; @@ -673,10 +675,10 @@ message Document { // Relationship between // [Entities][google.cloud.documentai.v1beta3.Document.Entity]. message EntityRelation { - // Subject entity ID. + // Subject entity id. string subject_id = 1; - // Object entity ID. + // Object entity id. string object_id = 2; // Relationship description. @@ -806,7 +808,7 @@ message Document { // of entities, properties within entities, etc.) in the parent revision. int32 index = 3; - // The ID of the parent provenance. + // The id of the parent provenance. int32 id = 2 [deprecated = true]; } @@ -846,7 +848,7 @@ message Document { // 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 + // The Id of this operation. Needs to be unique within the scope of the // revision. int32 id = 2 [deprecated = true]; @@ -871,7 +873,7 @@ message Document { // Who/what made the change oneof source { - // If the change was made by a person specify the name or ID of that + // If the change was made by a person specify the name or id of that // person. string agent = 4; @@ -880,7 +882,7 @@ message Document { string processor = 5; } - // ID of the revision, internally generated by doc proto storage. + // Id of the revision, internally generated by doc proto storage. // Unique within the context of the document. string id = 1; @@ -889,7 +891,7 @@ message Document { // index into the `revisions` field. repeated int32 parent = 2 [deprecated = true]; - // The revisions that this revision is based on. Must include all the IDs + // 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; @@ -1013,18 +1015,18 @@ message Document { message LayoutImageBlock { // Source of the image. oneof image_source { - // Optional. Asset ID of the inline image. If set, find the image + // Optional. Asset id of the inline image. If set, find the image // content in the blob_assets field. string blob_asset_id = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Google Cloud Storage URI of the image. + // Optional. Google Cloud Storage uri of the image. string gcs_uri = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Data URI of the image. + // Optional. Data uri of the image. // It is composed of four parts: a prefix (data:), a MIME type // indicating the type of data, an optional base64 token if // non-textual, and the data itself: - // data:[][;base64],. + // data:[][;base64], string data_uri = 6 [(google.api.field_behavior) = OPTIONAL]; } @@ -1103,18 +1105,18 @@ message Document { message ImageChunkField { // Source of the image. oneof image_source { - // Optional. Asset ID of the inline image. If set, find the image + // Optional. Asset id of the inline image. If set, find the image // content in the blob_assets field. string blob_asset_id = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Google Cloud Storage URI of the image. + // Optional. Google Cloud Storage uri of the image. string gcs_uri = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Data URI of the image. + // Optional. Data uri of the image. // It is composed of four parts: a prefix (data:), a MIME type // indicating the type of data, an optional base64 token if // non-textual, and the data itself: - // data:[][;base64],. + // data:[][;base64], string data_uri = 3 [(google.api.field_behavior) = OPTIONAL]; } @@ -1171,7 +1173,7 @@ message Document { // in this document, for example, image bytes, such that it can be referenced // by other fields in the document via asset ID. message BlobAsset { - // Optional. The ID of the blob asset. + // Optional. The id of the blob asset. string asset_id = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. The content of the blob asset, for example, image bytes. @@ -1205,7 +1207,7 @@ message Document { VALIDATION_RESULT_TYPE_NOT_APPLICABLE = 4; } - // The name of the validation rule. + // The display name of the validation rule. string rule_name = 1; // The description of the validation rule. @@ -1229,7 +1231,7 @@ message Document { // Entity revision. message EntitiesRevision { - // The revision ID. + // The revision id. string revision_id = 1; // The entities in this revision. @@ -1237,6 +1239,9 @@ message Document { // The entity validation output for this revision. EntityValidationOutput entity_validation_output = 3; + + // Optional. The history of this revision. + Provenance provenance = 4 [(google.api.field_behavior) = OPTIONAL]; } // Original source document from the user. @@ -1320,7 +1325,7 @@ message Document { // 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 + // id and `document.entity_validation_output` field is the // `entity_validation_output` field in this entity revision. string entities_revision_id = 23; } @@ -1347,7 +1352,7 @@ message RevisionRef { // Reads the revision by the predefined case. RevisionCase revision_case = 1; - // Reads the revision given by the ID. + // Reads the revision given by the id. string revision_id = 2; // Reads the revision generated by the processor version. diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto index 9de9bb9d5c6..a80f1a95be5 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_io.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. @@ -16,6 +16,7 @@ syntax = "proto3"; package google.cloud.documentai.v1beta3; +import "google/cloud/documentai/v1beta3/document.proto"; import "google/protobuf/field_mask.proto"; option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; @@ -26,6 +27,12 @@ option java_package = "com.google.cloud.documentai.v1beta3"; option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3"; option ruby_package = "Google::Cloud::DocumentAI::V1beta3"; +// A set of inline documents. +message Documents { + // The list of documents. + repeated Document documents = 1; +} + // Payload message of raw document content (bytes). message RawDocument { // Inline document content. @@ -64,6 +71,12 @@ message GcsPrefix { string gcs_uri_prefix = 1; } +// Specifies a set of raw documents. +message RawDocuments { + // Specifies raw document content and mime type. + repeated RawDocument documents = 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 diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto index b5b5a3ad246..c3e4c98e4c6 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_processor_service.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/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. @@ -286,6 +286,7 @@ service DocumentProcessorService { // the specified processor. rpc ReviewDocument(ReviewDocumentRequest) returns (google.longrunning.Operation) { + option deprecated = true; option (google.api.http) = { post: "/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument" body: "*" @@ -393,6 +394,9 @@ message ProcessOptions { // Optional. Whether to include table annotations in layout parser response. bool enable_table_annotation = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to split table. + bool enable_table_split = 8 [(google.api.field_behavior) = OPTIONAL]; } // A list of individual page numbers. @@ -475,7 +479,7 @@ message ProcessRequest { // Whether human review should be skipped for this request. Default to // `false`. - bool skip_human_review = 3; + bool skip_human_review = 3 [deprecated = true]; // Specifies which fields to include in the // [ProcessResponse.document][google.cloud.documentai.v1beta3.ProcessResponse.document] @@ -614,7 +618,7 @@ message BatchProcessRequest { // Whether human review should be skipped for this request. Default to // `false`. - bool skip_human_review = 4; + bool skip_human_review = 4 [deprecated = true]; // Inference-time options for the process API ProcessOptions process_options = 7; @@ -1458,3 +1462,11 @@ message ImportProcessorVersionMetadata { // The basic metadata for the long-running operation. CommonOperationMetadata common_metadata = 1; } + +// The long-running operation metadata for the +// [UpdateProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.UpdateProcessorVersion] +// method. +message UpdateProcessorVersionMetadata { + // The basic metadata for the long-running operation. + CommonOperationMetadata common_metadata = 1; +} diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto index 637bb999716..8539769f467 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_schema.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. @@ -16,6 +16,8 @@ syntax = "proto3"; package google.cloud.documentai.v1beta3; +import "google/api/field_behavior.proto"; + option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3"; option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb"; option java_multiple_files = true; @@ -100,9 +102,9 @@ message DocumentSchema { // 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 + // considered a `REQUIRED_ONCE` entity type. If, on the other hand, it's + // expected that a bank statement contains the status of multiple + // different accounts for the customers, the occurrence type is set to // `REQUIRED_MULTIPLE`. enum OccurrenceType { // Unspecified occurrence type. @@ -166,7 +168,7 @@ message DocumentSchema { 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` + // 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; @@ -183,7 +185,7 @@ message DocumentSchema { // - 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 + // 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 @@ -219,13 +221,13 @@ message DocumentSchema { // 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 + // If set, this 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. + // Display name to show users. string display_name = 1; // Description of the schema. @@ -236,4 +238,9 @@ message DocumentSchema { // Metadata of the schema. Metadata metadata = 4; + + // Optional. Document level prompt provided by the user. This custom text is + // injected into the AI model's prompt to provide extra, document-wide + // guidance for processing. + string document_prompt = 5 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto index e794c99d715..91cc4f9c80c 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_service.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/document_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. @@ -190,6 +190,13 @@ message ImportDocumentsRequest { // The common config to specify a set of documents used as input. BatchDocumentsInputConfig batch_input_config = 1; + + // Optional. If set, determines the type of the documents to be imported in + // this batch. It can be used to auto-label the documents with a single + // entity of the provided type. This field can only be used with a + // classifier or splitter processor. Providing this field is mutually + // exclusive with `entities` and `auto_labeling_config`. + string document_type = 6 [(google.api.field_behavior) = OPTIONAL]; } // Required. The dataset resource name. diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/evaluation.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/evaluation.proto index da1189e7b88..6f60de0536e 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/evaluation.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/evaluation.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. @@ -77,7 +77,7 @@ message Evaluation { // The calculated recall. float recall = 2; - // The calculated f1 score. + // The calculated F1 score. float f1_score = 3; // The amount of occurrences in predicted documents. @@ -157,6 +157,23 @@ message Evaluation { MetricsType metrics_type = 7; } + // A revision of the evaluation. + message EvaluationRevision { + // Output only. The revision ID of the evaluation. + string revision_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Counters for the documents used in the evaluation. + Counters document_counters = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics for all the entities in aggregate. + MultiConfidenceMetrics all_entities_metrics = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics across confidence levels, for different entities. + map entity_metrics = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + // The resource name of the evaluation. // Format: // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` @@ -179,4 +196,7 @@ message Evaluation { // The KMS key version with which data is encrypted. string kms_key_version_name = 7; + + // Contains all revisions of the evaluation, excluding the latest one. + repeated EvaluationRevision revisions = 9; } diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.proto index 21bd4ae0fce..3febecc8f97 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/geometry.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. diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/operation_metadata.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/operation_metadata.proto index de0e127ac05..1d6fa007ae1 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/operation_metadata.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/operation_metadata.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. diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto index b7bebd3b9fa..36d95318cf3 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor.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. @@ -56,11 +56,11 @@ message ProcessorVersion { message GenAiModelInfo { // Information for a pretrained Google-managed foundation model. message FoundationGenAiModelInfo { - // Whether finetuning is allowed for this base processor version. + // Whether fine tuning is allowed for this base processor version. bool finetuning_allowed = 1; // The minimum number of labeled documents in the training dataset - // required for finetuning. + // required for fine tuning. int32 min_train_labeled_documents = 2; } diff --git a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto index 989b6e6c0de..5ca013e43e9 100644 --- a/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.proto +++ b/packages/google-cloud-documentai/protos/google/cloud/documentai/v1beta3/processor_type.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. diff --git a/packages/google-cloud-documentai/protos/protos.d.ts b/packages/google-cloud-documentai/protos/protos.d.ts index aa31aa840a2..9f1f13615f2 100644 --- a/packages/google-cloud-documentai/protos/protos.d.ts +++ b/packages/google-cloud-documentai/protos/protos.d.ts @@ -17300,9 +17300,6 @@ export namespace google { /** Dataset unmanagedDatasetConfig */ unmanagedDatasetConfig?: (google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null); - /** Dataset spannerIndexingConfig */ - spannerIndexingConfig?: (google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig|null); - /** Dataset name */ name?: (string|null); @@ -17334,9 +17331,6 @@ export namespace google { /** Dataset unmanagedDatasetConfig. */ public unmanagedDatasetConfig?: (google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null); - /** Dataset spannerIndexingConfig. */ - public spannerIndexingConfig?: (google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig|null); - /** Dataset name. */ public name: string; @@ -17352,9 +17346,6 @@ export namespace google { /** Dataset storageSource. */ public storageSource?: ("gcsManagedConfig"|"documentWarehouseConfig"|"unmanagedDatasetConfig"); - /** Dataset indexingSource. */ - public indexingSource?: "spannerIndexingConfig"; - /** * Creates a new Dataset instance using the specified properties. * @param [properties] Properties to set @@ -17726,97 +17717,6 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SpannerIndexingConfig. */ - interface ISpannerIndexingConfig { - } - - /** Represents a SpannerIndexingConfig. */ - class SpannerIndexingConfig implements ISpannerIndexingConfig { - - /** - * Constructs a new SpannerIndexingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig); - - /** - * Creates a new SpannerIndexingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SpannerIndexingConfig instance - */ - public static create(properties?: google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig): google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig; - - /** - * Encodes the specified SpannerIndexingConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig.verify|verify} messages. - * @param message SpannerIndexingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SpannerIndexingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig.verify|verify} messages. - * @param message SpannerIndexingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SpannerIndexingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SpannerIndexingConfig - * @throws {Error} If the payload is not a 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.v1beta3.Dataset.SpannerIndexingConfig; - - /** - * Decodes a SpannerIndexingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SpannerIndexingConfig - * @throws {Error} If the payload is 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.v1beta3.Dataset.SpannerIndexingConfig; - - /** - * Verifies a SpannerIndexingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SpannerIndexingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SpannerIndexingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig; - - /** - * Creates a plain object from a SpannerIndexingConfig message. Also converts values to other types if specified. - * @param message SpannerIndexingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SpannerIndexingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SpannerIndexingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - /** State enum. */ enum State { STATE_UNSPECIFIED = 0, @@ -25419,6 +25319,9 @@ export namespace google { /** EntitiesRevision entityValidationOutput */ entityValidationOutput?: (google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null); + + /** EntitiesRevision provenance */ + provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); } /** Represents an EntitiesRevision. */ @@ -25439,6 +25342,9 @@ export namespace google { /** EntitiesRevision entityValidationOutput. */ public entityValidationOutput?: (google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null); + /** EntitiesRevision provenance. */ + public provenance?: (google.cloud.documentai.v1beta3.Document.IProvenance|null); + /** * Creates a new EntitiesRevision instance using the specified properties. * @param [properties] Properties to set @@ -25950,6 +25856,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a Documents. */ + interface IDocuments { + + /** Documents documents */ + documents?: (google.cloud.documentai.v1beta3.IDocument[]|null); + } + + /** Represents a Documents. */ + class Documents implements IDocuments { + + /** + * Constructs a new Documents. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IDocuments); + + /** Documents documents. */ + public documents: google.cloud.documentai.v1beta3.IDocument[]; + + /** + * Creates a new Documents instance using the specified properties. + * @param [properties] Properties to set + * @returns Documents instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IDocuments): google.cloud.documentai.v1beta3.Documents; + + /** + * Encodes the specified Documents message. Does not implicitly {@link google.cloud.documentai.v1beta3.Documents.verify|verify} messages. + * @param message Documents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Documents message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Documents.verify|verify} messages. + * @param message Documents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Documents message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Documents + * @throws {Error} If the payload is not a 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.v1beta3.Documents; + + /** + * Decodes a Documents message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Documents + * @throws {Error} If the payload is 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.v1beta3.Documents; + + /** + * Verifies a Documents message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Documents message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Documents + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Documents; + + /** + * Creates a plain object from a Documents message. Also converts values to other types if specified. + * @param message Documents + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Documents, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Documents to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Documents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a RawDocument. */ interface IRawDocument { @@ -26356,6 +26359,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a RawDocuments. */ + interface IRawDocuments { + + /** RawDocuments documents */ + documents?: (google.cloud.documentai.v1beta3.IRawDocument[]|null); + } + + /** Represents a RawDocuments. */ + class RawDocuments implements IRawDocuments { + + /** + * Constructs a new RawDocuments. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IRawDocuments); + + /** RawDocuments documents. */ + public documents: google.cloud.documentai.v1beta3.IRawDocument[]; + + /** + * Creates a new RawDocuments instance using the specified properties. + * @param [properties] Properties to set + * @returns RawDocuments instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IRawDocuments): google.cloud.documentai.v1beta3.RawDocuments; + + /** + * Encodes the specified RawDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocuments.verify|verify} messages. + * @param message RawDocuments message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IRawDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RawDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocuments.verify|verify} messages. + * @param message RawDocuments message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IRawDocuments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RawDocuments message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RawDocuments + * @throws {Error} If the payload is not a 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.v1beta3.RawDocuments; + + /** + * Decodes a RawDocuments message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RawDocuments + * @throws {Error} If the payload is 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.v1beta3.RawDocuments; + + /** + * Verifies a RawDocuments message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RawDocuments message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RawDocuments + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.RawDocuments; + + /** + * Creates a plain object from a RawDocuments message. Also converts values to other types if specified. + * @param message RawDocuments + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.RawDocuments, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RawDocuments to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RawDocuments + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a BatchDocumentsInputConfig. */ interface IBatchDocumentsInputConfig { @@ -27560,6 +27660,9 @@ export namespace google { /** DocumentSchema metadata */ metadata?: (google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null); + + /** DocumentSchema documentPrompt */ + documentPrompt?: (string|null); } /** Represents a DocumentSchema. */ @@ -27583,6 +27686,9 @@ export namespace google { /** DocumentSchema metadata. */ public metadata?: (google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null); + /** DocumentSchema documentPrompt. */ + public documentPrompt: string; + /** * Creates a new DocumentSchema instance using the specified properties. * @param [properties] Properties to set @@ -28829,6 +28935,9 @@ export namespace google { /** LayoutConfig enableTableAnnotation */ enableTableAnnotation?: (boolean|null); + + /** LayoutConfig enableTableSplit */ + enableTableSplit?: (boolean|null); } /** Represents a LayoutConfig. */ @@ -28861,6 +28970,9 @@ export namespace google { /** LayoutConfig enableTableAnnotation. */ public enableTableAnnotation: boolean; + /** LayoutConfig enableTableSplit. */ + public enableTableSplit: boolean; + /** * Creates a new LayoutConfig instance using the specified properties. * @param [properties] Properties to set @@ -35463,6 +35575,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an UpdateProcessorVersionMetadata. */ + interface IUpdateProcessorVersionMetadata { + + /** UpdateProcessorVersionMetadata commonMetadata */ + commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + } + + /** Represents an UpdateProcessorVersionMetadata. */ + class UpdateProcessorVersionMetadata implements IUpdateProcessorVersionMetadata { + + /** + * Constructs a new UpdateProcessorVersionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata); + + /** UpdateProcessorVersionMetadata commonMetadata. */ + public commonMetadata?: (google.cloud.documentai.v1beta3.ICommonOperationMetadata|null); + + /** + * Creates a new UpdateProcessorVersionMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateProcessorVersionMetadata instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata): google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata; + + /** + * Encodes the specified UpdateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.verify|verify} messages. + * @param message UpdateProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.verify|verify} messages. + * @param message UpdateProcessorVersionMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateProcessorVersionMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateProcessorVersionMetadata + * @throws {Error} If the payload is not a 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.v1beta3.UpdateProcessorVersionMetadata; + + /** + * Decodes an UpdateProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateProcessorVersionMetadata + * @throws {Error} If the payload is 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.v1beta3.UpdateProcessorVersionMetadata; + + /** + * Verifies an UpdateProcessorVersionMetadata message. + * @param message Plain 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 UpdateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateProcessorVersionMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata; + + /** + * Creates a plain object from an UpdateProcessorVersionMetadata message. Also converts values to other types if specified. + * @param message UpdateProcessorVersionMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateProcessorVersionMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateProcessorVersionMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an EvaluationReference. */ interface IEvaluationReference { @@ -35601,6 +35810,9 @@ export namespace google { /** Evaluation kmsKeyVersionName */ kmsKeyVersionName?: (string|null); + + /** Evaluation revisions */ + revisions?: (google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision[]|null); } /** Represents an Evaluation. */ @@ -35633,6 +35845,9 @@ export namespace google { /** Evaluation kmsKeyVersionName. */ public kmsKeyVersionName: string; + /** Evaluation revisions. */ + public revisions: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision[]; + /** * Creates a new Evaluation instance using the specified properties. * @param [properties] Properties to set @@ -36229,6 +36444,121 @@ export namespace google { AGGREGATE = 1 } } + + /** Properties of an EvaluationRevision. */ + interface IEvaluationRevision { + + /** EvaluationRevision revisionId */ + revisionId?: (string|null); + + /** EvaluationRevision documentCounters */ + documentCounters?: (google.cloud.documentai.v1beta3.Evaluation.ICounters|null); + + /** EvaluationRevision allEntitiesMetrics */ + allEntitiesMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null); + + /** EvaluationRevision entityMetrics */ + entityMetrics?: ({ [k: string]: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics }|null); + } + + /** Represents an EvaluationRevision. */ + class EvaluationRevision implements IEvaluationRevision { + + /** + * Constructs a new EvaluationRevision. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision); + + /** EvaluationRevision revisionId. */ + public revisionId: string; + + /** EvaluationRevision documentCounters. */ + public documentCounters?: (google.cloud.documentai.v1beta3.Evaluation.ICounters|null); + + /** EvaluationRevision allEntitiesMetrics. */ + public allEntitiesMetrics?: (google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null); + + /** EvaluationRevision entityMetrics. */ + public entityMetrics: { [k: string]: google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics }; + + /** + * Creates a new EvaluationRevision instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationRevision instance + */ + public static create(properties?: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision): google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision; + + /** + * Encodes the specified EvaluationRevision message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.verify|verify} messages. + * @param message EvaluationRevision message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.verify|verify} messages. + * @param message EvaluationRevision message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationRevision message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationRevision + * @throws {Error} If the payload is not a 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.v1beta3.Evaluation.EvaluationRevision; + + /** + * Decodes an EvaluationRevision message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationRevision + * @throws {Error} If the payload is 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.v1beta3.Evaluation.EvaluationRevision; + + /** + * Verifies an EvaluationRevision message. + * @param message Plain 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 EvaluationRevision message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationRevision + */ + public static fromObject(object: { [k: string]: any }): google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision; + + /** + * Creates a plain object from an EvaluationRevision message. Also converts values to other types if specified. + * @param message EvaluationRevision + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationRevision to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationRevision + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a CommonOperationMetadata. */ @@ -38002,6 +38332,9 @@ export namespace google { /** BatchDocumentsImportConfig batchInputConfig */ batchInputConfig?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); + + /** BatchDocumentsImportConfig documentType */ + documentType?: (string|null); } /** Represents a BatchDocumentsImportConfig. */ @@ -38022,6 +38355,9 @@ export namespace google { /** BatchDocumentsImportConfig batchInputConfig. */ public batchInputConfig?: (google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null); + /** BatchDocumentsImportConfig documentType. */ + public documentType: string; + /** BatchDocumentsImportConfig splitTypeConfig. */ public splitTypeConfig?: ("datasetSplit"|"autoSplitConfig"); diff --git a/packages/google-cloud-documentai/protos/protos.js b/packages/google-cloud-documentai/protos/protos.js index 5e7b120a570..3ff43c29245 100644 --- a/packages/google-cloud-documentai/protos/protos.js +++ b/packages/google-cloud-documentai/protos/protos.js @@ -42954,7 +42954,6 @@ * @property {google.cloud.documentai.v1beta3.Dataset.IGCSManagedConfig|null} [gcsManagedConfig] Dataset gcsManagedConfig * @property {google.cloud.documentai.v1beta3.Dataset.IDocumentWarehouseConfig|null} [documentWarehouseConfig] Dataset documentWarehouseConfig * @property {google.cloud.documentai.v1beta3.Dataset.IUnmanagedDatasetConfig|null} [unmanagedDatasetConfig] Dataset unmanagedDatasetConfig - * @property {google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig|null} [spannerIndexingConfig] Dataset spannerIndexingConfig * @property {string|null} [name] Dataset name * @property {google.cloud.documentai.v1beta3.Dataset.State|null} [state] Dataset state * @property {boolean|null} [satisfiesPzs] Dataset satisfiesPzs @@ -43000,14 +42999,6 @@ */ Dataset.prototype.unmanagedDatasetConfig = null; - /** - * Dataset spannerIndexingConfig. - * @member {google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig|null|undefined} spannerIndexingConfig - * @memberof google.cloud.documentai.v1beta3.Dataset - * @instance - */ - Dataset.prototype.spannerIndexingConfig = null; - /** * Dataset name. * @member {string} name @@ -43054,17 +43045,6 @@ set: $util.oneOfSetter($oneOfFields) }); - /** - * Dataset indexingSource. - * @member {"spannerIndexingConfig"|undefined} indexingSource - * @memberof google.cloud.documentai.v1beta3.Dataset - * @instance - */ - Object.defineProperty(Dataset.prototype, "indexingSource", { - get: $util.oneOfGetter($oneOfFields = ["spannerIndexingConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** * Creates a new Dataset instance using the specified properties. * @function create @@ -43095,8 +43075,6 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); if (message.gcsManagedConfig != null && Object.hasOwnProperty.call(message, "gcsManagedConfig")) $root.google.cloud.documentai.v1beta3.Dataset.GCSManagedConfig.encode(message.gcsManagedConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.spannerIndexingConfig != null && Object.hasOwnProperty.call(message, "spannerIndexingConfig")) - $root.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig.encode(message.spannerIndexingConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.documentWarehouseConfig != null && Object.hasOwnProperty.call(message, "documentWarehouseConfig")) $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.encode(message.documentWarehouseConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.unmanagedDatasetConfig != null && Object.hasOwnProperty.call(message, "unmanagedDatasetConfig")) @@ -43153,10 +43131,6 @@ message.unmanagedDatasetConfig = $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.decode(reader, reader.uint32()); break; } - case 4: { - message.spannerIndexingConfig = $root.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig.decode(reader, reader.uint32()); - break; - } case 1: { message.name = reader.string(); break; @@ -43237,14 +43211,6 @@ return "unmanagedDatasetConfig." + error; } } - if (message.spannerIndexingConfig != null && message.hasOwnProperty("spannerIndexingConfig")) { - properties.indexingSource = 1; - { - var error = $root.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig.verify(message.spannerIndexingConfig); - if (error) - return "spannerIndexingConfig." + error; - } - } if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; @@ -43294,11 +43260,6 @@ throw TypeError(".google.cloud.documentai.v1beta3.Dataset.unmanagedDatasetConfig: object expected"); message.unmanagedDatasetConfig = $root.google.cloud.documentai.v1beta3.Dataset.UnmanagedDatasetConfig.fromObject(object.unmanagedDatasetConfig); } - if (object.spannerIndexingConfig != null) { - if (typeof object.spannerIndexingConfig !== "object") - throw TypeError(".google.cloud.documentai.v1beta3.Dataset.spannerIndexingConfig: object expected"); - message.spannerIndexingConfig = $root.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig.fromObject(object.spannerIndexingConfig); - } if (object.name != null) message.name = String(object.name); switch (object.state) { @@ -43360,11 +43321,6 @@ if (options.oneofs) object.storageSource = "gcsManagedConfig"; } - if (message.spannerIndexingConfig != null && message.hasOwnProperty("spannerIndexingConfig")) { - object.spannerIndexingConfig = $root.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig.toObject(message.spannerIndexingConfig, options); - if (options.oneofs) - object.indexingSource = "spannerIndexingConfig"; - } if (message.documentWarehouseConfig != null && message.hasOwnProperty("documentWarehouseConfig")) { object.documentWarehouseConfig = $root.google.cloud.documentai.v1beta3.Dataset.DocumentWarehouseConfig.toObject(message.documentWarehouseConfig, options); if (options.oneofs) @@ -44024,183 +43980,6 @@ return UnmanagedDatasetConfig; })(); - Dataset.SpannerIndexingConfig = (function() { - - /** - * Properties of a SpannerIndexingConfig. - * @memberof google.cloud.documentai.v1beta3.Dataset - * @interface ISpannerIndexingConfig - */ - - /** - * Constructs a new SpannerIndexingConfig. - * @memberof google.cloud.documentai.v1beta3.Dataset - * @classdesc Represents a SpannerIndexingConfig. - * @implements ISpannerIndexingConfig - * @constructor - * @param {google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig=} [properties] Properties to set - */ - function SpannerIndexingConfig(properties) { - if (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 SpannerIndexingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig=} [properties] Properties to set - * @returns {google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig} SpannerIndexingConfig instance - */ - SpannerIndexingConfig.create = function create(properties) { - return new SpannerIndexingConfig(properties); - }; - - /** - * Encodes the specified SpannerIndexingConfig message. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig} message SpannerIndexingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpannerIndexingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified SpannerIndexingConfig message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.ISpannerIndexingConfig} message SpannerIndexingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SpannerIndexingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SpannerIndexingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig} SpannerIndexingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpannerIndexingConfig.decode = function decode(reader, 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.v1beta3.Dataset.SpannerIndexingConfig(); - 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 SpannerIndexingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig} SpannerIndexingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SpannerIndexingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SpannerIndexingConfig message. - * @function verify - * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SpannerIndexingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a SpannerIndexingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig} SpannerIndexingConfig - */ - SpannerIndexingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig) - return object; - return new $root.google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig(); - }; - - /** - * Creates a plain object from a SpannerIndexingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig - * @static - * @param {google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig} message SpannerIndexingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SpannerIndexingConfig.toObject = function toObject() { - return {}; - }; - - /** - * Converts this SpannerIndexingConfig to JSON. - * @function toJSON - * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig - * @instance - * @returns {Object.} JSON object - */ - SpannerIndexingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SpannerIndexingConfig - * @function getTypeUrl - * @memberof google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SpannerIndexingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Dataset.SpannerIndexingConfig"; - }; - - return SpannerIndexingConfig; - })(); - /** * State enum. * @name google.cloud.documentai.v1beta3.Dataset.State @@ -64209,6 +63988,7 @@ * @property {string|null} [revisionId] EntitiesRevision revisionId * @property {Array.|null} [entities] EntitiesRevision entities * @property {google.cloud.documentai.v1beta3.Document.IEntityValidationOutput|null} [entityValidationOutput] EntitiesRevision entityValidationOutput + * @property {google.cloud.documentai.v1beta3.Document.IProvenance|null} [provenance] EntitiesRevision provenance */ /** @@ -64251,6 +64031,14 @@ */ EntitiesRevision.prototype.entityValidationOutput = null; + /** + * EntitiesRevision provenance. + * @member {google.cloud.documentai.v1beta3.Document.IProvenance|null|undefined} provenance + * @memberof google.cloud.documentai.v1beta3.Document.EntitiesRevision + * @instance + */ + EntitiesRevision.prototype.provenance = null; + /** * Creates a new EntitiesRevision instance using the specified properties. * @function create @@ -64282,6 +64070,8 @@ $root.google.cloud.documentai.v1beta3.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.v1beta3.Document.EntityValidationOutput.encode(message.entityValidationOutput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.google.cloud.documentai.v1beta3.Document.Provenance.encode(message.provenance, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -64332,6 +64122,10 @@ message.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.decode(reader, reader.uint32()); break; } + case 4: { + message.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -64384,6 +64178,11 @@ if (error) return "entityValidationOutput." + error; } + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.google.cloud.documentai.v1beta3.Document.Provenance.verify(message.provenance); + if (error) + return "provenance." + error; + } return null; }; @@ -64416,6 +64215,11 @@ throw TypeError(".google.cloud.documentai.v1beta3.Document.EntitiesRevision.entityValidationOutput: object expected"); message.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.fromObject(object.entityValidationOutput); } + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Document.EntitiesRevision.provenance: object expected"); + message.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.fromObject(object.provenance); + } return message; }; @@ -64437,6 +64241,7 @@ if (options.defaults) { object.revisionId = ""; object.entityValidationOutput = null; + object.provenance = null; } if (message.revisionId != null && message.hasOwnProperty("revisionId")) object.revisionId = message.revisionId; @@ -64447,6 +64252,8 @@ } if (message.entityValidationOutput != null && message.hasOwnProperty("entityValidationOutput")) object.entityValidationOutput = $root.google.cloud.documentai.v1beta3.Document.EntityValidationOutput.toObject(message.entityValidationOutput, options); + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.google.cloud.documentai.v1beta3.Document.Provenance.toObject(message.provenance, options); return object; }; @@ -65539,6 +65346,232 @@ return BoundingPoly; })(); + v1beta3.Documents = (function() { + + /** + * Properties of a Documents. + * @memberof google.cloud.documentai.v1beta3 + * @interface IDocuments + * @property {Array.|null} [documents] Documents documents + */ + + /** + * Constructs a new Documents. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a Documents. + * @implements IDocuments + * @constructor + * @param {google.cloud.documentai.v1beta3.IDocuments=} [properties] Properties to set + */ + function Documents(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]]; + } + + /** + * Documents documents. + * @member {Array.} documents + * @memberof google.cloud.documentai.v1beta3.Documents + * @instance + */ + Documents.prototype.documents = $util.emptyArray; + + /** + * Creates a new Documents instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {google.cloud.documentai.v1beta3.IDocuments=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Documents} Documents instance + */ + Documents.create = function create(properties) { + return new Documents(properties); + }; + + /** + * Encodes the specified Documents message. Does not implicitly {@link google.cloud.documentai.v1beta3.Documents.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {google.cloud.documentai.v1beta3.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.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) + $root.google.cloud.documentai.v1beta3.Document.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Documents message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Documents.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {google.cloud.documentai.v1beta3.IDocuments} message Documents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Documents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Documents message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decode = function decode(reader, 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.v1beta3.Documents(); + 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($root.google.cloud.documentai.v1beta3.Document.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Documents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Documents} Documents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Documents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Documents message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Documents.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) { + var error = $root.google.cloud.documentai.v1beta3.Document.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + return null; + }; + + /** + * Creates a Documents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Documents} Documents + */ + Documents.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Documents) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Documents(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.documentai.v1beta3.Documents.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Documents.documents: object expected"); + message.documents[i] = $root.google.cloud.documentai.v1beta3.Document.fromObject(object.documents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Documents message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {google.cloud.documentai.v1beta3.Documents} message Documents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Documents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.cloud.documentai.v1beta3.Document.toObject(message.documents[j], options); + } + return object; + }; + + /** + * Converts this Documents to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Documents + * @instance + * @returns {Object.} JSON object + */ + Documents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Documents + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Documents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Documents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Documents"; + }; + + return Documents; + })(); + v1beta3.RawDocument = (function() { /** @@ -66460,6 +66493,232 @@ return GcsPrefix; })(); + v1beta3.RawDocuments = (function() { + + /** + * Properties of a RawDocuments. + * @memberof google.cloud.documentai.v1beta3 + * @interface IRawDocuments + * @property {Array.|null} [documents] RawDocuments documents + */ + + /** + * Constructs a new RawDocuments. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents a RawDocuments. + * @implements IRawDocuments + * @constructor + * @param {google.cloud.documentai.v1beta3.IRawDocuments=} [properties] Properties to set + */ + function RawDocuments(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]]; + } + + /** + * RawDocuments documents. + * @member {Array.} documents + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @instance + */ + RawDocuments.prototype.documents = $util.emptyArray; + + /** + * Creates a new RawDocuments instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {google.cloud.documentai.v1beta3.IRawDocuments=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.RawDocuments} RawDocuments instance + */ + RawDocuments.create = function create(properties) { + return new RawDocuments(properties); + }; + + /** + * Encodes the specified RawDocuments message. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocuments.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {google.cloud.documentai.v1beta3.IRawDocuments} message RawDocuments message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawDocuments.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) + $root.google.cloud.documentai.v1beta3.RawDocument.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RawDocuments message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.RawDocuments.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {google.cloud.documentai.v1beta3.IRawDocuments} message RawDocuments message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawDocuments.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RawDocuments message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.RawDocuments} RawDocuments + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawDocuments.decode = function decode(reader, 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.v1beta3.RawDocuments(); + 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($root.google.cloud.documentai.v1beta3.RawDocument.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RawDocuments message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.RawDocuments} RawDocuments + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawDocuments.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RawDocuments message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RawDocuments.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) { + var error = $root.google.cloud.documentai.v1beta3.RawDocument.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + return null; + }; + + /** + * Creates a RawDocuments message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.RawDocuments} RawDocuments + */ + RawDocuments.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.RawDocuments) + return object; + var message = new $root.google.cloud.documentai.v1beta3.RawDocuments(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.documentai.v1beta3.RawDocuments.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.RawDocuments.documents: object expected"); + message.documents[i] = $root.google.cloud.documentai.v1beta3.RawDocument.fromObject(object.documents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RawDocuments message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {google.cloud.documentai.v1beta3.RawDocuments} message RawDocuments + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RawDocuments.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.cloud.documentai.v1beta3.RawDocument.toObject(message.documents[j], options); + } + return object; + }; + + /** + * Converts this RawDocuments to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @instance + * @returns {Object.} JSON object + */ + RawDocuments.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RawDocuments + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.RawDocuments + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RawDocuments.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.RawDocuments"; + }; + + return RawDocuments; + })(); + v1beta3.BatchDocumentsInputConfig = (function() { /** @@ -69286,6 +69545,7 @@ * @property {string|null} [description] DocumentSchema description * @property {Array.|null} [entityTypes] DocumentSchema entityTypes * @property {google.cloud.documentai.v1beta3.DocumentSchema.IMetadata|null} [metadata] DocumentSchema metadata + * @property {string|null} [documentPrompt] DocumentSchema documentPrompt */ /** @@ -69336,6 +69596,14 @@ */ DocumentSchema.prototype.metadata = null; + /** + * DocumentSchema documentPrompt. + * @member {string} documentPrompt + * @memberof google.cloud.documentai.v1beta3.DocumentSchema + * @instance + */ + DocumentSchema.prototype.documentPrompt = ""; + /** * Creates a new DocumentSchema instance using the specified properties. * @function create @@ -69369,6 +69637,8 @@ $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.documentPrompt != null && Object.hasOwnProperty.call(message, "documentPrompt")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.documentPrompt); return writer; }; @@ -69423,6 +69693,10 @@ message.metadata = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.decode(reader, reader.uint32()); break; } + case 5: { + message.documentPrompt = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -69478,6 +69752,9 @@ if (error) return "metadata." + error; } + if (message.documentPrompt != null && message.hasOwnProperty("documentPrompt")) + if (!$util.isString(message.documentPrompt)) + return "documentPrompt: string expected"; return null; }; @@ -69512,6 +69789,8 @@ throw TypeError(".google.cloud.documentai.v1beta3.DocumentSchema.metadata: object expected"); message.metadata = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.fromObject(object.metadata); } + if (object.documentPrompt != null) + message.documentPrompt = String(object.documentPrompt); return message; }; @@ -69534,6 +69813,7 @@ object.displayName = ""; object.description = ""; object.metadata = null; + object.documentPrompt = ""; } if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; @@ -69546,6 +69826,8 @@ } if (message.metadata != null && message.hasOwnProperty("metadata")) object.metadata = $root.google.cloud.documentai.v1beta3.DocumentSchema.Metadata.toObject(message.metadata, options); + if (message.documentPrompt != null && message.hasOwnProperty("documentPrompt")) + object.documentPrompt = message.documentPrompt; return object; }; @@ -72107,6 +72389,7 @@ * @property {boolean|null} [enableImageExtraction] LayoutConfig enableImageExtraction * @property {boolean|null} [enableLlmLayoutParsing] LayoutConfig enableLlmLayoutParsing * @property {boolean|null} [enableTableAnnotation] LayoutConfig enableTableAnnotation + * @property {boolean|null} [enableTableSplit] LayoutConfig enableTableSplit */ /** @@ -72180,6 +72463,14 @@ */ LayoutConfig.prototype.enableTableAnnotation = false; + /** + * LayoutConfig enableTableSplit. + * @member {boolean} enableTableSplit + * @memberof google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig + * @instance + */ + LayoutConfig.prototype.enableTableSplit = false; + /** * Creates a new LayoutConfig instance using the specified properties. * @function create @@ -72218,6 +72509,8 @@ writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enableTableAnnotation); if (message.enableImageExtraction != null && Object.hasOwnProperty.call(message, "enableImageExtraction")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableImageExtraction); + if (message.enableTableSplit != null && Object.hasOwnProperty.call(message, "enableTableSplit")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableTableSplit); return writer; }; @@ -72282,6 +72575,10 @@ message.enableTableAnnotation = reader.bool(); break; } + case 8: { + message.enableTableSplit = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -72340,6 +72637,9 @@ if (message.enableTableAnnotation != null && message.hasOwnProperty("enableTableAnnotation")) if (typeof message.enableTableAnnotation !== "boolean") return "enableTableAnnotation: boolean expected"; + if (message.enableTableSplit != null && message.hasOwnProperty("enableTableSplit")) + if (typeof message.enableTableSplit !== "boolean") + return "enableTableSplit: boolean expected"; return null; }; @@ -72372,6 +72672,8 @@ message.enableLlmLayoutParsing = Boolean(object.enableLlmLayoutParsing); if (object.enableTableAnnotation != null) message.enableTableAnnotation = Boolean(object.enableTableAnnotation); + if (object.enableTableSplit != null) + message.enableTableSplit = Boolean(object.enableTableSplit); return message; }; @@ -72396,6 +72698,7 @@ object.enableLlmLayoutParsing = false; object.enableTableAnnotation = false; object.enableImageExtraction = false; + object.enableTableSplit = false; } if (message.chunkingConfig != null && message.hasOwnProperty("chunkingConfig")) object.chunkingConfig = $root.google.cloud.documentai.v1beta3.ProcessOptions.LayoutConfig.ChunkingConfig.toObject(message.chunkingConfig, options); @@ -72411,6 +72714,8 @@ object.enableTableAnnotation = message.enableTableAnnotation; if (message.enableImageExtraction != null && message.hasOwnProperty("enableImageExtraction")) object.enableImageExtraction = message.enableImageExtraction; + if (message.enableTableSplit != null && message.hasOwnProperty("enableTableSplit")) + object.enableTableSplit = message.enableTableSplit; return object; }; @@ -87653,6 +87958,216 @@ return ImportProcessorVersionMetadata; })(); + v1beta3.UpdateProcessorVersionMetadata = (function() { + + /** + * Properties of an UpdateProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @interface IUpdateProcessorVersionMetadata + * @property {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null} [commonMetadata] UpdateProcessorVersionMetadata commonMetadata + */ + + /** + * Constructs a new UpdateProcessorVersionMetadata. + * @memberof google.cloud.documentai.v1beta3 + * @classdesc Represents an UpdateProcessorVersionMetadata. + * @implements IUpdateProcessorVersionMetadata + * @constructor + * @param {google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata=} [properties] Properties to set + */ + function UpdateProcessorVersionMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateProcessorVersionMetadata commonMetadata. + * @member {google.cloud.documentai.v1beta3.ICommonOperationMetadata|null|undefined} commonMetadata + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @instance + */ + UpdateProcessorVersionMetadata.prototype.commonMetadata = null; + + /** + * Creates a new UpdateProcessorVersionMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} UpdateProcessorVersionMetadata instance + */ + UpdateProcessorVersionMetadata.create = function create(properties) { + return new UpdateProcessorVersionMetadata(properties); + }; + + /** + * Encodes the specified UpdateProcessorVersionMetadata message. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata} message UpdateProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProcessorVersionMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commonMetadata != null && Object.hasOwnProperty.call(message, "commonMetadata")) + $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.encode(message.commonMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateProcessorVersionMetadata message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.IUpdateProcessorVersionMetadata} message UpdateProcessorVersionMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateProcessorVersionMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateProcessorVersionMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} UpdateProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProcessorVersionMetadata.decode = function decode(reader, 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.v1beta3.UpdateProcessorVersionMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateProcessorVersionMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} UpdateProcessorVersionMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateProcessorVersionMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateProcessorVersionMetadata message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateProcessorVersionMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) { + var error = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.verify(message.commonMetadata); + if (error) + return "commonMetadata." + error; + } + return null; + }; + + /** + * Creates an UpdateProcessorVersionMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} UpdateProcessorVersionMetadata + */ + UpdateProcessorVersionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata) + return object; + var message = new $root.google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata(); + if (object.commonMetadata != null) { + if (typeof object.commonMetadata !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata.commonMetadata: object expected"); + message.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.fromObject(object.commonMetadata); + } + return message; + }; + + /** + * Creates a plain object from an UpdateProcessorVersionMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata} message UpdateProcessorVersionMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateProcessorVersionMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.commonMetadata = null; + if (message.commonMetadata != null && message.hasOwnProperty("commonMetadata")) + object.commonMetadata = $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.toObject(message.commonMetadata, options); + return object; + }; + + /** + * Converts this UpdateProcessorVersionMetadata to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateProcessorVersionMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateProcessorVersionMetadata + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateProcessorVersionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.UpdateProcessorVersionMetadata"; + }; + + return UpdateProcessorVersionMetadata; + })(); + v1beta3.EvaluationReference = (function() { /** @@ -87951,6 +88466,7 @@ * @property {Object.|null} [entityMetrics] Evaluation entityMetrics * @property {string|null} [kmsKeyName] Evaluation kmsKeyName * @property {string|null} [kmsKeyVersionName] Evaluation kmsKeyVersionName + * @property {Array.|null} [revisions] Evaluation revisions */ /** @@ -87963,6 +88479,7 @@ */ function Evaluation(properties) { this.entityMetrics = {}; + this.revisions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -88025,6 +88542,14 @@ */ Evaluation.prototype.kmsKeyVersionName = ""; + /** + * Evaluation revisions. + * @member {Array.} revisions + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @instance + */ + Evaluation.prototype.revisions = $util.emptyArray; + /** * Creates a new Evaluation instance using the specified properties. * @function create @@ -88066,6 +88591,9 @@ writer.uint32(/* id 6, wireType 2 =*/50).string(message.kmsKeyName); if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.kmsKeyVersionName); + if (message.revisions != null && message.revisions.length) + for (var i = 0; i < message.revisions.length; ++i) + $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.encode(message.revisions[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; @@ -88149,6 +88677,12 @@ message.kmsKeyVersionName = reader.string(); break; } + case 9: { + if (!(message.revisions && message.revisions.length)) + message.revisions = []; + message.revisions.push($root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -88218,6 +88752,15 @@ if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) if (!$util.isString(message.kmsKeyVersionName)) return "kmsKeyVersionName: string expected"; + 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.v1beta3.Evaluation.EvaluationRevision.verify(message.revisions[i]); + if (error) + return "revisions." + error; + } + } return null; }; @@ -88264,6 +88807,16 @@ message.kmsKeyName = String(object.kmsKeyName); if (object.kmsKeyVersionName != null) message.kmsKeyVersionName = String(object.kmsKeyVersionName); + if (object.revisions) { + if (!Array.isArray(object.revisions)) + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.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.v1beta3.Evaluation.revisions: object expected"); + message.revisions[i] = $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.fromObject(object.revisions[i]); + } + } return message; }; @@ -88280,6 +88833,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.revisions = []; if (options.objects || options.defaults) object.entityMetrics = {}; if (options.defaults) { @@ -88308,6 +88863,11 @@ object.kmsKeyName = message.kmsKeyName; if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) object.kmsKeyVersionName = message.kmsKeyVersionName; + if (message.revisions && message.revisions.length) { + object.revisions = []; + for (var j = 0; j < message.revisions.length; ++j) + object.revisions[j] = $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.toObject(message.revisions[j], options); + } return object; }; @@ -89703,6 +90263,334 @@ return MultiConfidenceMetrics; })(); + Evaluation.EvaluationRevision = (function() { + + /** + * Properties of an EvaluationRevision. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @interface IEvaluationRevision + * @property {string|null} [revisionId] EvaluationRevision revisionId + * @property {google.cloud.documentai.v1beta3.Evaluation.ICounters|null} [documentCounters] EvaluationRevision documentCounters + * @property {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null} [allEntitiesMetrics] EvaluationRevision allEntitiesMetrics + * @property {Object.|null} [entityMetrics] EvaluationRevision entityMetrics + */ + + /** + * Constructs a new EvaluationRevision. + * @memberof google.cloud.documentai.v1beta3.Evaluation + * @classdesc Represents an EvaluationRevision. + * @implements IEvaluationRevision + * @constructor + * @param {google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision=} [properties] Properties to set + */ + function EvaluationRevision(properties) { + this.entityMetrics = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationRevision revisionId. + * @member {string} revisionId + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @instance + */ + EvaluationRevision.prototype.revisionId = ""; + + /** + * EvaluationRevision documentCounters. + * @member {google.cloud.documentai.v1beta3.Evaluation.ICounters|null|undefined} documentCounters + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @instance + */ + EvaluationRevision.prototype.documentCounters = null; + + /** + * EvaluationRevision allEntitiesMetrics. + * @member {google.cloud.documentai.v1beta3.Evaluation.IMultiConfidenceMetrics|null|undefined} allEntitiesMetrics + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @instance + */ + EvaluationRevision.prototype.allEntitiesMetrics = null; + + /** + * EvaluationRevision entityMetrics. + * @member {Object.} entityMetrics + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @instance + */ + EvaluationRevision.prototype.entityMetrics = $util.emptyObject; + + /** + * Creates a new EvaluationRevision instance using the specified properties. + * @function create + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision=} [properties] Properties to set + * @returns {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} EvaluationRevision instance + */ + EvaluationRevision.create = function create(properties) { + return new EvaluationRevision(properties); + }; + + /** + * Encodes the specified EvaluationRevision message. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.verify|verify} messages. + * @function encode + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision} message EvaluationRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationRevision.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.documentCounters != null && Object.hasOwnProperty.call(message, "documentCounters")) + $root.google.cloud.documentai.v1beta3.Evaluation.Counters.encode(message.documentCounters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.allEntitiesMetrics != null && Object.hasOwnProperty.call(message, "allEntitiesMetrics")) + $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.encode(message.allEntitiesMetrics, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.entityMetrics != null && Object.hasOwnProperty.call(message, "entityMetrics")) + for (var keys = Object.keys(message.entityMetrics), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.encode(message.entityMetrics[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified EvaluationRevision message, length delimited. Does not implicitly {@link google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.IEvaluationRevision} message EvaluationRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationRevision.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationRevision message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} EvaluationRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationRevision.decode = function decode(reader, 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.v1beta3.Evaluation.EvaluationRevision(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.revisionId = reader.string(); + break; + } + case 2: { + message.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.entityMetrics === $util.emptyObject) + message.entityMetrics = {}; + 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.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.entityMetrics[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationRevision message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} EvaluationRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationRevision.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationRevision message. + * @function verify + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationRevision.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.documentCounters != null && message.hasOwnProperty("documentCounters")) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.verify(message.documentCounters); + if (error) + return "documentCounters." + error; + } + if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify(message.allEntitiesMetrics); + if (error) + return "allEntitiesMetrics." + error; + } + if (message.entityMetrics != null && message.hasOwnProperty("entityMetrics")) { + if (!$util.isObject(message.entityMetrics)) + return "entityMetrics: object expected"; + var key = Object.keys(message.entityMetrics); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.verify(message.entityMetrics[key[i]]); + if (error) + return "entityMetrics." + error; + } + } + return null; + }; + + /** + * Creates an EvaluationRevision message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} EvaluationRevision + */ + EvaluationRevision.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision) + return object; + var message = new $root.google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision(); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.documentCounters != null) { + if (typeof object.documentCounters !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.documentCounters: object expected"); + message.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.fromObject(object.documentCounters); + } + if (object.allEntitiesMetrics != null) { + if (typeof object.allEntitiesMetrics !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.allEntitiesMetrics: object expected"); + message.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.fromObject(object.allEntitiesMetrics); + } + if (object.entityMetrics) { + if (typeof object.entityMetrics !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.entityMetrics: object expected"); + message.entityMetrics = {}; + for (var keys = Object.keys(object.entityMetrics), i = 0; i < keys.length; ++i) { + if (typeof object.entityMetrics[keys[i]] !== "object") + throw TypeError(".google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision.entityMetrics: object expected"); + message.entityMetrics[keys[i]] = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.fromObject(object.entityMetrics[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an EvaluationRevision message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision} message EvaluationRevision + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationRevision.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.entityMetrics = {}; + if (options.defaults) { + object.revisionId = ""; + object.documentCounters = null; + object.allEntitiesMetrics = null; + } + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.documentCounters != null && message.hasOwnProperty("documentCounters")) + object.documentCounters = $root.google.cloud.documentai.v1beta3.Evaluation.Counters.toObject(message.documentCounters, options); + if (message.allEntitiesMetrics != null && message.hasOwnProperty("allEntitiesMetrics")) + object.allEntitiesMetrics = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.toObject(message.allEntitiesMetrics, options); + var keys2; + if (message.entityMetrics && (keys2 = Object.keys(message.entityMetrics)).length) { + object.entityMetrics = {}; + for (var j = 0; j < keys2.length; ++j) + object.entityMetrics[keys2[j]] = $root.google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.toObject(message.entityMetrics[keys2[j]], options); + } + return object; + }; + + /** + * Converts this EvaluationRevision to JSON. + * @function toJSON + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @instance + * @returns {Object.} JSON object + */ + EvaluationRevision.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationRevision + * @function getTypeUrl + * @memberof google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationRevision.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.documentai.v1beta3.Evaluation.EvaluationRevision"; + }; + + return EvaluationRevision; + })(); + return Evaluation; })(); @@ -94134,6 +95022,7 @@ * @property {google.cloud.documentai.v1beta3.DatasetSplitType|null} [datasetSplit] BatchDocumentsImportConfig datasetSplit * @property {google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.IAutoSplitConfig|null} [autoSplitConfig] BatchDocumentsImportConfig autoSplitConfig * @property {google.cloud.documentai.v1beta3.IBatchDocumentsInputConfig|null} [batchInputConfig] BatchDocumentsImportConfig batchInputConfig + * @property {string|null} [documentType] BatchDocumentsImportConfig documentType */ /** @@ -94175,6 +95064,14 @@ */ BatchDocumentsImportConfig.prototype.batchInputConfig = null; + /** + * BatchDocumentsImportConfig documentType. + * @member {string} documentType + * @memberof google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig + * @instance + */ + BatchDocumentsImportConfig.prototype.documentType = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -94219,6 +95116,8 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.datasetSplit); if (message.autoSplitConfig != null && Object.hasOwnProperty.call(message, "autoSplitConfig")) $root.google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.AutoSplitConfig.encode(message.autoSplitConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.documentType); return writer; }; @@ -94267,6 +95166,10 @@ message.batchInputConfig = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.decode(reader, reader.uint32()); break; } + case 6: { + message.documentType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -94330,6 +95233,9 @@ if (error) return "batchInputConfig." + error; } + if (message.documentType != null && message.hasOwnProperty("documentType")) + if (!$util.isString(message.documentType)) + return "documentType: string expected"; return null; }; @@ -94379,6 +95285,8 @@ throw TypeError(".google.cloud.documentai.v1beta3.ImportDocumentsRequest.BatchDocumentsImportConfig.batchInputConfig: object expected"); message.batchInputConfig = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.fromObject(object.batchInputConfig); } + if (object.documentType != null) + message.documentType = String(object.documentType); return message; }; @@ -94395,8 +95303,10 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.batchInputConfig = null; + object.documentType = ""; + } if (message.batchInputConfig != null && message.hasOwnProperty("batchInputConfig")) object.batchInputConfig = $root.google.cloud.documentai.v1beta3.BatchDocumentsInputConfig.toObject(message.batchInputConfig, options); if (message.datasetSplit != null && message.hasOwnProperty("datasetSplit")) { @@ -94409,6 +95319,8 @@ if (options.oneofs) object.splitTypeConfig = "autoSplitConfig"; } + if (message.documentType != null && message.hasOwnProperty("documentType")) + object.documentType = message.documentType; return object; }; diff --git a/packages/google-cloud-documentai/protos/protos.json b/packages/google-cloud-documentai/protos/protos.json index ac4054e0574..439c727fdc6 100644 --- a/packages/google-cloud-documentai/protos/protos.json +++ b/packages/google-cloud-documentai/protos/protos.json @@ -3862,11 +3862,6 @@ "documentWarehouseConfig", "unmanagedDatasetConfig" ] - }, - "indexingSource": { - "oneof": [ - "spannerIndexingConfig" - ] } }, "fields": { @@ -3892,13 +3887,6 @@ "(google.api.field_behavior)": "OPTIONAL" } }, - "spannerIndexingConfig": { - "type": "SpannerIndexingConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, "name": { "type": "string", "id": 1 @@ -3959,9 +3947,6 @@ "UnmanagedDatasetConfig": { "fields": {} }, - "SpannerIndexingConfig": { - "fields": {} - }, "State": { "values": { "STATE_UNSPECIFIED": 0, @@ -5660,6 +5645,13 @@ "entityValidationOutput": { "type": "EntityValidationOutput", "id": 3 + }, + "provenance": { + "type": "Provenance", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } } @@ -5738,6 +5730,15 @@ } } }, + "Documents": { + "fields": { + "documents": { + "rule": "repeated", + "type": "Document", + "id": 1 + } + } + }, "RawDocument": { "fields": { "content": { @@ -5783,6 +5784,15 @@ } } }, + "RawDocuments": { + "fields": { + "documents": { + "rule": "repeated", + "type": "RawDocument", + "id": 1 + } + } + }, "BatchDocumentsInputConfig": { "oneofs": { "source": { @@ -5992,6 +6002,13 @@ "metadata": { "type": "Metadata", "id": 4 + }, + "documentPrompt": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -6543,6 +6560,7 @@ "requestType": "ReviewDocumentRequest", "responseType": "google.longrunning.Operation", "options": { + "deprecated": true, "(google.api.http).post": "/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument", "(google.api.http).body": "*", "(google.api.method_signature)": "human_review_config", @@ -6550,6 +6568,9 @@ "(google.longrunning.operation_info).metadata_type": "ReviewDocumentOperationMetadata" }, "parsedOptions": [ + { + "deprecated": true + }, { "(google.api.http)": { "post": "/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument", @@ -6754,6 +6775,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "enableTableSplit": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -6845,7 +6873,10 @@ }, "skipHumanReview": { "type": "bool", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } }, "fieldMask": { "type": "google.protobuf.FieldMask", @@ -6953,7 +6984,10 @@ }, "skipHumanReview": { "type": "bool", - "id": 4 + "id": 4, + "options": { + "deprecated": true + } }, "processOptions": { "type": "ProcessOptions", @@ -7824,6 +7858,14 @@ } } }, + "UpdateProcessorVersionMetadata": { + "fields": { + "commonMetadata": { + "type": "CommonOperationMetadata", + "id": 1 + } + } + }, "EvaluationReference": { "fields": { "operation": { @@ -7881,6 +7923,11 @@ "kmsKeyVersionName": { "type": "string", "id": 7 + }, + "revisions": { + "rule": "repeated", + "type": "EvaluationRevision", + "id": 9 } }, "nested": { @@ -8005,6 +8052,39 @@ } } } + }, + "EvaluationRevision": { + "fields": { + "revisionId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentCounters": { + "type": "Counters", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "allEntitiesMetrics": { + "type": "MultiConfidenceMetrics", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "entityMetrics": { + "keyType": "string", + "type": "MultiConfidenceMetrics", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } } } }, @@ -8641,6 +8721,13 @@ "batchInputConfig": { "type": "BatchDocumentsInputConfig", "id": 1 + }, + "documentType": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { diff --git a/packages/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts b/packages/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts index 42465cc099d..3af96b9c5a9 100644 --- a/packages/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts +++ b/packages/google-cloud-documentai/src/v1beta3/document_processor_service_client.ts @@ -2264,6 +2264,7 @@ export class DocumentProcessorServiceClient { * for more details and examples. * @example include:samples/generated/v1beta3/document_processor_service.review_document.js * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_async + * @deprecated ReviewDocument is deprecated and may be removed in a future version. */ reviewDocument( request?: protos.google.cloud.documentai.v1beta3.IReviewDocumentRequest, @@ -2317,6 +2318,7 @@ export class DocumentProcessorServiceClient { 'human_review_config': request.humanReviewConfig ?? '', }); this.initialize().catch(err => {throw err}); + this.warn('DEP$DocumentProcessorService-$ReviewDocument','ReviewDocument is deprecated and may be removed in a future version.', 'DeprecationWarning'); const wrappedCallback: Callback< LROperation, protos.google.longrunning.IOperation|null|undefined, @@ -2346,8 +2348,10 @@ export class DocumentProcessorServiceClient { * for more details and examples. * @example include:samples/generated/v1beta3/document_processor_service.review_document.js * region_tag:documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_async + * @deprecated ReviewDocument is deprecated and may be removed in a future version. */ async checkReviewDocumentProgress(name: string): Promise>{ + this.warn('DEP$DocumentProcessorService-$checkReviewDocumentProgress','checkReviewDocumentProgress is deprecated and may be removed in a future version.', 'DeprecationWarning'); this._log.info('reviewDocument long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); const [operation] = await this.operationsClient.getOperation(request); diff --git a/packages/google-cloud-documentai/test/gapic_document_processor_service_v1beta3.ts b/packages/google-cloud-documentai/test/gapic_document_processor_service_v1beta3.ts index 4bf1678d650..693ad00eb7b 100644 --- a/packages/google-cloud-documentai/test/gapic_document_processor_service_v1beta3.ts +++ b/packages/google-cloud-documentai/test/gapic_document_processor_service_v1beta3.ts @@ -2423,6 +2423,7 @@ describe('v1beta3.DocumentProcessorServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); await client.initialize(); const request = generateSampleMessage( new protos.google.cloud.documentai.v1beta3.ReviewDocumentRequest() @@ -2437,6 +2438,7 @@ describe('v1beta3.DocumentProcessorServiceClient', () => { client.innerApiCalls.reviewDocument = stubLongRunningCall(expectedResponse); const [operation] = await client.reviewDocument(request); const [response] = await operation.promise(); + assert(stub.calledOnce); assert.deepStrictEqual(response, expectedResponse); const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) .getCall(0).args[0]; @@ -2451,6 +2453,7 @@ describe('v1beta3.DocumentProcessorServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); await client.initialize(); const request = generateSampleMessage( new protos.google.cloud.documentai.v1beta3.ReviewDocumentRequest() @@ -2478,6 +2481,7 @@ describe('v1beta3.DocumentProcessorServiceClient', () => { }); const operation = await promise as LROperation; const [response] = await operation.promise(); + assert(stub.calledOnce); assert.deepStrictEqual(response, expectedResponse); const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) .getCall(0).args[0]; @@ -2492,6 +2496,7 @@ describe('v1beta3.DocumentProcessorServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); await client.initialize(); const request = generateSampleMessage( new protos.google.cloud.documentai.v1beta3.ReviewDocumentRequest() @@ -2503,6 +2508,7 @@ describe('v1beta3.DocumentProcessorServiceClient', () => { const expectedError = new Error('expected'); client.innerApiCalls.reviewDocument = stubLongRunningCall(undefined, expectedError); await assert.rejects(client.reviewDocument(request), expectedError); + assert(stub.calledOnce); const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); @@ -2516,6 +2522,7 @@ describe('v1beta3.DocumentProcessorServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); await client.initialize(); const request = generateSampleMessage( new protos.google.cloud.documentai.v1beta3.ReviewDocumentRequest() @@ -2528,6 +2535,7 @@ describe('v1beta3.DocumentProcessorServiceClient', () => { client.innerApiCalls.reviewDocument = stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.reviewDocument(request); await assert.rejects(operation.promise(), expectedError); + assert(stub.calledOnce); const actualRequest = (client.innerApiCalls.reviewDocument as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); @@ -2541,6 +2549,7 @@ describe('v1beta3.DocumentProcessorServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); await client.initialize(); const expectedResponse = generateSampleMessage( new operationsProtos.google.longrunning.Operation() @@ -2551,6 +2560,7 @@ describe('v1beta3.DocumentProcessorServiceClient', () => { client.operationsClient.getOperation = stubSimpleCall(expectedResponse); const decodedOperation = await client.checkReviewDocumentProgress(expectedResponse.name); + assert(stub.calledOnce); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); @@ -2561,11 +2571,13 @@ describe('v1beta3.DocumentProcessorServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + const stub = sinon.stub(client, 'warn'); await client.initialize(); const expectedError = new Error('expected'); client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); await assert.rejects(client.checkReviewDocumentProgress(''), expectedError); + assert(stub.calledOnce); assert((client.operationsClient.getOperation as SinonStub) .getCall(0)); });